MCPcopy Create free account
hub / github.com/donatj/sqlread / insertRowState

Function insertRowState

states.go:103–144  ·  view source on GitHub ↗
(l *lexer)

Source from the content-addressed store, hash-verified

101}
102
103func 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
146func doubleDashCommentStateBuilder(ret state) state {
147 return func(l *lexer) state {

Callers

nothing calls this directly

Calls 7

inFunction · 0.85
eatNumberFunction · 0.85
eatStringFunction · 0.85
nextMethod · 0.80
rewindMethod · 0.80
emitMethod · 0.80
hasPrefixMethod · 0.80

Tested by

no test coverage detected