diff options
author | Jannick <unknown> | 2018-12-12 08:38:19 +1100 |
---|---|---|
committer | Jannick <unknown> | 2018-12-12 08:38:19 +1100 |
commit | 3f3eb0ea971edddb3983bb6498decbb171b17e0f (patch) | |
tree | c5f86fc7cda92ac118ea413425d4b30d69bb9a47 /qt/ScintillaEditBase/ScintillaQt.cpp | |
parent | 2c4a82892183b5cf7eaa12f1b5f9048d034a13e4 (diff) | |
download | scintilla-mirror-3f3eb0ea971edddb3983bb6498decbb171b17e0f.tar.gz |
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
Diffstat (limited to 'qt/ScintillaEditBase/ScintillaQt.cpp')
0 files changed, 0 insertions, 0 deletions