Commit 0623cedb authored by Kenton Varda's avatar Kenton Varda

Allow checking a whole string against a CharGroup at once.

parent d1e80b34
......@@ -111,6 +111,13 @@ public:
return (bits[c / 64] & (1ll << (c % 64))) != 0;
}
inline bool containsAll(ArrayPtr<const char> text) const {
for (char c: text) {
if (!contains(c)) return false;
}
return true;
}
template <typename Input>
Maybe<char> operator()(Input& input) const {
if (input.atEnd()) return nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment