diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-03-14 10:04:39 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:50:24 +0000 |
commit | d3058682fd3c9994c3a598d901398c1d751e2586 (patch) | |
tree | 6e6050d12b295ff208b2aba291c6fa4950fa5cdf /src/qml/parser/qqmljslexer_p.h | |
parent | 62143542d40096119c4a3425dd6fa50a4750423c (diff) |
Support static as a keyword in class definitions
This requires some interaction between parser and
lexer as static is only recognized as a keyword
directly in the class declaration.
Change-Id: Ib64157ae6ad542706a5eee8ff4ec7f9cb79a62c3
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.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/parser/qqmljslexer_p.h b/src/qml/parser/qqmljslexer_p.h index 3dc1339cd1..a6ac8cb354 100644 --- a/src/qml/parser/qqmljslexer_p.h +++ b/src/qml/parser/qqmljslexer_p.h @@ -118,7 +118,8 @@ public: enum ParseModeFlags { QmlMode = 0x1, - YieldIsKeyword = 0x2 + YieldIsKeyword = 0x2, + StaticIsKeyword = 0x4 }; public: @@ -127,14 +128,17 @@ public: int parseModeFlags() const { int flags = 0; if (qmlMode()) - flags |= QmlMode; + flags |= QmlMode|StaticIsKeyword; if (yieldIsKeyWord()) flags |= YieldIsKeyword; + if (_staticIsKeyword) + flags |= StaticIsKeyword; return flags; } bool qmlMode() const; bool yieldIsKeyWord() const { return _generatorLevel != 0; } + void setStaticIsKeyword(bool b) { _staticIsKeyword = b; } QString code() const; void setCode(const QString &code, int lineno, bool qmlMode = true); @@ -243,6 +247,7 @@ private: bool _delimited; bool _qmlMode; int _generatorLevel = 0; + bool _staticIsKeyword = false; }; } // end of namespace QQmlJS |