Revision e0cf9c4...

Go back to digest for 26th May 2013

Bug Fixes in Development Tools

Sven Brauch committed changes in [kdevelop] /cpp:

Differentiate between different compound assignment operators (&=, +=...)

It was noticed that before this change, all operators in statements
such as
Foo a, b;
a ^= b;
a &= b;
etc. will be displayed as uses of Foo::operator+=(), which is obviously
wrong. The reason for this was some rather curious code, which just
treated every of these operators as "Token_assign" in the lexer,
and some other code which treated each "Token_assign" as "+=" in the
analyzer. To fix the issue, this had to be sorted out.
- Token_assign doesn't make sense anyways, since assignments are
represented as "=". So, remove the token completely.
- Instead of lexing every compound assignment operator as "Assign",
yield different token types for each.
- In the code which handles the operators, change the function from
using its own list of tokenkind -- tokenText mapping to use the
official one.
Also included is a unit test for the fix.

REVIEW:110638

File Changes

Modified 8 files
  • /cpp
  •   languagesduchain/builtinoperators.cpp
  •   languagesduchain/expressionvisitor.cpp
  •   languages/parser/lexer.cpp
  •   languages/parser/parser.cpp
  •   languages/parser/tokens.cpp
  •   languages/parser/tokens.h
  •   languagesduchain/tests/test_duchain.cpp
  •   languagesduchain/tests/test_duchain.h
8 files changed in total