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