From d383fef02412829c2d2212a9b486f20bae89eacb Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 31 Mar 2015 23:36:17 +0200 Subject: Add static version of Token::isSpecial --- src/core/common/Token.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/common/Token.hpp b/src/core/common/Token.hpp index 4b56f1a..ad36e14 100644 --- a/src/core/common/Token.hpp +++ b/src/core/common/Token.hpp @@ -178,7 +178,16 @@ struct Token { * @return true if the TokenId indicates that this token is a "special" * token. */ - bool isSpecial() const { return id > Tokens::MaxTokenId; } + bool isSpecial() const { return isSpecial(id); } + + /** + * Returns true if the given token id is special. + * + * @param id is the token id that should be checked for being special. + * @return true if the TokenId indicates that this token is a "special" + * token. + */ + static bool isSpecial(TokenId id) {return id > Tokens::MaxTokenId; } /** * The getLocation function allows the tokens to be directly passed as -- cgit v1.2.3