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

Method VisitGlobalCall

parser/parser.go:703–721  ·  view source on GitHub ↗

Visit a parse tree produced by CELParser#GlobalCallContext.

(ctx *gen.GlobalCallContext)

Source from the content-addressed store, hash-verified

701
702// Visit a parse tree produced by CELParser#GlobalCallContext.
703func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any {
704 identName := ""
705 if ctx.GetLeadingDot() != nil {
706 identName = "."
707 }
708 // Handle the error case where no valid identifier is specified.
709 if ctx.GetId() == nil {
710 return p.helper.newExpr(ctx)
711 }
712 // Handle reserved identifiers.
713 id := ctx.GetId().GetText()
714 if _, ok := reservedIds[id]; ok {
715 return p.reportError(ctx, "reserved identifier: %s", id)
716 }
717 identName += id
718 opID := p.helper.id(ctx.GetOp())
719 return p.globalCallOrMacro(opID, identName, p.visitExprList(ctx.GetArgs())...)
720
721}
722
723// Visit a parse tree produced by CELParser#CreateList.
724func (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