1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#[derive(Debug)]
pub enum Symbol {
GroupStart,
GroupEnd,
And,
Or,
Not,
Equal,
EqualCI,
Greater,
Less,
Wildcard,
Regex,
In,
IsNone,
}
#[derive(Debug)]
pub enum Expr {
And(Box<Expression>, Box<Expression>),
Or(Box<Expression>, Box<Expression>),
Not(Box<Expression>),
Equal(String, String),
EqualCI(String, String),
Greater(String, String),
Less(String, String),
Wildcard(String, String),
Regex(String, String),
In(String, Vec<String>),
IsNone(String),
}
#[derive(Debug, Default, Clone, Copy)]
pub struct Span {
pub lo: usize,
pub hi: usize,
}
#[derive(Debug)]
pub struct Expression {
pub span: Span,
pub node: Expr,
}
#[derive(Debug)]
pub struct Search {
pub stmts: Vec<Expression>,
}