mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
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:
parent
e21fa158dd
commit
b3c18db463
Notes:
sideshowbarker
2024-07-17 16:36:32 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/b3c18db463 Pull-request: https://github.com/SerenityOS/serenity/pull/13310 Reviewed-by: https://github.com/IdanHo
1 changed files with 5 additions and 0 deletions
|
@ -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("'\"");
|
||||
|
||||
|
|
Loading…
Reference in a new issue