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

Method ParseStart

query.go:34–66  ·  view source on GitHub ↗
(p *Parser)

Source from the content-addressed store, hash-verified

32}
33
34func (q *QueryParser) ParseStart(p *Parser) parseState {
35 for {
36 c, ok := p.scan()
37 if !ok {
38 break
39 }
40
41 if isOfAny(c, TIntpSelect) {
42 return q.parseSelect
43 }
44
45 if isOfAny(c, TIntpShowTables) {
46 return q.parseShowTables
47 }
48
49 if isOfAny(c, TIntpShowColumns) {
50 return q.parseShowColumns
51 }
52
53 if isOfAny(c, TIntpShowCreateTable) {
54 return q.parseShowCreateTable
55 }
56
57 if isOfAny(c, TIntpQuit) {
58 return q.parseQuit
59 }
60
61 p.errorUnexpectedLex(c, TIntpSelect, TIntpShowTables, TIntpQuit)
62 return nil
63 }
64
65 return nil
66}
67
68func (q *QueryParser) parseQuit(p *Parser) parseState {
69 x, ok := p.scan()

Callers

nothing calls this directly

Calls 3

isOfAnyFunction · 0.85
scanMethod · 0.80
errorUnexpectedLexMethod · 0.80

Tested by

no test coverage detected