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

Method VisitConditionalOr

parser/parser.go:490–503  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalOr.

(ctx *gen.ConditionalOrContext)

Source from the content-addressed store, hash-verified

488
489// Visit a parse tree produced by CELParser#conditionalOr.
490func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
491 result := p.Visit(ctx.GetE()).(ast.Expr)
492 l := p.newLogicManager(operators.LogicalOr, result)
493 rest := ctx.GetE1()
494 for i, op := range ctx.GetOps() {
495 if i >= len(rest) {
496 return p.reportError(ctx, "unexpected character, wanted '||'")
497 }
498 next := p.Visit(rest[i]).(ast.Expr)
499 opID := p.helper.id(op)
500 l.addTerm(opID, next)
501 }
502 return l.toExpr()
503}
504
505// Visit a parse tree produced by CELParser#conditionalAnd.
506func (p *parser) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any {

Callers 1

VisitMethod · 0.95

Calls 9

VisitMethod · 0.95
newLogicManagerMethod · 0.95
reportErrorMethod · 0.95
idMethod · 0.80
addTermMethod · 0.80
toExprMethod · 0.80
GetEMethod · 0.65
GetE1Method · 0.65
GetOpsMethod · 0.65

Tested by

no test coverage detected