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

Function eatNumber

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

Source from the content-addressed store, hash-verified

421}
422
423func eatNumber(l *lexer) bool {
424 if l.hasPrefix("-") {
425 l.pos++
426 }
427
428 n1 := l.accept(numbers)
429 n2 := 0
430
431 p := l.next()
432 if p == dot {
433 n2 = l.accept(numbers)
434 if n2 == 0 {
435 return false
436 }
437 } else {
438 l.rewind()
439 }
440
441 return n1+n2 > 0
442}
443
444func eatString(l *lexer) bool {
445 delim := l.next()

Callers 1

insertRowStateFunction · 0.85

Calls 4

hasPrefixMethod · 0.80
acceptMethod · 0.80
nextMethod · 0.80
rewindMethod · 0.80

Tested by

no test coverage detected