()
| 411 | } |
| 412 | |
| 413 | func (m *FilterQLParser) parseFirstFilters() (expr.Node, error) { |
| 414 | |
| 415 | // We have 2 special cases in filterQL |
| 416 | // FILTER * |
| 417 | // FILTER match_all |
| 418 | switch m.Cur().T { |
| 419 | case lex.TokenStar, lex.TokenMultiply: |
| 420 | |
| 421 | m.Next() // Consume * |
| 422 | n := expr.NewIdentityNodeVal("*") |
| 423 | // if we have match all, nothing else allowed |
| 424 | return n, nil |
| 425 | |
| 426 | case lex.TokenIdentity: |
| 427 | if strings.ToLower(m.Cur().V) == "match_all" { |
| 428 | m.Next() |
| 429 | n := expr.NewIdentityNodeVal("match_all") |
| 430 | // if we have match all, nothing else allowed |
| 431 | return n, nil |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | m.discardCommentsNewLines() |
| 436 | |
| 437 | n, err := expr.ParseExprWithFuncs(m.filterTokenPager, m.funcs) |
| 438 | if err != nil { |
| 439 | u.Errorf("could not parse: %v", err) |
| 440 | return nil, err |
| 441 | } |
| 442 | |
| 443 | return n, nil |
| 444 | } |
| 445 | |
| 446 | func (m *FilterQLParser) parseLimit() (int, error) { |
| 447 | if m.Cur().T != lex.TokenLimit { |
no test coverage detected