precedence returns the operator precedence of the binary operator token.
()
| 173 | |
| 174 | // precedence returns the operator precedence of the binary operator token. |
| 175 | func (tok token) precedence() int { |
| 176 | switch tok { |
| 177 | case Or: |
| 178 | return 1 |
| 179 | case And: |
| 180 | return 2 |
| 181 | case Not: |
| 182 | return 3 |
| 183 | case Eq, IEq, Neq, Lt, Lte, Gt, Gte: |
| 184 | return 4 |
| 185 | case In, IIn, Contains, IContains, Startswith, IStartswith, Endswith, IEndswith, |
| 186 | Matches, IMatches, Fuzzy, IFuzzy, Fuzzynorm, IFuzzynorm, Intersects, IIntersects: |
| 187 | return 5 |
| 188 | } |
| 189 | return 0 |
| 190 | } |
| 191 | |
| 192 | func tokstr(tok token, lit string) string { |
| 193 | if lit != "" { |