(term TokenKind, pos Pos)
| 543 | } |
| 544 | |
| 545 | func (p *Parser) parseColumnExprListWithTerm(term TokenKind, pos Pos) (*ColumnExprList, error) { |
| 546 | columnExprList := &ColumnExprList{ |
| 547 | ListPos: pos, |
| 548 | ListEnd: pos, |
| 549 | } |
| 550 | columnExprList.HasDistinct = p.tryConsumeKeywords(KeywordDistinct) |
| 551 | columnList := make([]Expr, 0) |
| 552 | for !p.lexer.isEOF() || p.last() != nil { |
| 553 | if term != "" && p.matchTokenKind(term) { |
| 554 | break |
| 555 | } |
| 556 | columnExpr, err := p.parseColumnsExpr(p.Pos()) |
| 557 | if err != nil { |
| 558 | return nil, err |
| 559 | } |
| 560 | if columnExpr == nil { |
| 561 | break |
| 562 | } |
| 563 | columnList = append(columnList, columnExpr) |
| 564 | if p.tryConsumeTokenKind(TokenKindComma) == nil { |
| 565 | break |
| 566 | } |
| 567 | } |
| 568 | columnExprList.Items = columnList |
| 569 | if len(columnList) > 0 { |
| 570 | columnExprList.ListEnd = columnList[len(columnList)-1].End() |
| 571 | } |
| 572 | return columnExprList, nil |
| 573 | } |
| 574 | |
| 575 | func (p *Parser) parseSelectItems() ([]*SelectItem, error) { |
| 576 | selectItems := make([]*SelectItem, 0) |
no test coverage detected