MCPcopy Create free account
hub / github.com/brimdata/super / read

Method read

compiler/parser/parser.go:24993–25009  ·  view source on GitHub ↗

read advances the parser to the next rune.

()

Source from the content-addressed store, hash-verified

24991
24992// read advances the parser to the next rune.
24993func (p *parser) read() {
24994 p.pt.offset += p.pt.w
24995 rn, n := utf8.DecodeRune(p.data[p.pt.offset:])
24996 p.pt.rn = rn
24997 p.pt.w = n
24998 p.pt.col++
24999 if rn == '\n' {
25000 p.pt.line++
25001 p.pt.col = 0
25002 }
25003
25004 if rn == utf8.RuneError && n == 1 { // see utf8.DecodeRune
25005 if !p.allowInvalidUTF8 {
25006 p.addErr(errInvalidEncoding)
25007 }
25008 }
25009}
25010
25011// restore parser position to the savepoint pt.
25012func (p *parser) restore(pt savepoint) {

Callers 4

parseMethod · 0.95
parseAnyMatcherMethod · 0.95
parseCharClassMatcherMethod · 0.95
parseLitMatcherMethod · 0.95

Calls 1

addErrMethod · 0.95

Tested by

no test coverage detected