MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / PushBack

Method PushBack

pkg/sql/plpgsql/parser/lexer.go:538–551  ·  view source on GitHub ↗

PushBack rewinds the lexer by n tokens.

(n int)

Source from the content-addressed store, hash-verified

536
537// PushBack rewinds the lexer by n tokens.
538func (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.
554func (l *lexer) Advance(n int) {

Callers 8

MakeExecSqlStmtMethod · 0.95
MakeFetchOrMoveStmtMethod · 0.95
peekForExecuteMethod · 0.95
findFirstOccurrenceMethod · 0.95
readSQLConstructMethod · 0.95
NewTickerMethod · 0.80
ClearMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected