diff --git a/README.md b/README.md index cc90509..3c09c92 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,22 @@ bignum 1_000_000 my-hex 0xdeadbeef my-octal 0o755 my-binary 0b1010_1101 + +// You can comment out individual nodes with /-. In the case below, everything +// up until the closing `}` becomes commented. +/-mynode "foo" key=1 { + a + b + c +} + +// You can apply /- ("slashdash") comments to individual values, properties, +// or child blocks, too: +mynode /-"commented" "not commented" /-key="value" /-{ + a + b +} + ``` The following SDLang features are removed altogether: diff --git a/SPEC.md b/SPEC.md index 5b0d86f..a6f8491 100644 --- a/SPEC.md +++ b/SPEC.md @@ -45,8 +45,9 @@ linespace := newline | ws | single-line-comment newline := ('\r' '\n') | '\n' -ws := bom | ' ' | '\t' | multi-line-comment +ws := bom | ' ' | '\t' | multi-line-comment | slashdash-comment single-line-comment := '//' ('\r' [^\n] | [^\r\n])* newline multi-line-comment := '/*' ('*' [^\/] | [^*])* '*/' +slashdash-comment := '/-' (node | value | prop | node-children) ```