From b5c584456db3bc8ca9787e143fd4d5c940708ad1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Amiel Date: Fri, 4 Apr 2025 11:20:14 +0200 Subject: [PATCH] Update grammar following implemenation: operator has 0 or many spaces, while prediacates have 1 or many spaces. --- docs/grammar.md | 22 +++++++++++----------- docs/spec/grammar/README.md | 5 ++--- docs/spec/grammar/hurl.grammar | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/docs/grammar.md b/docs/grammar.md index 5488400626..b1cc40712f 100644 --- a/docs/grammar.md +++ b/docs/grammar.md @@ -180,19 +180,19 @@ Short description: |iso-date-predicate
|is-ipv4-predicate
|is-ipv6-predicate -
equal-predicate(used by predicate-func)
-
not-equal-predicate(used by predicate-func)
-
greater-predicate(used by predicate-func)
-
greater-or-equal-predicate(used by predicate-func)
-
less-predicate(used by predicate-func)
-
less-or-equal-predicate(used by predicate-func)
-
start-with-predicate(used by predicate-func)
-
end-with-predicate(used by predicate-func)
-
contain-predicate(used by predicate-func)
contains sp quoted-string
-
match-predicate(used by predicate-func)
matches sp (quoted-string|regex)
+
equal-predicate(used by predicate-func)
+
not-equal-predicate(used by predicate-func)
+
greater-predicate(used by predicate-func)
+
greater-or-equal-predicate(used by predicate-func)
+
less-predicate(used by predicate-func)
+
less-or-equal-predicate(used by predicate-func)
+
start-with-predicate(used by predicate-func)
+
end-with-predicate(used by predicate-func)
+
contain-predicate(used by predicate-func)
contains sp sp* quoted-string
+
match-predicate(used by predicate-func)
matches sp sp* (quoted-string|regex)
exist-predicate(used by predicate-func)
exists
is-empty-predicate(used by predicate-func)
isEmpty
-
include-predicate(used by predicate-func)
includes sp predicate-value
+
include-predicate(used by predicate-func)
includes sp sp* predicate-value
integer-predicate(used by predicate-func)
isInteger
float-predicate(used by predicate-func)
isFloat
boolean-predicate(used by predicate-func)
isBoolean
diff --git a/docs/spec/grammar/README.md b/docs/spec/grammar/README.md index 416dd462ce..af4060f970 100644 --- a/docs/spec/grammar/README.md +++ b/docs/spec/grammar/README.md @@ -1,7 +1,6 @@ -This grammar can be validated and converted to HTML with the cli from -https://github.com/fabricereix/grammar +This grammar can be validated and converted to HTML with the cli from -Validate and generate HTML +# Validate and generate HTML ```shell $ ./generate_html.sh diff --git a/docs/spec/grammar/hurl.grammar b/docs/spec/grammar/hurl.grammar index 9fb4b551cb..b24479eee3 100644 --- a/docs/spec/grammar/hurl.grammar +++ b/docs/spec/grammar/hurl.grammar @@ -325,31 +325,31 @@ predicate-func: | is-ipv4-predicate | is-ipv6-predicate -equal-predicate: "==" sp predicate-value +equal-predicate: "==" sp* predicate-value -not-equal-predicate: "!=" sp predicate-value +not-equal-predicate: "!=" sp* predicate-value -greater-predicate: ">" sp (number | quoted-string) +greater-predicate: ">" sp* (number | quoted-string) -greater-or-equal-predicate: ">=" sp sp* (number | quoted-string) +greater-or-equal-predicate: ">=" sp* (number | quoted-string) -less-predicate: "<" sp (number | quoted-string) +less-predicate: "<" sp* (number | quoted-string) -less-or-equal-predicate: "<=" sp (number | quoted-string) +less-or-equal-predicate: "<=" sp* (number | quoted-string) -start-with-predicate: "startsWith" sp (quoted-string | oneline-hex | oneline-base64) +start-with-predicate: "startsWith" sp sp* (quoted-string | oneline-hex | oneline-base64) -end-with-predicate: "endsWith" sp (quoted-string | oneline-hex | oneline-base64) +end-with-predicate: "endsWith" sp sp* (quoted-string | oneline-hex | oneline-base64) -contain-predicate: "contains" sp quoted-string +contain-predicate: "contains" sp sp* quoted-string -match-predicate: "matches" sp (quoted-string | regex) +match-predicate: "matches" sp sp* (quoted-string | regex) exist-predicate: "exists" is-empty-predicate: "isEmpty" -include-predicate: "includes" sp predicate-value +include-predicate: "includes" sp sp* predicate-value integer-predicate: "isInteger"