diff --git a/src/plugins/qmleditor/parser/qmljs.g b/src/plugins/qmleditor/parser/qmljs.g
index eb9a8abcfdcbb086a9fb964cec47c3eb32a36fe7..c5b2764cda5417c0bf6a418780ba4e1b97122996 100644
--- a/src/plugins/qmleditor/parser/qmljs.g
+++ b/src/plugins/qmleditor/parser/qmljs.g
@@ -2949,7 +2949,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
         const int errorState = state_stack[tos];
 
         // automatic insertion of `;'
-        if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+        if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
             SavedToken &tk = token_buffer[0];
             tk.token = yytoken;
             tk.dval = yylval;
diff --git a/src/plugins/qmleditor/parser/qmljsgrammar.cpp b/src/plugins/qmleditor/parser/qmljsgrammar.cpp
index da3ce2a0770ca7c3d4803653bed1224ab58e0561..2b92b8225bc70a9f12baf80c050c8941681156c3 100644
--- a/src/plugins/qmleditor/parser/qmljsgrammar.cpp
+++ b/src/plugins/qmleditor/parser/qmljsgrammar.cpp
@@ -4,7 +4,7 @@
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 ** Contact: Qt Software Information (qt-info@nokia.com)
 **
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
 ** No Commercial Usage
diff --git a/src/plugins/qmleditor/parser/qmljsgrammar_p.h b/src/plugins/qmleditor/parser/qmljsgrammar_p.h
index b297f81cff533b44359969ec97a7e2d03a97b185..20d7188f4518ee7b59721288b82019fb3cc16460 100644
--- a/src/plugins/qmleditor/parser/qmljsgrammar_p.h
+++ b/src/plugins/qmleditor/parser/qmljsgrammar_p.h
@@ -4,7 +4,7 @@
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 ** Contact: Qt Software Information (qt-info@nokia.com)
 **
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
 ** No Commercial Usage
diff --git a/src/plugins/qmleditor/parser/qmljsparser.cpp b/src/plugins/qmleditor/parser/qmljsparser.cpp
index 402aaeb3959a8d9c7ccbd19800aee8e35b0a8fe6..dd2553f6449dbb183c8751f0fb39bb7907369661 100644
--- a/src/plugins/qmleditor/parser/qmljsparser.cpp
+++ b/src/plugins/qmleditor/parser/qmljsparser.cpp
@@ -1713,7 +1713,7 @@ case 337: {
         const int errorState = state_stack[tos];
 
         // automatic insertion of `;'
-        if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+        if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
             SavedToken &tk = token_buffer[0];
             tk.token = yytoken;
             tk.dval = yylval;