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

Method VisitConditionalAnd

parser/antlr_parser.go:413–426  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#conditionalAnd.

(ctx *gen.ConditionalAndContext)

Source from the content-addressed store, hash-verified

411
412// Visit a parse tree produced by CELParser#conditionalAnd.
413func (p *antlrVisitor) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any {
414 result := p.Visit(ctx.GetE()).(ast.Expr)
415 l := p.newLogicManager(operators.LogicalAnd, result)
416 rest := ctx.GetE1()
417 for i, op := range ctx.GetOps() {
418 if i >= len(rest) {
419 return p.reportError(ctx, "unexpected character, wanted '&&'")
420 }
421 next := p.Visit(rest[i]).(ast.Expr)
422 opID := p.helper.id(op)
423 l.addTerm(opID, next)
424 }
425 return l.toExpr()
426}
427
428// Visit a parse tree produced by CELParser#relation.
429func (p *antlrVisitor) 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