mirror of https://github.com/kdl-org/kdl.git
clean up node grammar + allow slashdash spaces
This commit is contained in:
parent
144f8d775f
commit
cc169da2c2
10
SPEC.md
10
SPEC.md
|
|
@ -290,13 +290,13 @@ Note that for the purpose of new lines, CRLF is considered _a single newline_.
|
||||||
## Full Grammar
|
## Full Grammar
|
||||||
|
|
||||||
```
|
```
|
||||||
// FIXME: I don't... think this is quite right?
|
nodes := linespace* (node nodes?)? linespace*
|
||||||
nodes := linespace* (node (newline nodes)? linespace*)?
|
|
||||||
|
|
||||||
node := '/-'? identifier (node-space node-props-and-args)* (node-space node-document)? single-line-comment?
|
node := '/-'? ws* identifier (node-space node-props-and-args)* (node-terminator | (node-space node-children))
|
||||||
node-props-and-args := '/-'? prop | value
|
node-props-and-args := '/-'? ws* (prop | value)
|
||||||
node-children := '/-'? '{' nodes '}'
|
node-children := '/-'? ws* '{' nodes '}'
|
||||||
node-space := ws* escline ws* | ws+
|
node-space := ws* escline ws* | ws+
|
||||||
|
node-terminator := single-line-comment | newline | ';'
|
||||||
|
|
||||||
identifier := (identifier-char - digit - [<>]) identifier-char* | string
|
identifier := (identifier-char - digit - [<>]) identifier-char* | string
|
||||||
identifier-char := unicode - digit - linespace - [\{}<>;[]=,]
|
identifier-char := unicode - digit - linespace - [\{}<>;[]=,]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue