From 441807f96df1155dcbd726079ebd7953ff5f3d29 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 31 Aug 2020 19:24:27 +0430 Subject: [PATCH] AK: Add is_any_of(StringView) to GenericLexer --- AK/GenericLexer.h | 6 ++++++ 1 file changed, 6 insertions(+) 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;