sync synchronizes the global offset position in the main Pushup parser with the Go code scanner.
()
| 662 | // sync synchronizes the global offset position in the main Pushup parser with |
| 663 | // the Go code scanner. |
| 664 | func (p *codeParser) sync() goToken { |
| 665 | t := p.peek() |
| 666 | // the Go scanner skips over whitespace so we need to be careful about the |
| 667 | // logic for advancing the main parser internal source offset. |
| 668 | p.parser.offset = p.tokenOffset(t) + len(t.String()) |
| 669 | return t |
| 670 | } |
| 671 | |
| 672 | // advance consumes the lookahead token (which should be accessed via p.peek()) |
| 673 | func (p *codeParser) advance() { |
no test coverage detected