diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-03-02 10:21:12 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:49:52 +0000 |
commit | 4e18d38f164c215b24acdbe610d60b1c95eb4d3b (patch) | |
tree | 9e654e59940a9a745b2bd82b2ba5d65b462b7ec3 /src/qml/parser/qqmljslexer.cpp | |
parent | f6754300e2fa9cd508d64a06879b9202d8e06730 (diff) |
Add yield as a keyword
It's not a keyword outside of generator functions, so extend the
qmlmode boolean on the lexer to become a more general parsemode that
we can use to also turn the yield keyword on and of.
The parser can then set the flag when it enters the body of a generator
function.
Change-Id: Ibf792d4c7c567d825c6706f7b4997362c87fc575
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljslexer.cpp')
-rw-r--r-- | src/qml/parser/qqmljslexer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp index 0b6033c1df..7fb32a4406 100644 --- a/src/qml/parser/qqmljslexer.cpp +++ b/src/qml/parser/qqmljslexer.cpp @@ -784,7 +784,7 @@ again: int kind = T_IDENTIFIER; if (!identifierWithEscapeChars) - kind = classify(_tokenStartPtr, _tokenLength, _qmlMode); + kind = classify(_tokenStartPtr, _tokenLength, parseModeFlags()); if (_engine) { if (kind == T_IDENTIFIER && identifierWithEscapeChars) |