MCPcopy
hub / github.com/BishopFox/jsluice / AcceptN

Method AcceptN

strings.go:145–153  ·  view source on GitHub ↗

AcceptN advances the position pointer N times, only if the next N runes are in the set of valid runes provided

(valid string, n int)

Source from the content-addressed store, hash-verified

143// AcceptN advances the position pointer N times, only if
144// the next N runes are in the set of valid runes provided
145func (s *stringLexer) AcceptN(valid string, n int) bool {
146 count := 0
147 for i := 0; i < n; i++ {
148 if s.Accept(valid) {
149 count++
150 }
151 }
152 return count == n
153}
154
155// AcceptUntil accepts any runes until the rune provided is
156// encountered

Callers 1

DecodeStringFunction · 0.80

Calls 1

AcceptMethod · 0.95

Tested by

no test coverage detected