Fix the computation of the start token position.
authorRoberto Raggi <roberto.raggi@nokia.com>
Tue, 16 Aug 2011 14:52:50 +0000 (16:52 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 30 Aug 2011 11:18:28 +0000 (13:18 +0200)
Rewind the buffer pointer only when necessary.

Change-Id: Idd78edc068b1c55d79c5674facd9c55270e536a8
Reviewed-on: http://codereview.qt.nokia.com/3787
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/declarative/qml/parser/qdeclarativejslexer.cpp

index 0d84284..c269542 100644 (file)
@@ -723,11 +723,13 @@ again:
                 }
 
                 if (n != QLatin1Char('.') && n != QLatin1Char('e') && n != QLatin1Char('E')) {
-                    _codePtr = code - 1;
-                    scanChar();
+                    if (code != _codePtr) {
+                        _codePtr = code - 1;
+                        scanChar();
+                    }
                     _tokenValue = integer;
                     return T_NUMERIC_LITERAL;
-                } 
+                }
             }
 
             QVarLengthArray<char,32> chars;