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

Method PeekBy

testing/generation/command_docs/scanner.go:65–70  ·  view source on GitHub ↗

PeekBy returns the next rune that is n positions from the current rune. Does not advance the scanner. Returns false if we are peeking beyond the source.

(n int)

Source from the content-addressed store, hash-verified

63// PeekBy returns the next rune that is n positions from the current rune. Does not advance the scanner. Returns false
64// if we are peeking beyond the source.
65func (scanner *Scanner) PeekBy(n int) (rune, bool) {
66 if scanner.sourceIdx+n >= len(scanner.source) || scanner.sourceIdx+n < 0 {
67 return 0, false
68 }
69 return scanner.source[scanner.sourceIdx+n], true
70}
71
72// PeekMatch returns whether the given string exactly matches runes starting after the current position. This is
73// equivalent to calling PeekMatchOffset with an offset of 1.

Callers 2

PeekMatchOffsetMethod · 0.95
ProcessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected