aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-03-19 13:04:54 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-20 05:06:54 +0100
commit9582ca0ce1758572d1ad59548fe221ca2e51598b (patch)
tree442c8cb0dfafb1c276426f776224c1c930f941b6
parent7148a79775e31eb5e3053f82f4ee5a9ba702ddae (diff)
Fix multi-line string content.
ECMA5.1, paragraph 7.8.4, item 9 under semantics: The SV of LineContinuation :: \ LineTerminatorSequence is the empty character sequence. So, do not add any line-terminator inside a multi-line string. Escaped characters like \r and \n are added of course. Change-Id: I8c58b7971b1d1bc90adc795ea278541758246e01 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/qml/qml/parser/qqmljslexer.cpp13
-rw-r--r--tests/auto/qml/v4/data/equals.qml3
2 files changed, 4 insertions, 12 deletions
diff --git a/src/qml/qml/parser/qqmljslexer.cpp b/src/qml/qml/parser/qqmljslexer.cpp
index 0df49279e2..cb78238f99 100644
--- a/src/qml/qml/parser/qqmljslexer.cpp
+++ b/src/qml/qml/parser/qqmljslexer.cpp
@@ -782,22 +782,11 @@ again:
return T_ERROR;
case '\r':
- if (isLineTerminatorSequence() == 2) {
- _tokenText += QLatin1Char('\r');
- u = QLatin1Char('\n');
- } else {
- u = QLatin1Char('\r');
- }
- scanChar();
- break;
-
case '\n':
case 0x2028u:
case 0x2029u:
- u = _char;
scanChar();
- break;
-
+ continue;
default:
// non escape character
diff --git a/tests/auto/qml/v4/data/equals.qml b/tests/auto/qml/v4/data/equals.qml
index c32603cc7e..2862bb7ac9 100644
--- a/tests/auto/qml/v4/data/equals.qml
+++ b/tests/auto/qml/v4/data/equals.qml
@@ -44,5 +44,8 @@ QtObject {
property bool test32: true != zero
property bool test33: true == 1
property bool test34: true != 1
+
+ property bool test35: "a\
+b" === "ab"
}