()
| 1002 | } |
| 1003 | |
| 1004 | func (m *Sqlbridge) parseFieldList() (Columns, error) { |
| 1005 | |
| 1006 | if m.Cur().T != lex.TokenLeftParenthesis { |
| 1007 | return nil, m.ErrMsg("Expecting opening paren") |
| 1008 | } |
| 1009 | m.Next() |
| 1010 | |
| 1011 | cols := make(Columns, 0) |
| 1012 | var col *Column |
| 1013 | |
| 1014 | for { |
| 1015 | |
| 1016 | //u.Debug(m.Cur().String()) |
| 1017 | switch m.Cur().T { |
| 1018 | case lex.TokenIdentity: |
| 1019 | col = NewColumnFromToken(m.Cur()) |
| 1020 | m.Next() |
| 1021 | } |
| 1022 | //u.Debugf("after colstart?: %v ", m.Cur()) |
| 1023 | |
| 1024 | // since we can loop inside switch statement |
| 1025 | switch m.Cur().T { |
| 1026 | case lex.TokenFrom, lex.TokenInto, lex.TokenLimit, lex.TokenEOS, lex.TokenEOF, |
| 1027 | lex.TokenRightParenthesis: |
| 1028 | cols = append(cols, col) |
| 1029 | return cols, nil |
| 1030 | case lex.TokenComma: |
| 1031 | cols = append(cols, col) |
| 1032 | default: |
| 1033 | return nil, m.ErrMsg("expected column but") |
| 1034 | } |
| 1035 | m.Next() |
| 1036 | } |
| 1037 | } |
| 1038 | |
| 1039 | func (m *Sqlbridge) parseUpdateList() (map[string]*ValueColumn, error) { |
| 1040 |
no test coverage detected