From abae1f9a3908d133e563ecfc54581e88534372f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 8 Feb 2024 16:16:42 -0800 Subject: [PATCH] more fixes --- QUERY-SPEC.md | 10 +++++----- SPEC.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/QUERY-SPEC.md b/QUERY-SPEC.md index 5fcb4ee..d67f9b2 100644 --- a/QUERY-SPEC.md +++ b/QUERY-SPEC.md @@ -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). ``` +query-str := bom? query query := selector q-ws* "||" q-ws* query | selector selector := filter q-ws* selector-operator q-ws* selector | filter selector-operator := ">>" | ">" | "++" | "+" -filter := matcher+ -matcher := "top()"| "()" | identifier | type | accessor-matcher -accessor-matcher := "[" (comparison | accessor)? "]" +filter := ( "top(" q-ws* ")" | "(" q-ws* ")" | type ) string? accessor-matcher* +accessor-matcher := "[" q-ws* (comparison | accessor)? q-ws* "]" 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 := "=" | "!=" | ">" | "<" | ">=" | "<=" | "^=" | "$=" | "*=" -q-ws := bom | unicode-space +q-ws := unicode-space ``` diff --git a/SPEC.md b/SPEC.md index a850913..39a9f28 100644 --- a/SPEC.md +++ b/SPEC.md @@ -445,7 +445,7 @@ desired. A Multi-line string _MUST_ start with a [Newline](#newline) immediately following its opening `"`. Its final line _MUST_ contain only whitespace, 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). 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*)? 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)* multi-line-string-body := string-character* 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] 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)* multi-line-raw-string-body := (unicode - disallowed-literal-code-points)*