forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Robert Loehning
parent
0ecc044478
commit
227d39685a
6
src/libs/3rdparty/cplusplus/Literals.cpp
vendored
6
src/libs/3rdparty/cplusplus/Literals.cpp
vendored
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user