(p *Parser)
| 140 | } |
| 141 | |
| 142 | func (q *QueryParser) parseSelect(p *Parser) parseState { |
| 143 | qry := &Query{ |
| 144 | Columns: make([]string, 0), |
| 145 | } |
| 146 | |
| 147 | for { |
| 148 | i, ok := p.scan() |
| 149 | if !ok { |
| 150 | p.errorUnexpectedEOF() |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | if isOfAny(i, TIdentifier, TIntpStar) { |
| 155 | value := i.Val |
| 156 | if i.Type == TIdentifier { |
| 157 | value = identValue(i) |
| 158 | } |
| 159 | |
| 160 | qry.Columns = append(qry.Columns, value) |
| 161 | |
| 162 | j, ok := p.scan() |
| 163 | if !ok { |
| 164 | p.errorUnexpectedEOF() |
| 165 | return nil |
| 166 | } |
| 167 | |
| 168 | if j.Type == TComma { |
| 169 | continue |
| 170 | } |
| 171 | |
| 172 | if j.Type == TIntpFrom { |
| 173 | return q.parseSelectFromBuilder(qry) |
| 174 | } |
| 175 | |
| 176 | p.errorUnexpectedLex(i, TComma, TIntpFrom) |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | p.errorUnexpectedLex(i, TIdentifier, TIntpStar) |
| 181 | return nil |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func (q *QueryParser) parseSelectFromBuilder(qry *Query) parseState { |
| 186 | return func(p *Parser) parseState { |
nothing calls this directly
no test coverage detected