(fail bool, pos position, want string)
| 24971 | } |
| 24972 | |
| 24973 | func (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. |
| 24993 | func (p *parser) read() { |
no outgoing calls
no test coverage detected