more fixes

This commit is contained in:
Kat Marchán 2024-02-08 16:16:42 -08:00
parent 793a9d4ce7
commit abae1f9a39
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 8 additions and 8 deletions

View File

@ -107,15 +107,15 @@ Then the following queries are valid:
For rules that are not defined in this grammar, see [the KDL grammar](https://github.com/kdl-org/kdl/blob/main/SPEC.md#full-grammar). For rules that are not defined in this grammar, see [the KDL grammar](https://github.com/kdl-org/kdl/blob/main/SPEC.md#full-grammar).
``` ```
query-str := bom? query
query := selector q-ws* "||" q-ws* query | selector query := selector q-ws* "||" q-ws* query | selector
selector := filter q-ws* selector-operator q-ws* selector | filter selector := filter q-ws* selector-operator q-ws* selector | filter
selector-operator := ">>" | ">" | "++" | "+" selector-operator := ">>" | ">" | "++" | "+"
filter := matcher+ filter := ( "top(" q-ws* ")" | "(" q-ws* ")" | type ) string? accessor-matcher*
matcher := "top()"| "()" | identifier | type | accessor-matcher accessor-matcher := "[" q-ws* (comparison | accessor)? q-ws* "]"
accessor-matcher := "[" (comparison | accessor)? "]"
comparison := accessor q-ws* matcher-operator q-ws* (type | identifier | string | number | keyword) comparison := accessor q-ws* matcher-operator q-ws* (type | identifier | string | number | keyword)
accessor := "val(" number ")" | "prop(" identifier ")" | "name()" | "tag()" | "values()" | "props()" | identifier accessor := "val(" q-ws* integer q-ws* ")" | "prop(" q-ws* identifier q-ws* ")" | "name(" q-ws* ")" | "tag(" q-ws* ")" | "values(" q-ws* ")" | "props(" q-ws* ")" | identifier
matcher-operator := "=" | "!=" | ">" | "<" | ">=" | "<=" | "^=" | "$=" | "*=" matcher-operator := "=" | "!=" | ">" | "<" | ">=" | "<=" | "^=" | "$=" | "*="
q-ws := bom | unicode-space q-ws := unicode-space
``` ```

View File

@ -445,7 +445,7 @@ desired.
A Multi-line string _MUST_ start with a [Newline](#newline) immediately A Multi-line string _MUST_ start with a [Newline](#newline) immediately
following its opening `"`. Its final line _MUST_ contain only whitespace, following its opening `"`. Its final line _MUST_ contain only whitespace,
followed by a single closing `"`. All in-between lines that contain followed by a single closing `"`. All in-between lines that contain
non-whitespace characters _MUST_ start with the exact same whitespace as the non-newline characters _MUST_ start with the exact same whitespace as the
final line (precisely matching codepoints, not merely counting characters). final line (precisely matching codepoints, not merely counting characters).
The value of the Multi-line String omits the first and last Newline, the The value of the Multi-line String omits the first and last Newline, the
@ -738,7 +738,7 @@ signed-ident := sign ((identifier-char - digit - '.') identifier-char*)?
dotted-ident := sign? '.' ((identifier-char - digit) identifier-char*)? dotted-ident := sign? '.' ((identifier-char - digit) identifier-char*)?
identifier-char := unicode - unicode-space - newline - [\\/(){};\[\]"#] - disallowed-literal-code-points - equals-sign identifier-char := unicode - unicode-space - newline - [\\/(){};\[\]"#] - disallowed-literal-code-points - equals-sign
quoted-string := '"' (single-line-string-body | newline multi-line-string-body newline ws*) '"' quoted-string := '"' (single-line-string-body | newline multi-line-string-body newline unicode-space*) '"'
single-line-string-body := (string-character - newline)* single-line-string-body := (string-character - newline)*
multi-line-string-body := string-character* multi-line-string-body := string-character*
string-character := '\' escape | [^\\"] - disallowed-literal-code-points string-character := '\' escape | [^\\"] - disallowed-literal-code-points
@ -746,7 +746,7 @@ escape := ["\\bfnrt] | 'u{' hex-digit{1, 6} '}' | (unicode-space | newline)+
hex-digit := [0-9a-fA-F] hex-digit := [0-9a-fA-F]
raw-string := '#' raw-string-quotes '#' | '#' raw-string '#' raw-string := '#' raw-string-quotes '#' | '#' raw-string '#'
raw-string-quotes := '"' (single-line-raw-string-body | newline multi-line-raw-string-body newline ws*) '"' raw-string-quotes := '"' (single-line-raw-string-body | newline multi-line-raw-string-body newline unicode-space*) '"'
single-line-raw-string-body := (unicode - newline - disallowed-literal-code-points)* single-line-raw-string-body := (unicode - newline - disallowed-literal-code-points)*
multi-line-raw-string-body := (unicode - disallowed-literal-code-points)* multi-line-raw-string-body := (unicode - disallowed-literal-code-points)*