MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / parseIdentOrStar

Method parseIdentOrStar

parser/parser_common.go:128–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126}
127
128func (p *Parser) parseIdentOrStar() (*Ident, error) {
129 switch {
130 case p.matchTokenKind(TokenKindIdent):
131 return p.parseIdent()
132 case p.matchTokenKind("*"):
133 lastToken := p.last()
134 _ = p.lexer.consumeToken()
135 return &Ident{
136 NamePos: lastToken.Pos,
137 NameEnd: lastToken.End,
138 Name: lastToken.String,
139 }, nil
140 default:
141 return nil, fmt.Errorf("expected <ident> or *, but got %q", p.lastTokenKind())
142 }
143}
144
145func (p *Parser) parseIdentOrString() (*Ident, error) {
146 switch {

Callers 1

parseGrantSourceMethod · 0.95

Calls 5

matchTokenKindMethod · 0.95
parseIdentMethod · 0.95
lastMethod · 0.95
lastTokenKindMethod · 0.95
consumeTokenMethod · 0.80

Tested by

no test coverage detected