(op Operator, e FieldExpression)
| 617 | } |
| 618 | |
| 619 | func newUnaryOperation(op Operator, e FieldExpression) FieldExpression { |
| 620 | unop := UnaryOperation{ |
| 621 | Op: op, |
| 622 | Expression: e, |
| 623 | } |
| 624 | |
| 625 | // AST rewrite for simplification |
| 626 | if !unop.referencesSpan() && unop.validate() == nil { |
| 627 | if simplified, err := unop.execute(nil); err == nil { |
| 628 | return simplified |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | return unop |
| 633 | } |
| 634 | |
| 635 | // nolint: revive |
| 636 | func (UnaryOperation) __fieldExpression() {} |