diff options
author | Leandro T. C. Melo <LTCMELO@GMAIL.COM> | 2017-04-18 09:28:56 -0300 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2017-04-26 10:30:46 +0000 |
commit | 227d39685ac4af5740fad93dbdec8ec25c104fb3 (patch) | |
tree | a87b6e2bf8ba2d57ee5df4ed233acb30cb9cf72d /src/libs/3rdparty/cplusplus | |
parent | 0ecc0444784a2e8e1cd75f358eebe0713f347e39 (diff) |
C++: Fix broken lexing for floating-points
Now, I can have my Pi (3.14) typed as double.
Change-Id: I33ee579e56d3c735f88278f1868d8739ef277ad6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Literals.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/3rdparty/cplusplus/Literals.cpp b/src/libs/3rdparty/cplusplus/Literals.cpp index a70e9025d3..19c92e49bb 100644 --- a/src/libs/3rdparty/cplusplus/Literals.cpp +++ b/src/libs/3rdparty/cplusplus/Literals.cpp @@ -106,9 +106,11 @@ NumericLiteral::NumericLiteral(const char *chars, unsigned size) } // switch } - for (const char *dot = it; it != begin - 1; --it) { - if (*dot == '.') + for (const char *dot = it; dot != begin - 1; --dot) { + if (*dot == '.') { f._type = NumericLiteralIsDouble; + break; + } } for (++it; it != end; ++it) { |