浏览代码

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.
Ali Mohammad Pur 3 年之前
父节点
当前提交
b3c18db463
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      AK/GenericLexer.h

+ 5 - 0
AK/GenericLexer.h

@@ -229,6 +229,11 @@ constexpr auto is_any_of(StringView values)
     return [values](auto c) { return values.contains(c); };
     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_path_separator = is_any_of("/\\");
 constexpr auto is_quote = is_any_of("'\"");
 constexpr auto is_quote = is_any_of("'\"");