MCPcopy
hub / github.com/kashav/fsql / readUntil

Method readUntil

tokenizer/tokenizer.go:235–244  ·  view source on GitHub ↗

readUnitl reads the input starting at start, until reaching a rune in runes.

(runes ...rune)

Source from the content-addressed store, hash-verified

233
234// readUnitl reads the input starting at start, until reaching a rune in runes.
235func (t *Tokenizer) readUntil(runes ...rune) string {
236 var word string
237 for !t.currentIs(runes...) {
238 for unicode.IsSpace(t.current()) {
239 t.input = t.input[1:]
240 }
241 word = fmt.Sprintf("%s %s", word, t.readWord())
242 }
243 return word
244}

Callers 2

NextMethod · 0.95
TestTokenizer_ReadUntilFunction · 0.80

Calls 3

currentIsMethod · 0.95
currentMethod · 0.95
readWordMethod · 0.95

Tested by 1

TestTokenizer_ReadUntilFunction · 0.64