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

Method normalizeIdent

parser/parser.go:169–180  ·  view source on GitHub ↗

normalizeIdent returns the interpreted identifier.

(ctx gen.IEscapeIdentContext)

Source from the content-addressed store, hash-verified

167
168// normalizeIdent returns the interpreted identifier.
169func (p *parser) normalizeIdent(ctx gen.IEscapeIdentContext) (string, error) {
170 switch ident := ctx.(type) {
171 case *gen.SimpleIdentifierContext:
172 return ident.GetId().GetText(), nil
173 case *gen.EscapedIdentifierContext:
174 if !p.enableIdentEscapeSyntax {
175 return "", errors.New("unsupported syntax: '`'")
176 }
177 return unescapeIdent(ident.GetId().GetText())
178 }
179 return "", errors.New("unsupported ident kind")
180}
181
182// Parse converts a source input a parsed expression.
183// 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