From 3f3eb0ea971edddb3983bb6498decbb171b17e0f Mon Sep 17 00:00:00 2001 From: Jannick Date: Wed, 12 Dec 2018 08:38:19 +1100 Subject: Bug [#2069]. LexCPP: fix bug in arithmetic calculation by adding precedence levels The precedence for the implemented arithmetic operators +,-,%,*,/ is added, such that the calculations produce the correct results honoring the standard precedence levels. * Replace characterset setArithmeticOp by setAddOp and setMultOp. * Replace precedence precArithmetic by precMult and precAdd * (EvaluateTokens): Apply new precedences. This fixes the bug in the arithmetic calculation: // lines with 'false' should not be highlighted, // those with 'true' should be. #if 1 + 2 * 3 == 9 false #endif #if (1 + 2) * 3 == 9 true #endif #if 1 + 2 * 3 == 7 true #endif #if 1 == 5 % 2 true #endif #if 6 - 7 == -1 true #endif #if 25 / 5 * 5 == 25 true #endif #if 1 + 2 * 3 % 2 == 1 true #endif #if 1 + 2 * 3 % 2 == 2 + 1 false #endif --- doc/ScintillaHistory.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/ScintillaHistory.html') diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 0908fcc08..3965ac8e9 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -582,6 +582,11 @@ Bug #2062.
  • + The C++ lexer interprets preprocessor arithmetic expressions containing multiplicative and additive + operators correctly by following operator precedence rules. + Bug #2069. +
  • +
  • For SciTE's Find in Files, allow case-sensitivity and whole-word options when running a user defined command. Bug #2053. -- cgit v1.2.3