MCPcopy Create free account
hub / github.com/dolthub/doltgresql / AdvanceBy

Method AdvanceBy

testing/generation/command_docs/scanner.go:97–105  ·  view source on GitHub ↗

AdvanceBy advances the scanner by the given amount. If the amount is greater than the number of remaining runes, then it advances to the end. Cannot advance backwards.

(n int)

Source from the content-addressed store, hash-verified

95// AdvanceBy advances the scanner by the given amount. If the amount is greater than the number of remaining runes, then
96// it advances to the end. Cannot advance backwards.
97func (scanner *Scanner) AdvanceBy(n int) {
98 if n < 0 {
99 n = 0
100 }
101 if scanner.sourceIdx+n >= len(scanner.source) {
102 n = len(scanner.source) - scanner.sourceIdx - 1
103 }
104 scanner.sourceIdx += n
105}
106
107// Process processes the synopsis and returns the generated tokens.
108func (scanner *Scanner) Process() ([]utils.Token, error) {

Callers 2

AdvanceMethod · 0.95
ProcessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected