Update SPEC.md for KDL 2.0 preview

This commit is contained in:
Christopher Durham 2022-08-28 15:32:35 -05:00 committed by GitHub
parent 850703a84d
commit 3d22478c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 4 deletions

29
SPEC.md
View File

@ -3,7 +3,9 @@
This is the semi-formal specification for KDL, including the intended data
model and the grammar.
This document describes KDL version `1.0.0`. It was released on September 11, 2021.
This document describes KDL version `2.0.0-preview`.
KDL version `1.0.0` was released on September 11, 2021.
## Introduction
@ -24,6 +26,22 @@ the directions if the data stream were only ASCII text. They do not refer
to the writing direction of text, which can flow in either direction,
depending on the characters used.
## Changes from version `1.0.0`
### Relaxed
- The way that `/-` comments are handled has changed. Now, `/-` comments are
consistently treated like whitespace. Notably, this means that `/-` children
blocks do not prevent the presence of later arguments, properties, or children
blocks on the attached node.
### Constrained
- Previously, whitespace was not required before a children block, i.e. `node{}`
was valid. Now, whitespace is required before a children block, the same as
before arguments and properties.
- `/-` comments on nodes must also be separated by plain (non-`/-`) whitespace.
## Components
### Document
@ -444,10 +462,13 @@ Note that for the purpose of new lines, CRLF is considered _a single newline_.
```
nodes := (line-space* node)* line-space*
line-space := newline | ws | single-line-comment | '/-' node-space* node
node-space := ws* escline ws* | ws+ | '/-' node-space* (node-prop-or-arg | node-children)
plain-line-space := newline | ws | single-line-comment
plain-node-space := ws* escline ws* | ws+
node := type? identifier (node-space+ node-prop-or-arg)* (node-space* node-children)? node-space* node-terminator
line-space := (plain-line-space+ '/-' plain-node-space* node)* plain-line-space+
node-space := (plain-node-space+ '/-' plain-node-space* (node-prop-or-arg | node-children))* plain-node-space+
node := type? identifier (node-space+ node-prop-or-arg)* (node-space+ node-children)? node-space* node-terminator
node-prop-or-arg := prop | value
node-children := '{' nodes '}'
node-terminator := single-line-comment | newline | ';' | eof