From 9dd834653b811ad20382e98a87dff824980c9916 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 21 Jun 2015 14:00:56 +0000 Subject: Vendor import of clang trunk r240225: https://llvm.org/svn/llvm-project/cfe/trunk@240225 --- include/clang/Lex/Token.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/clang/Lex/Token.h') diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h index e087809..7ba22b2 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 + 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). -- cgit v1.1