From 227d39685ac4af5740fad93dbdec8ec25c104fb3 Mon Sep 17 00:00:00 2001 From: "Leandro T. C. Melo" Date: Tue, 18 Apr 2017 09:28:56 -0300 Subject: 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 Reviewed-by: Nikolai Kosjar --- src/libs/3rdparty/cplusplus/Literals.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libs/3rdparty/cplusplus') 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) { -- cgit v1.2.3