PushBack rewinds the lexer by n tokens.
(n int)
| 536 | |
| 537 | // PushBack rewinds the lexer by n tokens. |
| 538 | func (l *lexer) PushBack(n int) { |
| 539 | if n < 0 { |
| 540 | panic(errors.AssertionFailedf("negative n provided to PushBack")) |
| 541 | } |
| 542 | l.lastPos -= n |
| 543 | if l.lastPos < -1 { |
| 544 | // Return to the initialized state. |
| 545 | l.lastPos = -1 |
| 546 | } |
| 547 | if n >= 1 { |
| 548 | // Invalidate the parser lookahead token. |
| 549 | l.parser.(*plpgsqlParserImpl).char = -1 |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | // Advance advances the lexer by n tokens. |
| 554 | func (l *lexer) Advance(n int) { |
no outgoing calls
no test coverage detected