diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-01-29 13:00:29 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-02-03 15:10:25 +0000 |
commit | bc5cdd23f13d9215bd29e133db7844a19e919e2c (patch) | |
tree | 81ccd60ab5342e949384f4e2ea4f20412f5ff7e1 /src/qml/parser/qqmljskeywords_p.h | |
parent | f36337359cac10036a17ae787a17340744af0785 (diff) |
parser: Add "let" keyword (& T_LET)
We also tie this up to the existing skeletal "const" support so that they
are also checked for duplicate declarations.
While we do that, change from using a boolean to an enum so we make the scope of
a declaration a little more easily comprehensible.
Change-Id: I6a6e08aed4e16a53690d6f6bafb55632807b6024
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljskeywords_p.h')
-rw-r--r-- | src/qml/parser/qqmljskeywords_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljskeywords_p.h b/src/qml/parser/qqmljskeywords_p.h index a31c188efc..8b789526a5 100644 --- a/src/qml/parser/qqmljskeywords_p.h +++ b/src/qml/parser/qqmljskeywords_p.h @@ -106,6 +106,13 @@ static inline int classify3(const QChar *s, bool qmlMode) { } } } + else if (s[0].unicode() == 'l') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 't') { + return int(Lexer::T_LET); + } + } + } else if (s[0].unicode() == 'n') { if (s[1].unicode() == 'e') { if (s[2].unicode() == 'w') { |