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

Method VisitIdent

parser/parser.go:684–700  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#Ident.

(ctx *gen.IdentContext)

Source from the content-addressed store, hash-verified

682
683// Visit a parse tree produced by CELParser#Ident.
684func (p *parser) VisitIdent(ctx *gen.IdentContext) any {
685 identName := ""
686 if ctx.GetLeadingDot() != nil {
687 identName = "."
688 }
689 // Handle the error case where no valid identifier is specified.
690 if ctx.GetId() == nil {
691 return p.helper.newExpr(ctx)
692 }
693 // Handle reserved identifiers.
694 id := ctx.GetId().GetText()
695 if _, ok := reservedIds[id]; ok {
696 return p.reportError(ctx, "reserved identifier: %s", id)
697 }
698 identName += id
699 return p.helper.newIdent(ctx.GetId(), identName)
700}
701
702// Visit a parse tree produced by CELParser#GlobalCallContext.
703func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any {

Callers 1

VisitMethod · 0.95

Calls 6

reportErrorMethod · 0.95
GetTextMethod · 0.80
newIdentMethod · 0.80
GetLeadingDotMethod · 0.65
GetIdMethod · 0.65
newExprMethod · 0.45

Tested by

no test coverage detected