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

Function eatDelimStr

states.go:455–486  ·  view source on GitHub ↗
(l *lexer, delim byte)

Source from the content-addressed store, hash-verified

453}
454
455func eatDelimStr(l *lexer, delim byte) bool {
456 first := l.next()
457 if first != delim {
458 l.rewind()
459 return false
460 }
461
462 for {
463 c := l.next()
464
465 if c == eof {
466 return false
467 }
468
469 if c == bs {
470 _, p := l.peek(1)
471 if p[0] == delim || p[0] == bs {
472 l.next()
473 }
474 } else if c == delim {
475 _, p := l.peek(1)
476 if p[0] == delim {
477 l.next()
478 } else {
479 break
480 }
481
482 }
483 }
484
485 return true
486}
487
488func eatIdentifier(l *lexer) bool {
489 b := l.next()

Callers 2

eatStringFunction · 0.85
eatIdentifierFunction · 0.85

Calls 3

nextMethod · 0.80
rewindMethod · 0.80
peekMethod · 0.80

Tested by

no test coverage detected