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

Method normalizeIdent

parser/antlr_parser.go:236–247  ·  view source on GitHub ↗

normalizeIdent returns the interpreted identifier.

(ctx gen.IEscapeIdentContext)

Source from the content-addressed store, hash-verified

234
235// normalizeIdent returns the interpreted identifier.
236func (p *antlrVisitor) normalizeIdent(ctx gen.IEscapeIdentContext) (string, error) {
237 switch ident := ctx.(type) {
238 case *gen.SimpleIdentifierContext:
239 return ident.GetId().GetText(), nil
240 case *gen.EscapedIdentifierContext:
241 if !p.enableIdentEscapeSyntax {
242 return "", errors.New("unsupported syntax: '`'")
243 }
244 return unescapeIdent(ident.GetId().GetText())
245 }
246 return "", errors.New("unsupported ident kind")
247}
248
249func (p *antlrVisitor) parse(expr runes.Buffer, desc string) ast.Expr {
250 lexer := gen.NewCELLexer(newCharStream(expr, desc))

Callers 2

VisitSelectMethod · 0.95

Calls 4

unescapeIdentFunction · 0.85
GetTextMethod · 0.80
NewMethod · 0.80
GetIdMethod · 0.65

Tested by

no test coverage detected