aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser/qdeclarativejslexer.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-12-06 14:09:22 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-06 15:29:39 +0100
commite7d1a74d994445749275e8e5cb88b0a21938bb09 (patch)
tree6dde884c6079e8a448a4f645b144fd252b4e3d6e /src/declarative/qml/parser/qdeclarativejslexer.cpp
parente7281e2dc89ca934d3c1e89484d279331a96de71 (diff)
Improve parsing of escape characters and regexp literals.
That is, in QML/JS you can escape characters in identifiers, e.g. var c\u0061se = 25 declares a variable called `case' with value 25. In such cases qmlmin needs to preserve the escape sequence in the declaration. Also, fix possible errors when pasting keywords after regexp literals. The minifier needs to preserve the whitespace character after the regexp delimiter, e.g. /x/instanceof blah without the white space after the regexp, the `i' of `instanceof' is parsed as a regexp flag. Change-Id: I5f426ac62949e34d092d4fdb0a41243de8ff2236 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/declarative/qml/parser/qdeclarativejslexer.cpp')
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 9b9af3868d..5e008d27f1 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -113,6 +113,11 @@ Lexer::Lexer(Engine *engine)
engine->setLexer(this);
}
+bool Lexer::qmlMode() const
+{
+ return _qmlMode;
+}
+
QString Lexer::code() const
{
return _code;