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:
Leandro T. C. Melo
2017-04-18 09:28:56 -03:00
committed by Robert Loehning
parent 0ecc044478
commit 227d39685a

View File

@@ -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) {