allow BOM only in the first unicode scalar in a document

This commit is contained in:
Kat Marchán 2023-12-12 22:51:52 -08:00
parent 13799de32b
commit 49402ccb7b
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 5 additions and 1 deletions

View File

@ -53,6 +53,8 @@
* Between annotations and the thing they're annotating (`(blah) node (thing)
1 y= (who) 2`)
* Around `=` for props (`x = 1`)
* The BOM is now only allowed as the first character in a document. It was
previously treated as generic whitespace.
### KQL

View File

@ -516,6 +516,8 @@ authoritative if something seems to disagree with the text above. The [grammar
language syntax](#grammar-language) is defined below.
```
document := bom? nodes
nodes := (line-space* node)* line-space*
plain-line-space := newline | ws | single-line-comment
@ -572,7 +574,7 @@ escline := '\\' ws* (single-line-comment | newline | eof)
newline := See Table (All line-break white_space)
ws := bom | unicode-space | multi-line-comment
ws := unicode-space | multi-line-comment
bom := '\u{FEFF}'