AK: Add a 'is_not_any_of' similar to 'is_any_of' to GenericLexer

It's often useful to have the negated version, so instead of making a
local lambda for it, let's just add the negated form too.
This commit is contained in:
Ali Mohammad Pur 2022-03-27 01:57:04 +04:30 committed by Andreas Kling
parent e21fa158dd
commit b3c18db463

View file

@ -229,6 +229,11 @@ constexpr auto is_any_of(StringView values)
return [values](auto c) { return values.contains(c); };
}
constexpr auto is_not_any_of(StringView values)
{
return [values](auto c) { return !values.contains(c); };
}
constexpr auto is_path_separator = is_any_of("/\\");
constexpr auto is_quote = is_any_of("'\"");