Files
tuliprox/src/filter.pest
T
2024-03-13 12:06:30 +01:00

19 lines
501 B
Plaintext

WHITESPACE = _{ " " | "\t" }
field = { ^"group" | ^"title" | ^"name" | ^"url" }
and = { ^"and" }
or = { ^"or" }
not = { ^"not" }
regexp = @{ "\"" ~ ( "\\\"" | (!"\"" ~ ANY) )* ~ "\"" }
comparison_value = _{ regexp }
comparison = { field ~ "~" ~ comparison_value }
bool_op = { and | or}
expr_group = { "(" ~ expr ~ ")" }
expr = {
comparison ~ (bool_op ~ expr)*
| expr_group ~ (bool_op ~ expr)*
| not ~ expr ~ (bool_op ~ expr)*
}
stmt = { expr ~ (bool_op ~ expr)* }
main = _{ SOI ~ stmt ~ EOI }