aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlmin/main.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2012-11-22 09:39:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-26 20:19:35 +0100
commit224316b515ed42411c43e1be8997c2d8faedc45e (patch)
tree97468edf428ae0d3f7253ed03a1a9d4f501b511a /tools/qmlmin/main.cpp
parente9e49c6157f7cfb84faeaab0438b0a30380f68f8 (diff)
Accept missing semicolon after do-while statement.
Although not valid according to ECMA 5.1, both JSC and V8 accept a missing semicolon after a do-while loop. (Both JSC and V8 do not do this through automatic semicolon insertion, but handle it as a special case.) Change-Id: Iff2b07b894564740d2dcbf9b1d46bc279d30b9e3 Reviewed-by: Alan Alpert <aalpert@rim.com>
Diffstat (limited to 'tools/qmlmin/main.cpp')
-rw-r--r--tools/qmlmin/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/qmlmin/main.cpp b/tools/qmlmin/main.cpp
index 192a17af32..0d6950360f 100644
--- a/tools/qmlmin/main.cpp
+++ b/tools/qmlmin/main.cpp
@@ -394,7 +394,8 @@ bool Minify::parse(int startToken)
const int yyerrorstate = _stateStack[yytos];
// automatic insertion of `;'
- if (yytoken != -1 && t_action(yyerrorstate, T_AUTOMATIC_SEMICOLON) && canInsertAutomaticSemicolon(yytoken)) {
+ if (yytoken != -1 && ((t_action(yyerrorstate, T_AUTOMATIC_SEMICOLON) && canInsertAutomaticSemicolon(yytoken))
+ || t_action(yyerrorstate, T_COMPATIBILITY_SEMICOLON))) {
_tokens.prepend(yytoken);
_tokenStrings.prepend(yytokentext);
yyaction = yyerrorstate;
@@ -509,7 +510,8 @@ bool Tokenize::parse(int startToken)
const int yyerrorstate = _stateStack[yytos];
// automatic insertion of `;'
- if (yytoken != -1 && t_action(yyerrorstate, T_AUTOMATIC_SEMICOLON) && canInsertAutomaticSemicolon(yytoken)) {
+ if (yytoken != -1 && ((t_action(yyerrorstate, T_AUTOMATIC_SEMICOLON) && canInsertAutomaticSemicolon(yytoken))
+ || t_action(yyerrorstate, T_COMPATIBILITY_SEMICOLON))) {
_tokens.prepend(yytoken);
_tokenStrings.prepend(yytokentext);
yyaction = yyerrorstate;