summaryrefslogtreecommitdiff
path: root/include/clang/Lex/Token.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex/Token.h')
-rw-r--r--include/clang/Lex/Token.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index e0878093402a4..7ba22b2f626c6 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -94,6 +94,13 @@ public:
/// "if (Tok.is(tok::l_brace)) {...}".
bool is(tok::TokenKind K) const { return Kind == K; }
bool isNot(tok::TokenKind K) const { return Kind != K; }
+ bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const {
+ return is(K1) || is(K2);
+ }
+ template <typename... Ts>
+ bool isOneOf(tok::TokenKind K1, tok::TokenKind K2, Ts... Ks) const {
+ return is(K1) || isOneOf(K2, Ks...);
+ }
/// \brief Return true if this is a raw identifier (when lexing
/// in raw mode) or a non-keyword identifier (when lexing in non-raw mode).