From 16d18724972298c4bf5fb59925649f869118fbac Mon Sep 17 00:00:00 2001 From: Jannick Date: Mon, 28 Aug 2017 17:03:55 +1000 Subject: Bug [#1966]. #define A is treated as #define A 1. --- lexers/LexCPP.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lexers/LexCPP.cxx') diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index fbdbd77ca..3fa925b40 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1333,6 +1333,8 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; std::string value = restOfLine.substr(startValue); + if (OnlySpaceOrTab(value)) + value = "1"; // No value defaults to 1 preprocessorDefinitions[key] = value; ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value)); definitionsChanged = true; -- cgit v1.2.3