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

Method VisitIdent

parser/parser.go:676–692  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#Ident.

(ctx *gen.IdentContext)

Source from the content-addressed store, hash-verified

674
675// Visit a parse tree produced by CELParser#Ident.
676func (p *parser) VisitIdent(ctx *gen.IdentContext) any {
677 identName := ""
678 if ctx.GetLeadingDot() != nil {
679 identName = "."
680 }
681 // Handle the error case where no valid identifier is specified.
682 if ctx.GetId() == nil {
683 return p.helper.newExpr(ctx)
684 }
685 // Handle reserved identifiers.
686 id := ctx.GetId().GetText()
687 if _, ok := reservedIds[id]; ok {
688 return p.reportError(ctx, "reserved identifier: %s", id)
689 }
690 identName += id
691 return p.helper.newIdent(ctx.GetId(), identName)
692}
693
694// Visit a parse tree produced by CELParser#GlobalCallContext.
695func (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