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

Method normalizeIdent

parser/parser.go:162–173  ·  view source on GitHub ↗

normalizeIdent returns the interpreted identifier.

(ctx gen.IEscapeIdentContext)

Source from the content-addressed store, hash-verified

160
161// normalizeIdent returns the interpreted identifier.
162func (p *parser) normalizeIdent(ctx gen.IEscapeIdentContext) (string, error) {
163 switch ident := ctx.(type) {
164 case *gen.SimpleIdentifierContext:
165 return ident.GetId().GetText(), nil
166 case *gen.EscapedIdentifierContext:
167 if !p.enableIdentEscapeSyntax {
168 return "", errors.New("unsupported syntax: '`'")
169 }
170 return unescapeIdent(ident.GetId().GetText())
171 }
172 return "", errors.New("unsupported ident kind")
173}
174
175// Parse converts a source input a parsed expression.
176// This function calls ParseWithMacros with AllMacros.

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