normalizeIdent returns the interpreted identifier.
(ctx gen.IEscapeIdentContext)
| 167 | |
| 168 | // normalizeIdent returns the interpreted identifier. |
| 169 | func (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. |
no test coverage detected