@@ -52,12 +52,16 @@ const (
5252 not // not
5353 contains // contains
5454 icontains // icontains
55- startswith // startswith
5655 istartswith // istartswith
57- iendswith // iendswith
56+ startswith // startswith
5857 endswith // endswith
58+ iendswith // iendswith
5959 matches // matches
6060 imatches // imatches
61+ fuzzy // fuzzy
62+ ifuzzy // ifuzzy
63+ fuzzynorm // fuzzynorm
64+ ifuzzynorm // ifuzzynorm
6165 eq // =
6266 neq // !=
6367 lt // <
@@ -76,7 +80,9 @@ var keywords map[string]token
7680
7781func init () {
7882 keywords = make (map [string ]token )
79- for _ , tok := range []token {and , or , contains , icontains , in , iin , not , startswith , istartswith , endswith , iendswith , matches , imatches } {
83+ for _ , tok := range []token {and , or , contains , icontains , in ,
84+ iin , not , startswith , istartswith , endswith , iendswith ,
85+ matches , imatches , fuzzy , ifuzzy , fuzzynorm , ifuzzynorm } {
8086 keywords [strings .ToLower (tokens [tok ])] = tok
8187 }
8288 keywords ["true" ] = truet
@@ -114,6 +120,10 @@ var tokens = [...]string{
114120 iendswith : "IENDSWITH" ,
115121 matches : "MATCHES" ,
116122 imatches : "IMATCHES" ,
123+ fuzzy : "FUZZY" ,
124+ ifuzzy : "IFUZZY" ,
125+ fuzzynorm : "FUZZYNORM" ,
126+ ifuzzynorm : "IFUZZYNORM" ,
117127
118128 eq : "=" ,
119129 neq : "!=" ,
@@ -150,8 +160,8 @@ func (tok token) precedence() int {
150160 return 3
151161 case eq , neq , lt , lte , gt , gte :
152162 return 4
153- case in , iin , contains , icontains , startswith , istartswith ,
154- endswith , iendswith , matches , imatches :
163+ case in , iin , contains , icontains , startswith , istartswith , endswith , iendswith ,
164+ matches , imatches , fuzzy , ifuzzy , fuzzynorm , ifuzzynorm :
155165 return 5
156166 }
157167 return 0
0 commit comments