aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljslexer_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-02-05 14:00:14 +0100
committerLars Knoll <lars.knoll@qt.io>2018-02-08 14:00:36 +0000
commit206f509c63e5952733db318fbc79c14494e18502 (patch)
treebbd7be278ab2d8bda0dfaa1092e1650dfb694b41 /src/qml/parser/qqmljslexer_p.h
parent847dfa77e9b5d93f7dbb6b78665f1f86d4431a02 (diff)
Simplify line and column number handling in the lexer
Change-Id: I7e6245fb064d071518e0d46d1cc56e516d230abc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljslexer_p.h')
-rw-r--r--src/qml/parser/qqmljslexer_p.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/parser/qqmljslexer_p.h b/src/qml/parser/qqmljslexer_p.h
index 11d8081713..03d434e3e6 100644
--- a/src/qml/parser/qqmljslexer_p.h
+++ b/src/qml/parser/qqmljslexer_p.h
@@ -166,10 +166,7 @@ public:
int tokenLength() const { return _tokenLength; }
int tokenStartLine() const { return _tokenLine; }
- int tokenStartColumn() const { return _tokenStartPtr - _tokenLinePtr + 1; }
-
- int tokenEndLine() const;
- int tokenEndColumn() const;
+ int tokenStartColumn() const { return _tokenColumn; }
inline QStringRef tokenSpell() const { return _tokenSpell; }
double tokenValue() const { return _tokenValue; }
@@ -218,14 +215,13 @@ private:
const QChar *_codePtr;
const QChar *_endPtr;
- const QChar *_lastLinePtr;
- const QChar *_tokenLinePtr;
const QChar *_tokenStartPtr;
QChar _char;
Error _errorCode;
int _currentLineNumber;
+ int _currentColumnNumber;
double _tokenValue;
// parentheses state
@@ -238,6 +234,7 @@ private:
int _tokenKind;
int _tokenLength;
int _tokenLine;
+ int _tokenColumn;
bool _validTokenText;
bool _prohibitAutomaticSemicolon;