filter-expr
NOTE: This library is still under development.
A library for parsing the filter expression.
use ;
let f = parse.unwrap;
assert_eq!;
You can evaluate it by yourself or use the filter-expr-evaler crate.
Syntax
Filter
<filter> = <expr> | <empty>
<empty> =
Expression
<expr> = <or_test> ('OR' <or_test>)*
<or_test> = <and_test> ('AND' <and_test>)*
<and_test> = ['NOT'] <comparison>
Comparison
<comparison> = <primary> <operator> <comparison>
| <primary>
<primary> = <func-call>
| <method-call>
| <field-access>
| <value>
<operator> = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'IN'
<func-call> = <ident> '(' [<value> (',' <value>)* ','?] ')'
<method-call> = <value> '.' <ident> '(' [<value> (',' <value>)* ','?] ')'
<field-access> = <value> '.' <ident>
<value> = <str>
| <i64>
| <f64>
| <bool>
| <null>
| <ident>
| <array>
| '(' <expr> ')'
<array> = '[' [<value> (',' <value>)* ','?] ']'