summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-31 19:24:27 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-31 23:05:58 +0200
commit441807f96df1155dcbd726079ebd7953ff5f3d29 (patch)
tree0f5367a01561959123bb1b0b3169a2e7ae87b203
parent861ce62e1469093cd77956acafca1a151852b778 (diff)
downloadserenity-441807f96df1155dcbd726079ebd7953ff5f3d29.zip
AK: Add is_any_of(StringView) to GenericLexer
-rw-r--r--AK/GenericLexer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/GenericLexer.h b/AK/GenericLexer.h
index 4956da649c..4badf22d72 100644
--- a/AK/GenericLexer.h
+++ b/AK/GenericLexer.h
@@ -75,6 +75,11 @@ protected:
size_t m_index { 0 };
};
+constexpr auto is_any_of(const StringView& values)
+{
+ return [values](auto c) { return values.contains(c); };
+}
+
// ctype adaptors
// FIXME: maybe put them in an another file?
bool is_alpha(char);
@@ -97,6 +102,7 @@ using AK::GenericLexer;
using AK::is_alpha;
using AK::is_alphanum;
+using AK::is_any_of;
using AK::is_control;
using AK::is_digit;
using AK::is_graphic;