From 3c45c63827867995277432ffa19b787c8717ccce Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 9 Sep 2011 10:58:52 +0200 Subject: 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 Reviewed-by: Kent Hansen --- src/declarative/qml/parser/qdeclarativejslexer_p.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/declarative/qml/parser/qdeclarativejslexer_p.h') 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 -- cgit v1.2.3