diff --git a/Scanner.cpp b/Scanner.cpp index 487d5c205..2f5f8d37a 100644 --- a/Scanner.cpp +++ b/Scanner.cpp @@ -621,11 +621,11 @@ Token::Value Scanner::scanNumber(char _charSeen) static Token::Value keywordOrIdentifierToken(string const& _input) { + // The following macros are used inside TOKEN_LIST and cause non-keyword tokens to be ignored + // and keywords to be put inside the keywords variable. #define KEYWORD(name, string, precedence) {string, Token::name}, #define TOKEN(name, string, precedence) - static const map keywords{ - TOKEN_LIST(TOKEN, KEYWORD) - }; + static const map keywords({TOKEN_LIST(TOKEN, KEYWORD)}); #undef KEYWORD #undef TOKEN auto it = keywords.find(_input);