diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2011-09-09 10:58:52 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-19 12:07:46 +0200 |
commit | 3c45c63827867995277432ffa19b787c8717ccce (patch) | |
tree | d315f29cdb5643e3bf4e088dea3a8a2327917c30 /src/declarative/qml/parser/qdeclarativejslexer_p.h | |
parent | 648650313384d893e7fa8c179090d42f8167c13a (diff) |
Introduced a QML scanning mode.
In QML mode, the lexer will recognize the extra QML keywords, e.g.
readonly, as, on, and so on.
Change-Id: I148ff857e201f99d41e0265bcfc480a94a1085a0
Reviewed-on: http://codereview.qt-project.org/4518
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/declarative/qml/parser/qdeclarativejslexer_p.h')
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejslexer_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer_p.h b/src/declarative/qml/parser/qdeclarativejslexer_p.h index 1852894b58..3080a05d07 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer_p.h +++ b/src/declarative/qml/parser/qdeclarativejslexer_p.h @@ -118,7 +118,7 @@ public: Lexer(Engine *engine); QString code() const; - void setCode(const QString &code, int lineno); + void setCode(const QString &code, int lineno, bool qmlMode = true); int lex(); @@ -155,7 +155,7 @@ private: inline void scanChar(); int scanToken(); - int classify(const QChar *s, int n); + int classify(const QChar *s, int n, bool qmlMode); bool isLineTerminator() const; static bool isIdentLetter(QChar c); @@ -201,6 +201,7 @@ private: bool _restrictedKeyword; bool _terminator; bool _delimited; + bool _qmlMode; }; } // end of namespace QDeclarativeJS |