normalizeIdent returns the interpreted identifier.
(ctx gen.IEscapeIdentContext)
| 234 | |
| 235 | // normalizeIdent returns the interpreted identifier. |
| 236 | func (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 | |
| 249 | func (p *antlrVisitor) parse(expr runes.Buffer, desc string) ast.Expr { |
| 250 | lexer := gen.NewCELLexer(newCharStream(expr, desc)) |
no test coverage detected