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

Method VisitConditionalAnd

parser/parser.go:498–511  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalAnd.

(ctx *gen.ConditionalAndContext)

Source from the content-addressed store, hash-verified

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