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

Method failAt

compiler/parser/parser.go:24973–24990  ·  view source on GitHub ↗
(fail bool, pos position, want string)

Source from the content-addressed store, hash-verified

24971}
24972
24973func (p *parser) failAt(fail bool, pos position, want string) {
24974 // process fail if parsing fails and not inverted or parsing succeeds and invert is set
24975 if fail == p.maxFailInvertExpected {
24976 if pos.offset < p.maxFailPos.offset {
24977 return
24978 }
24979
24980 if pos.offset > p.maxFailPos.offset {
24981 p.maxFailPos = pos
24982 p.maxFailExpected = p.maxFailExpected[:0]
24983 }
24984
24985 if p.maxFailInvertExpected {
24986 want = "!" + want
24987 }
24988 p.maxFailExpected = append(p.maxFailExpected, want)
24989 }
24990}
24991
24992// read advances the parser to the next rune.
24993func (p *parser) read() {

Callers 3

parseAnyMatcherMethod · 0.95
parseCharClassMatcherMethod · 0.95
parseLitMatcherMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected