MCPcopy Create free account
hub / github.com/cel-expr/cel-go / VisitRelation

Method VisitRelation

parser/parser.go:522–534  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#relation.

(ctx *gen.RelationContext)

Source from the content-addressed store, hash-verified

520
521// Visit a parse tree produced by CELParser#relation.
522func (p *parser) VisitRelation(ctx *gen.RelationContext) any {
523 opText := ""
524 if ctx.GetOp() != nil {
525 opText = ctx.GetOp().GetText()
526 }
527 if op, found := operators.Find(opText); found {
528 lhs := p.Visit(ctx.Relation(0)).(ast.Expr)
529 opID := p.helper.id(ctx.GetOp())
530 rhs := p.Visit(ctx.Relation(1)).(ast.Expr)
531 return p.globalCallOrMacro(opID, op, lhs, rhs)
532 }
533 return p.reportError(ctx, "operator not found")
534}
535
536// Visit a parse tree produced by CELParser#calc.
537func (p *parser) VisitCalc(ctx *gen.CalcContext) any {

Callers 1

VisitMethod · 0.95

Calls 8

VisitMethod · 0.95
globalCallOrMacroMethod · 0.95
reportErrorMethod · 0.95
FindFunction · 0.92
GetTextMethod · 0.80
idMethod · 0.80
GetOpMethod · 0.65
RelationMethod · 0.65

Tested by

no test coverage detected