From 9b0fe0af05ffc76aa031153f62610b1830554bad Mon Sep 17 00:00:00 2001 From: Jannick Date: Mon, 28 Aug 2017 17:00:46 +1000 Subject: Backport: Bug [#1966]. Default value of 0 for undefined preprocessor symbols. Backport of changeset 6380:89e44071e21e. --- doc/ScintillaHistory.html | 6 ++++++ lexers/LexCPP.cxx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 79d7afab6..c07618a5e 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -513,6 +513,7 @@ Baldur Karlsson Martin Kleusberg + Jannick

@@ -569,6 +570,11 @@ Bug #1919.

  • + The C++ lexer improved preprocessor conformance. + Default value of 0 for undefined preprocessor symbols. + Bug #1966. +
  • +
  • The SQL lexer uses sql.backslash.escapes for double quoted strings. Bug #1968.
  • diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 08a95321e..10b5535ca 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1582,8 +1582,8 @@ void LexerCPP::EvaluateTokens(std::vector &tokens, const SymbolTabl tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end()); } } else { - // Identifier not found - tokens.erase(tokens.begin() + i); + // Identifier not found and value defaults to zero + tokens[i] = "0"; } } else { i++; -- cgit v1.2.3