Commit 227d3968 authored by Leandro T. C. Melo's avatar Leandro T. C. Melo Committed by Robert Loehning

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's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 0ecc0444
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment