(qry *Query)
| 218 | } |
| 219 | |
| 220 | func (q *QueryParser) parseSelectIntoOutfileBuilder(qry *Query) parseState { |
| 221 | return func(p *Parser) parseState { |
| 222 | c, ok := p.scan() |
| 223 | if !ok { |
| 224 | p.errorUnexpectedEOF() |
| 225 | return nil |
| 226 | } |
| 227 | |
| 228 | if c.Type != TString { |
| 229 | p.errorUnexpectedLex(c, TString) |
| 230 | return nil |
| 231 | } |
| 232 | |
| 233 | s, err := stringValue(c) |
| 234 | if err != nil { |
| 235 | p.err = err |
| 236 | return nil |
| 237 | } |
| 238 | |
| 239 | qry.Outfile = &s |
| 240 | |
| 241 | d, ok := p.scan() |
| 242 | if !ok { |
| 243 | p.errorUnexpectedEOF() |
| 244 | return nil |
| 245 | } |
| 246 | if d.Type == TSemi { |
| 247 | q.Tree.Queries = append(q.Tree.Queries, *qry) |
| 248 | return nil |
| 249 | } |
| 250 | |
| 251 | p.errorUnexpectedLex(d, TSemi) |
| 252 | return nil |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | func identValue(c LexItem) string { |
| 257 | // remove backticks - if/when we implement backtickless |
no test coverage detected