spec out slashdash comments

Fixes: https://github.com/kdl-org/kdl/issues/22
This commit is contained in:
Kat Marchán 2020-12-14 20:54:04 -08:00
parent 3cdd8437e3
commit cc45c98562
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 18 additions and 1 deletions

View File

@ -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:

View File

@ -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)
```