more predictable slashdash

Fixes: https://github.com/kdl-org/kdl/issues/401
This commit is contained in:
Kat Marchán 2024-11-26 23:53:36 -08:00
parent 1588b1f5fd
commit 5f5e0878b2
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 10 additions and 9 deletions

View File

@ -36,7 +36,7 @@
* Bare identifiers can now be used as values in Arguments and Properties, and are interpreted as string values.
* The spec prose now more explicitly states that strings and raw strings can
be used as type annotations.
* A statement in the spec prose that said "It is reasonable for an
* Removed a statement in the spec prose that said "It is reasonable for an
implementation to ignore null values altogether when deserializing". This is
no longer encouraged or desired.
* Code points have been constrained to [Unicode Scalar
@ -69,6 +69,7 @@
* Correspondingly, the identifiers `inf`, `-inf`, and `nan` are now syntax
errors.
* `u128` and `i128` have been added as well-known number type annotations.
* Slashdash (`/-`) -compatible locations adjusted to be more clear and intuitive.
### KQL

16
SPEC.md
View File

@ -697,16 +697,16 @@ Finally, a special kind of comment called a "slashdash", denoted by `/-`, can
be used to comment out entire _components_ of a KDL document logically, and
have those elements be treated as whitespace.
Slashdash comments can be used before:
Slashdash comments can be used before the following, including before their type
annotations, if present:
* A [Node](#node) name (or its type annotation): the entire Node is
* A [Node](#node) name: the entire Node is
treated as Whitespace, including all props, args, and children.
* A node [Argument](#argument) (or its type annotation), in which case
the Argument value is treated as Whitespace.
* A [Property](#property) key, in which case the entire property, both
key and value, is treated as Whitespace.
* A [Children Block](#children-block), in which case the entire block,
including all children within, is treated as Whitespace.
* A node [Argument](#argument): the Argument value is treated as Whitespace.
* A [Property](#property) key: the entire property, including both key and value,
is treated as Whitespace. A slashdash of just the property value is not allowed.
* A [Children Block](#children-block): the entire block, including all children within,
is treated as Whitespace. Other node items may follow a slashdashed children block.
### Newline