From 2e2a7344034d8ad8f8877e15c813185e6f689bd5 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Tue, 25 Dec 2018 20:05:53 +0100 Subject: [PATCH] Rez: fix $ABCD hex literals --- Rez/RezLexerNextToken.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Rez/RezLexerNextToken.cc b/Rez/RezLexerNextToken.cc index dca8d9edda..2725e3e678 100644 --- a/Rez/RezLexerNextToken.cc +++ b/Rez/RezLexerNextToken.cc @@ -217,6 +217,9 @@ RezSymbol RezLexer::nextToken() }; std::string s = tok.get_value().c_str(); + if(s.size() >= 2 && s[0] == '$' && std::all_of(s.begin()+1, s.end(), [](char c) { return isxdigit(c); })) + return RezParser::make_INTLIT(readInt(s.c_str()+1, nullptr, 16), loc); + std::string lower = s; std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); auto p = keywords.find(lower);