| 101 | } |
| 102 | |
| 103 | func insertRowState(l *lexer) state { |
| 104 | l.start = l.pos |
| 105 | for { |
| 106 | c := l.next() |
| 107 | |
| 108 | if in(c, numbers) || c == dash { |
| 109 | l.rewind() |
| 110 | if eatNumber(l) { |
| 111 | l.emit(TNumber) |
| 112 | break |
| 113 | } |
| 114 | } else if c == sq || c == dq { |
| 115 | l.rewind() |
| 116 | if eatString(l) { |
| 117 | l.emit(TString) |
| 118 | break |
| 119 | } |
| 120 | } else if c == letN && l.hasPrefix("ULL") { |
| 121 | l.pos += 3 |
| 122 | l.emit(TNull) |
| 123 | break |
| 124 | } |
| 125 | |
| 126 | l.emit(TIllegal) |
| 127 | return nil |
| 128 | } |
| 129 | |
| 130 | d := l.next() |
| 131 | |
| 132 | if d == rprn { |
| 133 | // l.rewind() |
| 134 | // l.emit(TInsertRow) |
| 135 | return insertRowsState |
| 136 | } |
| 137 | |
| 138 | if d == coma { |
| 139 | return insertRowState |
| 140 | } |
| 141 | |
| 142 | l.emit(TIllegal) |
| 143 | return nil |
| 144 | } |
| 145 | |
| 146 | func doubleDashCommentStateBuilder(ret state) state { |
| 147 | return func(l *lexer) state { |