summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-10-20 00:20:19 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-10-20 00:22:26 (GMT)
commita25b49d33f1a4fb3eb9d903f3ce2e7cec08aec43 (patch)
tree32610073743aed203ac8696cff16b86238f5ef1c /src
parentddc7f627d85436d76f5ca881bd6f16efb8962af5 (diff)
downloadQt-a25b49d33f1a4fb3eb9d903f3ce2e7cec08aec43.zip
Qt-a25b49d33f1a4fb3eb9d903f3ce2e7cec08aec43.tar.gz
Qt-a25b49d33f1a4fb3eb9d903f3ce2e7cec08aec43.tar.bz2
Fix position of synthesized semicolon tokens.
Authored-by: Roberto Raggi Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 1eb42e4..52f6210 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -510,15 +510,18 @@ int Lexer::lex()
setDone(Eof);
}
} else if (isLineTerminator()) {
- shiftWindowsLineBreak();
- yylineno++;
- yycolumn = 0;
- bol = true;
- terminator = true;
- syncProhibitAutomaticSemicolon();
if (restrKeyword) {
+ // automatic semicolon insertion
+ recordStartPos();
token = QDeclarativeJSGrammar::T_SEMICOLON;
setDone(Other);
+ } else {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ bol = true;
+ terminator = true;
+ syncProhibitAutomaticSemicolon();
}
} else if (current == '"' || current == '\'') {
recordStartPos();