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

Method VisitGlobalCall

parser/parser.go:695–713  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#GlobalCallContext.

(ctx *gen.GlobalCallContext)

Source from the content-addressed store, hash-verified

693
694// Visit a parse tree produced by CELParser#GlobalCallContext.
695func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any {
696 identName := ""
697 if ctx.GetLeadingDot() != nil {
698 identName = "."
699 }
700 // Handle the error case where no valid identifier is specified.
701 if ctx.GetId() == nil {
702 return p.helper.newExpr(ctx)
703 }
704 // Handle reserved identifiers.
705 id := ctx.GetId().GetText()
706 if _, ok := reservedIds[id]; ok {
707 return p.reportError(ctx, "reserved identifier: %s", id)
708 }
709 identName += id
710 opID := p.helper.id(ctx.GetOp())
711 return p.globalCallOrMacro(opID, identName, p.visitExprList(ctx.GetArgs())...)
712
713}
714
715// Visit a parse tree produced by CELParser#CreateList.
716func (p *parser) VisitCreateList(ctx *gen.CreateListContext) any {

Callers 1

VisitMethod · 0.95

Calls 10

reportErrorMethod · 0.95
globalCallOrMacroMethod · 0.95
visitExprListMethod · 0.95
GetTextMethod · 0.80
idMethod · 0.80
GetLeadingDotMethod · 0.65
GetIdMethod · 0.65
GetOpMethod · 0.65
GetArgsMethod · 0.65
newExprMethod · 0.45

Tested by

no test coverage detected