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

Method tryParseIdent

parser/parser_common.go:100–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func (p *Parser) tryParseIdent() *Ident {
101 if p.lastTokenKind() != TokenKindIdent {
102 return nil
103 }
104 lastToken := p.last()
105 _ = p.lexer.consumeToken()
106 return &Ident{
107 NamePos: lastToken.Pos,
108 NameEnd: lastToken.End,
109 Name: lastToken.String,
110 QuoteType: lastToken.QuoteType,
111 }
112}
113
114func (p *Parser) parseIdent() (*Ident, error) {
115 lastToken := p.last()

Callers 1

parseSelectItemMethod · 0.95

Calls 3

lastTokenKindMethod · 0.95
lastMethod · 0.95
consumeTokenMethod · 0.80

Tested by

no test coverage detected