MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / precedence

Method precedence

pkg/filter/ql/token.go:175–190  ·  view source on GitHub ↗

precedence returns the operator precedence of the binary operator token.

()

Source from the content-addressed store, hash-verified

173
174// precedence returns the operator precedence of the binary operator token.
175func (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
192func tokstr(tok token, lit string) string {
193 if lit != "" {

Callers 1

ParseExprMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected