aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/parser/qmljs.g
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2013-01-22 11:15:23 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2013-01-23 14:47:26 +0100
commitf0e4df5826a28b38eb91c9d05ef68c5d1d0231c1 (patch)
treefcad76f509a777339f0f4eb7fe50214f3df10749 /src/libs/qmljs/parser/qmljs.g
parent111872591e70c7cd62ed06904a01b939c08f10e7 (diff)
qmljs/parser: update to latest qt5 parser
fix error semicolon insertion of loops, strict mode Change-Id: I311733ffb34269d1cee7e576d05af78893b2bcbb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/qmljs/parser/qmljs.g')
-rw-r--r--src/libs/qmljs/parser/qmljs.g95
1 files changed, 63 insertions, 32 deletions
diff --git a/src/libs/qmljs/parser/qmljs.g b/src/libs/qmljs/parser/qmljs.g
index 0f9ba47af3..87dd912603 100644
--- a/src/libs/qmljs/parser/qmljs.g
+++ b/src/libs/qmljs/parser/qmljs.g
@@ -1,37 +1,29 @@
------------------------------------------------------------------------------
+----------------------------------------------------------------------------
--
-- Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-- Contact: http://www.qt-project.org/legal
--
--- This file is part of Qt Creator.
---
--- Commercial License Usage
--- Licensees holding valid commercial Qt licenses may use this file in
--- accordance with the commercial license agreement provided with the
--- Software or, alternatively, in accordance with the terms contained in
--- a written agreement between you and Digia. For licensing terms and
--- conditions see http://qt.digia.com/licensing. For further information
--- use the contact form at http://qt.digia.com/contact-us.
+-- This file is part of the QtQml module of the Qt Toolkit.
--
+-- $QT_BEGIN_LICENSE:LGPL-ONLY$
-- GNU Lesser General Public License Usage
--- Alternatively, this file may be used under the terms of the GNU Lesser
+-- This file may be used under the terms of the GNU Lesser
-- General Public License version 2.1 as published by the Free Software
-- Foundation and appearing in the file LICENSE.LGPL included in the
-- packaging of this file. Please review the following information to
-- ensure the GNU Lesser General Public License version 2.1 requirements
-- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
--
--- In addition, as a special exception, Digia gives you certain additional
--- rights. These rights are described in the Digia Qt LGPL Exception
--- version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+-- If you have questions regarding the use of this file, please contact
+-- us via http://www.qt-project.org/.
--
------------------------------------------------------------------------------
-
-
+-- $QT_END_LICENSE$
+--
+----------------------------------------------------------------------------
%parser QmlJSGrammar
%decl qmljsparser_p.h
-%impl qdeclarativejsparser.cpp
+%impl qmljsparser.cpp
%expect 2
%expect-rr 2
@@ -68,6 +60,7 @@
%token T_RESERVED_WORD "reserved word"
%token T_MULTILINE_STRING_LITERAL "multiline string literal"
%token T_COMMENT "comment"
+%token T_COMPATIBILITY_SEMICOLON
--- context keywords.
%token T_PUBLIC "public"
@@ -96,8 +89,9 @@
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of Qt Creator.
+** This file is part of the QtQml module of the Qt Toolkit.
**
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -118,10 +112,20 @@
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
****************************************************************************/
-
-#include <QtCore/QDebug>
+#include <QtCore/QtDebug>
#include <QtCore/QCoreApplication>
#include <string.h>
@@ -138,8 +142,9 @@
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of Qt Creator.
+** This file is part of the QtQml module of the Qt Toolkit.
**
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
@@ -160,10 +165,20 @@
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
****************************************************************************/
-
//
// W A R N I N G
// -------------
@@ -176,8 +191,15 @@
//
//
+// W A R N I N G
+// -------------
+//
// This file is automatically generated from qmljs.g.
-// Changes will be lost.
+// Changes should be made to that file, not here. Any change to this file will
+// be lost!
+//
+// To regenerate this file, run:
+// qlalr --no-debug --no-lines --qt qmljs.g
//
#ifndef QMLJSPARSER_P_H
@@ -369,8 +391,15 @@ protected:
#include <QVarLengthArray>
//
+// W A R N I N G
+// -------------
+//
// This file is automatically generated from qmljs.g.
-// Changes will be lost.
+// Changes should be made to that file, not here. Any change to this file will
+// be lost!
+//
+// To regenerate this file, run:
+// qlalr --no-debug --no-lines --qt qmljs.g
//
using namespace QmlJS;
@@ -2411,6 +2440,7 @@ case $rule_number: {
IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_COMPATIBILITY_SEMICOLON ; -- for JSC/V8 compatibility
IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
/.
case $rule_number: {
@@ -2875,7 +2905,8 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
const int errorState = state_stack[tos];
// automatic insertion of `;'
- if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && lexer->canInsertAutomaticSemicolon(yytoken)) {
+ if (yytoken != -1 && ((t_action(errorState, T_AUTOMATIC_SEMICOLON) && lexer->canInsertAutomaticSemicolon(yytoken))
+ || t_action(errorState, T_COMPATIBILITY_SEMICOLON))) {
SavedToken &tk = token_buffer[0];
tk.token = yytoken;
tk.dval = yylval;
@@ -2887,7 +2918,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
yylloc.startColumn += yylloc.length;
yylloc.length = 0;
- //const QString msg = qApp->translate("QQmlParser", "Missing `;'");
+ //const QString msg = qApp->translate("QmlParser", "Missing `;'");
//diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
first_token = &token_buffer[0];
@@ -2917,9 +2948,9 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
QString msg;
int token = token_buffer[0].token;
if (token < 0 || token >= TERMINAL_COUNT)
- msg = qApp->translate("QQmlParser", "Syntax error");
+ msg = qApp->translate("QmlParser", "Syntax error");
else
- msg = qApp->translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
action = errorState;
@@ -2947,7 +2978,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
int a = t_action(errorState, *tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = *tk;
@@ -2971,7 +3002,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
int a = t_action(errorState, tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = tk;
@@ -2984,7 +3015,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
}
}
- const QString msg = qApp->translate("QQmlParser", "Syntax error");
+ const QString msg = qApp->translate("QmlParser", "Syntax error");
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
}