MCPcopy Index your code
hub / github.com/donatj/sqlread / parseSelectFromBuilder

Method parseSelectFromBuilder

query.go:185–218  ·  view source on GitHub ↗
(qry *Query)

Source from the content-addressed store, hash-verified

183}
184
185func (q *QueryParser) parseSelectFromBuilder(qry *Query) parseState {
186 return func(p *Parser) parseState {
187 c, ok := p.scan()
188 if !ok {
189 p.errorUnexpectedEOF()
190 return nil
191 }
192
193 if c.Type != TIdentifier {
194 p.errorUnexpectedLex(c, TIdentifier)
195 return nil
196 }
197
198 qry.Table = identValue(c)
199
200 d, ok := p.scan()
201 if !ok {
202 p.errorUnexpectedEOF()
203 return nil
204 }
205
206 if d.Type == TSemi {
207 q.Tree.Queries = append(q.Tree.Queries, *qry)
208 return nil
209 }
210
211 if d.Type == TIntpIntoOutfile {
212 return q.parseSelectIntoOutfileBuilder(qry)
213 }
214
215 p.errorUnexpectedLex(d, TSemi, TIntpIntoOutfile)
216 return nil
217 }
218}
219
220func (q *QueryParser) parseSelectIntoOutfileBuilder(qry *Query) parseState {
221 return func(p *Parser) parseState {

Callers 1

parseSelectMethod · 0.95

Calls 5

identValueFunction · 0.85
scanMethod · 0.80
errorUnexpectedEOFMethod · 0.80
errorUnexpectedLexMethod · 0.80

Tested by

no test coverage detected