MCPcopy Create free account
hub / github.com/donatj/sqlread / selectIdentifierIntpState

Method selectIdentifierIntpState

interpreter.go:150–181  ·  view source on GitHub ↗
(l *lexer)

Source from the content-addressed store, hash-verified

148}
149
150func (intp *Intp) selectIdentifierIntpState(l *lexer) state {
151 l.accept(whitespace)
152 l.start = l.pos
153
154 if l.hasPrefix("*") {
155 l.pos += 1
156 l.emit(TIntpStar)
157 } else if eatIdentifier(l) {
158 l.emit(TIdentifier)
159 } else {
160 l.emit(TIllegal)
161 return nil
162 }
163
164 l.start = l.pos
165
166 l.accept(whitespace)
167
168 if l.hasPrefixI("FROM") {
169 return intp.selectFromIntpState
170 }
171
172 c := l.next()
173 if c == coma {
174 l.emit(TComma)
175 return intp.selectIdentifierIntpState
176 }
177
178 // return StartIntpState
179 l.emit(TIllegal)
180 return nil
181}
182
183func (intp *Intp) selectFromIntpState(l *lexer) state {
184 l.start = l.pos

Callers

nothing calls this directly

Calls 6

eatIdentifierFunction · 0.85
acceptMethod · 0.80
hasPrefixMethod · 0.80
emitMethod · 0.80
hasPrefixIMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected