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

Method VisitConditionalAnd

parser/parser.go:506–519  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalAnd.

(ctx *gen.ConditionalAndContext)

Source from the content-addressed store, hash-verified

504
505// Visit a parse tree produced by CELParser#conditionalAnd.
506func (p *parser) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any {
507 result := p.Visit(ctx.GetE()).(ast.Expr)
508 l := p.newLogicManager(operators.LogicalAnd, result)
509 rest := ctx.GetE1()
510 for i, op := range ctx.GetOps() {
511 if i >= len(rest) {
512 return p.reportError(ctx, "unexpected character, wanted '&&'")
513 }
514 next := p.Visit(rest[i]).(ast.Expr)
515 opID := p.helper.id(op)
516 l.addTerm(opID, next)
517 }
518 return l.toExpr()
519}
520
521// Visit a parse tree produced by CELParser#relation.
522func (p *parser) VisitRelation(ctx *gen.RelationContext) 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