mirror of https://github.com/kdl-org/kdl.git
Rename/rearrange the string productions to match the spec text better.
This commit is contained in:
parent
24cd2141d3
commit
bc2b995bfe
22
SPEC.md
22
SPEC.md
|
|
@ -682,28 +682,28 @@ node-space := plain-node-space+ ('/-' plain-node-space* (node-prop-or-arg | node
|
||||||
required-node-space := node-space* plain-node-space+
|
required-node-space := node-space* plain-node-space+
|
||||||
optional-node-space := node-space*
|
optional-node-space := node-space*
|
||||||
|
|
||||||
base-node := type? optional-node-space identifier (required-node-space node-prop-or-arg)* (required-node-space node-children)?
|
base-node := type? optional-node-space string (required-node-space node-prop-or-arg)* (required-node-space node-children)?
|
||||||
node := base-node optional-node-space node-terminator
|
node := base-node optional-node-space node-terminator
|
||||||
final-node := base-node optional-node-space node-terminator?
|
final-node := base-node optional-node-space node-terminator?
|
||||||
node-prop-or-arg := prop | value
|
node-prop-or-arg := prop | value
|
||||||
node-children := '{' nodes final-node? '}'
|
node-children := '{' nodes final-node? '}'
|
||||||
node-terminator := single-line-comment | newline | ';' | eof
|
node-terminator := single-line-comment | newline | ';' | eof
|
||||||
|
|
||||||
identifier := string | bare-identifier
|
keyword := '#' (boolean | 'null')
|
||||||
bare-identifier := (unambiguous-ident - boolean - 'null') | numberish-ident | dotted-ident
|
prop := string optional-node-space equals-sign optional-node-space value
|
||||||
|
value := type? optional-node-space (string | number | keyword)
|
||||||
|
type := '(' optional-node-space string optional-node-space ')'
|
||||||
|
equals-sign := See Table (Equals Sign)
|
||||||
|
|
||||||
|
string := identifier-string | quoted-string | raw-string
|
||||||
|
|
||||||
|
identifier-string := (unambiguous-ident - boolean - 'null') | numberish-ident | dotted-ident
|
||||||
unambiguous-ident := (identifier-char - digit - sign - '.') identifier-char*
|
unambiguous-ident := (identifier-char - digit - sign - '.') identifier-char*
|
||||||
numberish-ident := sign ((identifier-char - digit - '.') identifier-char*)?
|
numberish-ident := sign ((identifier-char - digit - '.') identifier-char*)?
|
||||||
dotted-ident := '.' ((identifier-char - digit) identifier-char*)?
|
dotted-ident := '.' ((identifier-char - digit) identifier-char*)?
|
||||||
identifier-char := unicode - line-space - [\\/(){};\[\]="#] - disallowed-literal-code-points
|
identifier-char := unicode - line-space - [\\/(){};\[\]="#] - disallowed-literal-code-points
|
||||||
|
|
||||||
keyword := '#' (boolean | 'null')
|
quoted-string := '"' (single-line-string-body | newline multi-line-string-body newline ws*) '"'
|
||||||
prop := identifier optional-node-space equals-sign optional-node-space value
|
|
||||||
value := type? optional-node-space (identifier | string | number | keyword)
|
|
||||||
type := '(' optional-node-space identifier optional-node-space ')'
|
|
||||||
equals-sign := See Table (Equals Sign)
|
|
||||||
|
|
||||||
string := raw-string | escaped-string
|
|
||||||
escaped-string := '"' (single-line-string-body | newline multi-line-string-body newline ws*) '"'
|
|
||||||
single-line-string-body := (string-character - newline)*
|
single-line-string-body := (string-character - newline)*
|
||||||
multi-line-string-body := string-character*
|
multi-line-string-body := string-character*
|
||||||
string-character := '\' escape | [^\\"] - disallowed-literal-code-points
|
string-character := '\' escape | [^\\"] - disallowed-literal-code-points
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue