improve the error messages and add tests for the filters

This commit is contained in:
Tamo
2021-09-06 17:07:34 +02:00
parent bd4c248292
commit ebf82ac28c
2 changed files with 119 additions and 10 deletions

View File

@@ -8,6 +8,8 @@ char = _{ !(PEEK | "\\") ~ ANY
| "\\" ~ (PEEK | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})}
// we deliberately choose to allow empty parameters to generate more specific error message later
parameters ={"(" ~ (value ~ ",")* ~ value? ~ ")"}
condition = _{between | eq | greater | less | geq | leq | neq}
between = {key ~ value ~ "TO" ~ value}
geq = {key ~ ">=" ~ value}
@@ -16,7 +18,7 @@ neq = {key ~ "!=" ~ value}
eq = {key ~ "=" ~ value}
greater = {key ~ ">" ~ value}
less = {key ~ "<" ~ value}
geo_radius = {"_geoRadius(" ~ value ~ "," ~ value ~ "," ~ value ~ ")"}
geo_radius = {"_geoRadius" ~ parameters }
prgm = {SOI ~ expr ~ EOI}
expr = _{ ( term ~ (operation ~ term)* ) }