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

Method VisitConditionalOr

parser/antlr_parser.go:397–410  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalOr.

(ctx *gen.ConditionalOrContext)

Source from the content-addressed store, hash-verified

395
396// Visit a parse tree produced by CELParser#conditionalOr.
397func (p *antlrVisitor) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
398 result := p.Visit(ctx.GetE()).(ast.Expr)
399 l := p.newLogicManager(operators.LogicalOr, result)
400 rest := ctx.GetE1()
401 for i, op := range ctx.GetOps() {
402 if i >= len(rest) {
403 return p.reportError(ctx, "unexpected character, wanted '||'")
404 }
405 next := p.Visit(rest[i]).(ast.Expr)
406 opID := p.helper.id(op)
407 l.addTerm(opID, next)
408 }
409 return l.toExpr()
410}
411
412// Visit a parse tree produced by CELParser#conditionalAnd.
413func (p *antlrVisitor) 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