While the grammar makes no statements about match order, parsers pretty universally test for decimal last, after the other number productions, because `0b010` (/etc) can look like a `0` followed by garbage. Matching this order can reduce confusion.
Closes#330.
Fixes: https://github.com/kdl-org/kdl/issues/306
In the specifications of KQL and JiK, replace the
usage of 'tag' with 'type annotation', as that is
the term in the main KDL specification.
This PR modifies string descriptions in SPEC.md to use more consistent language throughout, with the primary intention of removing long descriptions like "a property key is either an identifier or a string". There are no semantic changes to KDL here.
Did an editorial pass over the document, rewriting most of the prose slightly.
Caught a place or two that was still referring to tags for object keys.
Sole non-editorial change was adding the final ambiguous case - a completely empty node. These are required to have an `(array)` or `(object)` tag to be valid.
The grammar doesn't specify that children count
as node terminator, but the text does.
The following document would be valid per text,
but invalid per spec.
```kdl
node { child {} }
```
Fixes#274
* replaces a `foo foo*` with a `foo+`
* switches the name of the production to singular, since it only represents one prop/arg at a time
No normative changes intended.
Per the grammar (`decimal := integer ('.' [0-9] [0-9_]*)? exponent?`), underscores in the fraction part should be allowed (as in `node 1.0_2`, the contents of the corresponding input file), but there was no expected_kdl file for this test case, indicating it's supposed to be a parse failure.
I'm assuming this was a mistake, since underscores in the fraction part make complete sense (and are allowed in the other two parts of a decimal number).
/ is not a valid identifier character. This updates
unusual_chars_in_bare_id.kdl to only include unusual but valid
identifier characters, and adds separate invalid input tests
for non-identifier characters.
Fixes#166