Visit a parse tree produced by CELParser#relation.
(ctx *gen.RelationContext)
| 512 | |
| 513 | // Visit a parse tree produced by CELParser#relation. |
| 514 | func (p *parser) VisitRelation(ctx *gen.RelationContext) any { |
| 515 | opText := "" |
| 516 | if ctx.GetOp() != nil { |
| 517 | opText = ctx.GetOp().GetText() |
| 518 | } |
| 519 | if op, found := operators.Find(opText); found { |
| 520 | lhs := p.Visit(ctx.Relation(0)).(ast.Expr) |
| 521 | opID := p.helper.id(ctx.GetOp()) |
| 522 | rhs := p.Visit(ctx.Relation(1)).(ast.Expr) |
| 523 | return p.globalCallOrMacro(opID, op, lhs, rhs) |
| 524 | } |
| 525 | return p.reportError(ctx, "operator not found") |
| 526 | } |
| 527 | |
| 528 | // Visit a parse tree produced by CELParser#calc. |
| 529 | func (p *parser) VisitCalc(ctx *gen.CalcContext) any { |
no test coverage detected