mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-12-03 02:25:10 +08:00
30 lines
785 B
Plaintext
30 lines
785 B
Plaintext
key = _{quoted | word}
|
|
value = _{quoted | word}
|
|
quoted = _{ (PUSH("'") | PUSH("\"")) ~ string ~ POP }
|
|
string = {char*}
|
|
word = ${(LETTER | NUMBER | "_" | "-" | ".")+}
|
|
|
|
char = _{ !(PEEK | "\\") ~ ANY
|
|
| "\\" ~ (PEEK | "\\" | "/" | "b" | "f" | "n" | "r" | "t")
|
|
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4})}
|
|
|
|
condition = _{between | eq | greater | less | geq | leq | neq}
|
|
between = {key ~ value ~ "TO" ~ value}
|
|
geq = {key ~ ">=" ~ value}
|
|
leq = {key ~ "<=" ~ value}
|
|
neq = {key ~ "!=" ~ value}
|
|
eq = {key ~ "=" ~ value}
|
|
greater = {key ~ ">" ~ value}
|
|
less = {key ~ "<" ~ value}
|
|
|
|
prgm = {SOI ~ expr ~ EOI}
|
|
expr = _{ ( term ~ (operation ~ term)* ) }
|
|
term = { ("(" ~ expr ~ ")") | condition | not }
|
|
operation = _{ and | or }
|
|
and = {"AND"}
|
|
or = {"OR"}
|
|
|
|
not = {"NOT" ~ term}
|
|
|
|
WHITESPACE = _{ " " }
|