parseIdent parses an identifier
()
| 959 | |
| 960 | // parseIdent parses an identifier |
| 961 | func (p *Parser) parseIdent() *ast.Identifier { |
| 962 | // Accept both regular identifiers and double-quoted identifiers |
| 963 | if !p.isType(models.TokenTypeIdentifier) && !p.isType(models.TokenTypeDoubleQuotedString) { |
| 964 | return nil |
| 965 | } |
| 966 | pos := p.currentLocation() |
| 967 | ident := &ast.Identifier{Name: p.currentToken.Token.Value, Pos: pos} |
| 968 | p.advance() |
| 969 | return ident |
| 970 | } |
| 971 | |
| 972 | // parseIdentAsString parses an identifier and returns its name as a string |
| 973 | func (p *Parser) parseIdentAsString() string { |
no test coverage detected