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

Method VisitRelation

parser/parser.go:514–526  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#relation.

(ctx *gen.RelationContext)

Source from the content-addressed store, hash-verified

512
513// Visit a parse tree produced by CELParser#relation.
514func (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.
529func (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