allow ,<> as identifier characters since they no longer need to be reserved

This commit is contained in:
Kat Marchán 2023-12-10 15:48:29 -08:00
parent ee032d3c59
commit 9c5a06117a
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 10 additions and 4 deletions

View File

@ -8,8 +8,14 @@
* Single line comments (`//`) can now be immediately followed by a newline.
* All literal whitespace following a `\` in a string is now discarded.
* Vertical tabs (`U+000B`) are now considered to be whitespace.
* Identifiers can't start with `r#`, so they're easy to distinguish from raw strings. (They already similarly can't start with a digit, or a sign+digit, so they're easy to distinguish from numbers.)
* The grammar syntax itself has been described, and some confusing definitions in the grammar have been fixed accordingly (mostly related to escaped characters).
* Identifiers can't start with `r#`, so they're easy to distinguish from raw
strings. (They already similarly can't start with a digit, or a sign+digit,
so they're easy to distinguish from numbers.)
* The grammar syntax itself has been described, and some confusing definitions
in the grammar have been fixed accordingly (mostly related to escaped
characters).
* `,`, `<`, and `>` are not legal identifier characters. They were previously
reserved for KQL but this is no longer necessary.
### KQL

View File

@ -124,7 +124,7 @@ The following characters cannot be used anywhere in a bare
* Any codepoint with hexadecimal value `0x20` or below.
* Any codepoint with hexadecimal value higher than `0x10FFFF`.
* Any of `\/(){}<>;[]=,"`
* Any of `\/(){};[]="`
### Line Continuation
@ -498,7 +498,7 @@ bare-identifier := (unambiguous-ident | numberish-ident | stringish-ident) - key
unambiguous-ident := (identifier-char - digit - sign - "r") identifier-char*
numberish-ident := sign ((identifier-char - digit) identifier-char*)?
stringish-ident := "r" ((identifier-char - "#") identifier-char*)?
identifier-char := unicode - line-space - [\\/(){}<>;\[\]=,"]
identifier-char := unicode - line-space - [\\/(){};\[\]="]
keyword := boolean | 'null'
prop := identifier '=' value
value := type? (string | number | keyword)