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

Method VisitConditionalOr

parser/parser.go:482–495  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalOr.

(ctx *gen.ConditionalOrContext)

Source from the content-addressed store, hash-verified

480
481// Visit a parse tree produced by CELParser#conditionalOr.
482func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
483 result := p.Visit(ctx.GetE()).(ast.Expr)
484 l := p.newLogicManager(operators.LogicalOr, result)
485 rest := ctx.GetE1()
486 for i, op := range ctx.GetOps() {
487 if i >= len(rest) {
488 return p.reportError(ctx, "unexpected character, wanted '||'")
489 }
490 next := p.Visit(rest[i]).(ast.Expr)
491 opID := p.helper.id(op)
492 l.addTerm(opID, next)
493 }
494 return l.toExpr()
495}
496
497// Visit a parse tree produced by CELParser#conditionalAnd.
498func (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