Accept advances the position pointer only if the next rune is in the set of valid runes provided
(valid string)
| 133 | // Accept advances the position pointer only if the next rune |
| 134 | // is in the set of valid runes provided |
| 135 | func (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 |
no test coverage detected