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

Method Accept

strings.go:135–141  ·  view source on GitHub ↗

Accept advances the position pointer only if the next rune is in the set of valid runes provided

(valid string)

Source from the content-addressed store, hash-verified

133// Accept advances the position pointer only if the next rune
134// is in the set of valid runes provided
135func (s *stringLexer) Accept(valid string) bool {
136 if strings.ContainsRune(valid, s.Next()) {
137 return true
138 }
139 s.Backup()
140 return false
141}
142
143// AcceptN advances the position pointer N times, only if
144// the next N runes are in the set of valid runes provided

Callers 2

AcceptNMethod · 0.95
DecodeStringFunction · 0.80

Calls 2

NextMethod · 0.95
BackupMethod · 0.95

Tested by

no test coverage detected