diff options
Diffstat (limited to 'src')
67 files changed, 1765 insertions, 1430 deletions
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 3c015da..f63d29e 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,7 +67,8 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin. + have reached the end of the data stream, with stdin because as long as the + application is running, stdin has no end. Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or diff --git a/src/declarative/canvas/qsimplecanvas.cpp b/src/declarative/canvas/qsimplecanvas.cpp index 1911b35..ce02a4c 100644 --- a/src/declarative/canvas/qsimplecanvas.cpp +++ b/src/declarative/canvas/qsimplecanvas.cpp @@ -556,7 +556,7 @@ QSimpleCanvas::QSimpleCanvas(CanvasMode mode, QWidget *parent) QSimpleCanvas::QSimpleCanvas(QWidget *parent) : QWidget(parent), d(new QSimpleCanvasPrivate(this)) { - d->init(useGraphicsView()?GraphicsView:SimpleCanvas); + d->init(useGraphicsView()?SimpleCanvas:GraphicsView); } void QSimpleCanvasPrivate::init(QSimpleCanvas::CanvasMode mode) diff --git a/src/declarative/debugger/qmldebugger.cpp b/src/declarative/debugger/qmldebugger.cpp index 1f7fd68..033a15f 100644 --- a/src/declarative/debugger/qmldebugger.cpp +++ b/src/declarative/debugger/qmldebugger.cpp @@ -46,6 +46,7 @@ #include <QtDeclarative/qmlbindablevalue.h> #include <private/qmlboundsignal_p.h> #include <private/qmlcontext_p.h> +#include <private/qmlengine_p.h> #include <QtCore/qdebug.h> #include <QtCore/qfile.h> #include <QtCore/qurl.h> @@ -98,13 +99,35 @@ public: int startLine; int endLine; QUrl url; + + QPointer<QmlBindableValue> bindableValue; }; void QmlDebugger::itemPressed(QTreeWidgetItem *i) { QmlDebuggerItem *item = static_cast<QmlDebuggerItem *>(i); - if(item->url.scheme() == QLatin1String("file")) { + if(item->bindableValue) { + + QString str; + + QmlExpressionPrivate *p = item->bindableValue->d; + if(p->log) { + QString str; + QDebug d(&str); + for(int ii = 0; ii < p->log->count(); ++ii) { + d << p->log->at(ii).result() << "\n"; + QStringList warnings = p->log->at(ii).warnings(); + foreach(const QString &warning, warnings) + d << " " << warning << "\n"; + } + m_text->setPlainText(str); + + } else { + m_text->setPlainText("No history"); + } + + } else if(item->url.scheme() == QLatin1String("file")) { QString f = item->url.toLocalFile(); QFile file(f); file.open(QIODevice::ReadOnly); @@ -160,6 +183,7 @@ static bool makeItem(QObject *obj, QmlDebuggerItem *item) if(QmlBindableValue *bv = qobject_cast<QmlBindableValue *>(obj)) { text = bv->property().name() + ": " + bv->expression(); item->setForeground(0, Qt::green); + item->bindableValue = bv; } else if(QmlBoundSignal *bs = qobject_cast<QmlBoundSignal *>(obj)) { QMetaMethod method = obj->parent()->metaObject()->method(bs->index()); QByteArray sig = method.signature(); @@ -203,6 +227,9 @@ static bool makeItem(QObject *obj, QmlDebuggerItem *item) } else { item->setExpanded(true); } + + if(!context) + item->setForeground(0, Qt::lightGray); } item->setText(0, text); diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index af72ecc..bba817d 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -90,8 +90,9 @@ class QmlXmlListModelPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QmlXmlListModel) public: - QmlXmlListModelPrivate() : size(-1), highestRole(Qt::UserRole), reply(0), roleObjects(this) {} + QmlXmlListModelPrivate() : isClassComplete(false), size(-1), highestRole(Qt::UserRole), reply(0), roleObjects(this) {} + bool isClassComplete; QString src; QString query; QString namespaces; @@ -204,7 +205,10 @@ QString QmlXmlListModel::source() const void QmlXmlListModel::setSource(const QString &src) { Q_D(QmlXmlListModel); - d->src = src; + if (d->src != src) { + d->src = src; + reload(); + } } QString QmlXmlListModel::query() const @@ -216,7 +220,10 @@ QString QmlXmlListModel::query() const void QmlXmlListModel::setQuery(const QString &query) { Q_D(QmlXmlListModel); - d->query = query; + if (d->query != query) { + d->query = query; + reload(); + } } QString QmlXmlListModel::namespaceDeclarations() const @@ -228,29 +235,44 @@ QString QmlXmlListModel::namespaceDeclarations() const void QmlXmlListModel::setNamespaceDeclarations(const QString &declarations) { Q_D(QmlXmlListModel); - d->namespaces = declarations; + if (d->namespaces != declarations) { + d->namespaces = declarations; + reload(); + } } void QmlXmlListModel::classComplete() { - fetch(); + Q_D(QmlXmlListModel); + d->isClassComplete = true; + reload(); } -void QmlXmlListModel::fetch() +void QmlXmlListModel::reload() { Q_D(QmlXmlListModel); + if (!d->isClassComplete) + return; + //clear existing data d->size = 0; int count = d->data.count(); d->data.clear(); - emit itemsRemoved(0, count); + if (count > 0) + emit itemsRemoved(0, count); if (d->src.isEmpty()) { - qWarning() << "Can't fetch empty src string"; + qWarning() << "Can't load empty src string"; return; } + if (d->reply) { + d->reply->abort(); + d->reply->deleteLater(); + d->reply = 0; + } + QNetworkRequest req((QUrl(d->src))); req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); d->reply = qmlContext(this)->engine()->networkAccessManager()->get(req); @@ -316,7 +338,9 @@ void QmlXmlListModel::doQuery(QByteArray &rawData) d->xml = xml; d->size = count; - emit itemsInserted(0, count); + + if (count > 0) + emit itemsInserted(0, count); } void QmlXmlListModel::doSubquery(int index) const diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index acc54a9..2e932cb 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -118,7 +118,7 @@ public: virtual void classComplete(); public Q_SLOTS: - void fetch(); + void reload(); protected: void doQuery(QByteArray &rawData); diff --git a/src/declarative/fx/qfxlayouts.cpp b/src/declarative/fx/qfxlayouts.cpp index 85b198e..e95998b 100644 --- a/src/declarative/fx/qfxlayouts.cpp +++ b/src/declarative/fx/qfxlayouts.cpp @@ -361,7 +361,12 @@ void QFxBaseLayout::preLayout() if (item->isVisible()){ if (!d->_animated.contains(item)){ setMovingItem(item); - item->setPos(QPointF(item->x()+d->_margin, item->y()+d->_margin)); + QPointF p(item->x(), item->y()); + if(d->aut & Horizontal) + p.setX(p.x() + d->_margin); + if(d->aut & Vertical) + p.setY(p.y() + d->_margin); + item->setPos(p); setMovingItem(0); } width = qMax(width, item->x() + item->width()); diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index ca6379f..715ae5a 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -700,7 +700,7 @@ void QFxPathView::itemsRemoved(int modelIndex, int count) } if (d->model->count() == 0) { - d->currentIndex == -1; + d->currentIndex = -1; d->moveOffset.setValue(0); return; } diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index ec81a7a..d66266f 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -264,10 +264,10 @@ public: enum Kind { Warning, Error }; DiagnosticMessage() - : kind(Error), line(0), column(0) {} + : kind(Error) {} - DiagnosticMessage(Kind kind, int line, int column, const QString &message) - : kind(kind), line(line), column(column), message(message) {} + DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} bool isWarning() const { return kind == Warning; } @@ -276,8 +276,7 @@ public: { return kind == Error; } Kind kind; - int line; - int column; + JavaScript::AST::SourceLocation loc; QString message; }; @@ -307,10 +306,10 @@ public: { return diagnosticMessage().message; } inline int errorLineNumber() const - { return diagnosticMessage().line; } + { return diagnosticMessage().loc.startLine; } inline int errorColumnNumber() const - { return diagnosticMessage().column; } + { return diagnosticMessage().loc.startColumn; } protected: void reallocateStack(); @@ -471,7 +470,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) -- Declarative UI -------------------------------------------------------------------------------------------------------- -UiProgram: UiImportListOpt UiObjectMemberList ; +UiProgram: UiImportListOpt UiRootMember ; /. case $rule_number: { program = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, @@ -522,6 +521,13 @@ case $rule_number: { } break; ./ +UiRootMember: UiObjectDefinition ; +/. +case $rule_number: { + sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); +} break; +./ + UiObjectMemberList: UiObjectMember ; /. case $rule_number: { @@ -587,9 +593,7 @@ case $rule_number: { } break; ./ -UiArrayObjectMember: T_IDENTIFIER UiObjectInitializer ; -/. case $rule_number: ./ -UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +UiObjectDefinition: T_IDENTIFIER UiObjectInitializer ; /. case $rule_number: { AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).sval, @@ -599,6 +603,9 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: UiObjectDefinition ; +UiObjectMember: UiObjectDefinition ; + UiArrayObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; /. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; @@ -865,9 +872,8 @@ PrimaryExpression: T_DIVIDE_ ; case $rule_number: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; // ### remove me } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); @@ -883,9 +889,8 @@ PrimaryExpression: T_DIVIDE_EQ ; case $rule_number: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); @@ -2695,10 +2700,8 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; yylloc.startColumn += yylloc.length; yylloc.length = 0; - const QString msg = QString::fromUtf8("Missing `;'"); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, - yylloc.startLine, yylloc.startColumn, msg)); + //const QString msg = QString::fromUtf8("Missing `;'"); + //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; last_token = &token_buffer[1]; @@ -2723,9 +2726,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; if (t_action(errorState, yytoken)) { const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; goto _Lcheck_token; @@ -2753,9 +2754,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; yylval = 0; @@ -2777,8 +2776,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; yylval = 0; @@ -2791,8 +2789,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } const QString msg = QString::fromUtf8("Syntax error"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } return false; diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index a33f343..cb98c36 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -55,622 +55,625 @@ const char *const JavaScriptGrammar::spell [] = { 0}; const int JavaScriptGrammar::lhs [] = { - 91, 92, 92, 95, 95, 96, 96, 94, 93, 93, - 98, 98, 100, 100, 99, 97, 99, 97, 99, 97, - 102, 103, 103, 97, 99, 97, 105, 105, 105, 97, - 97, 97, 97, 97, 97, 97, 101, 101, 109, 109, - 109, 101, 101, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 112, 112, - 116, 116, 111, 111, 114, 114, 117, 117, 117, 117, - 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 119, 119, 120, 120, 120, 120, 120, - 123, 123, 124, 124, 124, 124, 122, 122, 125, 125, - 126, 126, 127, 127, 127, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, - 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 132, 132, 132, 133, 133, 133, 133, 133, 133, 134, - 134, 134, 134, 134, 135, 135, 135, 135, 135, 136, - 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, - 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, - 146, 147, 147, 115, 115, 148, 148, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 106, - 106, 150, 150, 151, 151, 152, 152, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 153, 168, 168, 167, 167, 108, 108, 169, - 169, 170, 170, 172, 172, 171, 173, 176, 174, 174, - 177, 175, 175, 154, 155, 155, 156, 156, 157, 157, - 157, 157, 157, 157, 157, 158, 158, 158, 158, 159, - 159, 159, 159, 160, 160, 161, 163, 178, 178, 181, - 181, 179, 179, 182, 180, 162, 162, 162, 164, 164, - 165, 165, 165, 183, 184, 166, 166, 107, 121, 188, - 188, 185, 185, 186, 186, 189, 190, 190, 191, 191, - 187, 187, 113, 113, 192}; + 91, 92, 92, 95, 95, 96, 96, 94, 93, 98, + 98, 100, 100, 102, 102, 101, 99, 97, 101, 99, + 101, 99, 104, 105, 105, 99, 101, 99, 107, 107, + 107, 99, 99, 99, 99, 99, 99, 99, 103, 103, + 111, 111, 111, 103, 103, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 114, 114, 118, 118, 113, 113, 116, 116, 119, 119, + 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 121, 121, 122, 122, 122, + 122, 122, 125, 125, 126, 126, 126, 126, 124, 124, + 127, 127, 128, 128, 129, 129, 129, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, + 131, 132, 132, 132, 133, 133, 133, 133, 134, 134, + 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, + 135, 136, 136, 136, 136, 136, 137, 137, 137, 137, + 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, + 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, + 147, 148, 148, 149, 149, 117, 117, 150, 150, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 108, 108, 152, 152, 153, 153, 154, 154, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 155, 170, 170, 169, 169, 110, + 110, 171, 171, 172, 172, 174, 174, 173, 175, 178, + 176, 176, 179, 177, 177, 156, 157, 157, 158, 158, + 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, + 160, 161, 161, 161, 161, 162, 162, 163, 165, 180, + 180, 183, 183, 181, 181, 184, 182, 164, 164, 164, + 166, 166, 167, 167, 167, 185, 186, 168, 168, 109, + 123, 190, 190, 187, 187, 188, 188, 191, 192, 192, + 193, 193, 189, 189, 115, 115, 194}; const int JavaScriptGrammar:: rhs[] = { - 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, - 1, 3, 2, 3, 4, 4, 2, 2, 5, 5, - 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, - 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 5, 3, 4, 3, 2, 4, - 1, 2, 0, 1, 3, 5, 1, 1, 1, 1, + 2, 1, 1, 1, 2, 3, 3, 0, 1, 1, + 2, 1, 3, 2, 3, 4, 4, 2, 1, 1, + 5, 5, 1, 2, 2, 3, 3, 3, 1, 1, + 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 5, 3, 4, 3, + 2, 4, 1, 2, 0, 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 3, 5, - 1, 2, 4, 4, 4, 3, 0, 1, 1, 3, - 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 3, 3, 1, - 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, - 3, 3, 3, 1, 3, 3, 3, 3, 3, 1, - 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 3, 5, 1, 2, 4, 4, 4, 3, 0, 1, + 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, + 3, 1, 3, 3, 1, 3, 3, 3, 1, 3, + 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, + 3, 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, + 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, + 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 2, 0, 1, 3, 3, 1, - 1, 1, 3, 1, 3, 2, 2, 2, 0, 1, - 2, 0, 1, 1, 2, 2, 7, 5, 7, 7, - 5, 9, 10, 7, 8, 2, 2, 3, 3, 2, - 2, 3, 3, 3, 3, 5, 5, 3, 5, 1, - 2, 0, 1, 4, 3, 3, 3, 3, 3, 3, - 3, 3, 4, 5, 2, 2, 2, 8, 8, 1, - 3, 0, 1, 0, 1, 1, 1, 2, 1, 1, - 0, 1, 0, 1, 2}; + 1, 1, 1, 1, 3, 1, 2, 0, 1, 3, + 3, 1, 1, 1, 3, 1, 3, 2, 2, 2, + 0, 1, 2, 0, 1, 1, 2, 2, 7, 5, + 7, 7, 5, 9, 10, 7, 8, 2, 2, 3, + 3, 2, 2, 3, 3, 3, 3, 5, 5, 3, + 5, 1, 2, 0, 1, 4, 3, 3, 3, 3, + 3, 3, 3, 3, 4, 5, 2, 2, 2, 8, + 8, 1, 3, 0, 1, 0, 1, 1, 1, 2, + 1, 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { 8, 2, 0, 4, 3, 0, 0, 0, 6, 7, - 5, 35, 42, 240, 0, 0, 39, 40, 37, 38, - 41, 241, 9, 1, 0, 0, 36, 0, 29, 28, - 27, 0, 32, 0, 143, 210, 174, 182, 178, 122, - 194, 170, 34, 107, 45, 123, 186, 190, 111, 140, - 121, 126, 106, 160, 147, 0, 51, 52, 48, 311, - 39, 313, 63, 0, 0, 0, 0, 0, 46, 49, - 0, 0, 40, 41, 50, 44, 0, 47, 0, 0, - 136, 0, 0, 123, 142, 125, 124, 0, 0, 0, - 138, 139, 137, 141, 0, 171, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 0, 151, 0, 0, - 0, 145, 146, 144, 149, 153, 152, 150, 148, 163, - 162, 164, 0, 179, 0, 175, 0, 0, 117, 104, - 116, 105, 73, 74, 75, 100, 76, 101, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 102, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 103, 0, 0, 115, 211, 118, 0, 119, - 0, 120, 114, 0, 207, 200, 198, 205, 206, 204, - 203, 209, 202, 201, 199, 208, 195, 0, 183, 0, - 0, 187, 0, 0, 191, 0, 0, 117, 109, 0, - 108, 0, 113, 127, 0, 312, 302, 303, 0, 300, - 0, 301, 0, 304, 218, 225, 224, 232, 220, 0, - 221, 305, 0, 310, 222, 223, 228, 226, 307, 306, - 309, 229, 0, 0, 0, 0, 0, 311, 39, 0, - 313, 40, 212, 254, 41, 0, 0, 0, 0, 0, - 230, 231, 219, 227, 255, 256, 299, 308, 0, 270, - 271, 272, 273, 0, 266, 267, 268, 269, 296, 297, - 0, 0, 0, 0, 0, 259, 260, 216, 214, 176, - 184, 180, 196, 172, 217, 0, 123, 188, 192, 165, - 154, 0, 0, 173, 0, 0, 0, 0, 166, 0, - 0, 0, 0, 0, 158, 156, 159, 157, 155, 168, - 167, 169, 0, 181, 0, 177, 0, 215, 123, 0, - 197, 212, 213, 0, 212, 0, 0, 262, 0, 0, - 0, 264, 0, 185, 0, 0, 189, 0, 0, 193, - 252, 0, 244, 253, 247, 0, 251, 0, 212, 245, - 0, 212, 0, 0, 263, 0, 0, 0, 265, 312, - 302, 0, 0, 304, 0, 298, 0, 288, 0, 0, - 0, 258, 0, 257, 0, 314, 0, 72, 234, 237, - 0, 73, 240, 76, 101, 78, 79, 48, 83, 84, - 39, 85, 88, 46, 49, 40, 212, 41, 50, 91, - 44, 93, 47, 95, 96, 241, 98, 99, 103, 0, - 65, 0, 0, 67, 71, 69, 57, 68, 70, 0, - 66, 56, 235, 233, 111, 112, 117, 0, 110, 0, - 287, 0, 274, 275, 0, 286, 0, 0, 0, 277, - 282, 280, 283, 0, 0, 281, 282, 0, 278, 0, - 279, 236, 285, 0, 236, 284, 0, 289, 290, 0, - 236, 291, 292, 0, 0, 293, 0, 0, 0, 294, - 295, 129, 128, 0, 0, 0, 261, 0, 0, 0, - 276, 0, 64, 0, 61, 63, 54, 0, 60, 55, - 62, 59, 53, 0, 58, 133, 131, 135, 132, 130, - 134, 0, 0, 18, 13, 0, 14, 10, 0, 31, - 0, 33, 30, 0, 0, 26, 39, 63, 21, 0, - 24, 16, 39, 0, 11, 0, 17, 0, 20, 12, - 0, 25, 39, 63, 15, 0, 19, 22, 23, 43, - 249, 242, 0, 250, 246, 0, 248, 238, 0, 239, - 243, 315}; + 5, 0, 9, 1, 0, 18, 37, 44, 242, 0, + 0, 41, 42, 14, 39, 40, 43, 243, 20, 10, + 0, 0, 0, 38, 0, 31, 30, 29, 0, 34, + 0, 145, 212, 176, 184, 180, 124, 196, 172, 36, + 109, 47, 125, 188, 192, 113, 142, 123, 128, 108, + 162, 149, 0, 53, 54, 50, 313, 41, 315, 65, + 0, 0, 0, 0, 0, 48, 51, 0, 0, 42, + 43, 52, 46, 0, 49, 0, 0, 138, 0, 0, + 125, 144, 127, 126, 0, 0, 0, 140, 141, 139, + 143, 0, 173, 0, 0, 0, 0, 163, 0, 0, + 0, 0, 0, 0, 153, 0, 0, 0, 147, 148, + 146, 151, 155, 154, 152, 150, 165, 164, 166, 0, + 181, 0, 177, 0, 0, 119, 106, 118, 107, 75, + 76, 77, 102, 78, 103, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 104, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 105, + 0, 0, 117, 213, 120, 0, 121, 0, 122, 116, + 0, 209, 202, 200, 207, 208, 206, 205, 211, 204, + 203, 201, 210, 197, 0, 185, 0, 0, 189, 0, + 0, 193, 0, 0, 119, 111, 0, 110, 0, 115, + 129, 0, 314, 304, 305, 0, 302, 0, 303, 0, + 306, 220, 227, 226, 234, 222, 0, 223, 307, 0, + 312, 224, 225, 230, 228, 309, 308, 311, 231, 0, + 0, 0, 0, 0, 313, 41, 0, 315, 42, 214, + 256, 43, 0, 0, 0, 0, 0, 232, 233, 221, + 229, 257, 258, 301, 310, 0, 272, 273, 274, 275, + 0, 268, 269, 270, 271, 298, 299, 0, 0, 0, + 0, 0, 261, 262, 218, 216, 178, 186, 182, 198, + 174, 219, 0, 125, 190, 194, 167, 156, 0, 0, + 175, 0, 0, 0, 0, 168, 0, 0, 0, 0, + 0, 160, 158, 161, 159, 157, 170, 169, 171, 0, + 183, 0, 179, 0, 217, 125, 0, 199, 214, 215, + 0, 214, 0, 0, 264, 0, 0, 0, 266, 0, + 187, 0, 0, 191, 0, 0, 195, 254, 0, 246, + 255, 249, 0, 253, 0, 214, 247, 0, 214, 0, + 0, 265, 0, 0, 0, 267, 314, 304, 0, 0, + 306, 0, 300, 0, 290, 0, 0, 0, 260, 0, + 259, 0, 316, 0, 74, 236, 239, 0, 75, 242, + 78, 103, 80, 81, 50, 85, 86, 41, 87, 90, + 48, 51, 42, 214, 43, 52, 93, 46, 95, 49, + 97, 98, 243, 100, 101, 105, 0, 67, 0, 0, + 69, 73, 71, 59, 70, 72, 0, 68, 58, 237, + 235, 113, 114, 119, 0, 112, 0, 289, 0, 276, + 277, 0, 288, 0, 0, 0, 279, 284, 282, 285, + 0, 0, 283, 284, 0, 280, 0, 281, 238, 287, + 0, 238, 286, 0, 291, 292, 0, 238, 293, 294, + 0, 0, 295, 0, 0, 0, 296, 297, 131, 130, + 0, 0, 0, 263, 0, 0, 0, 278, 0, 66, + 0, 63, 65, 56, 0, 62, 57, 64, 61, 55, + 0, 60, 135, 133, 137, 134, 132, 136, 0, 0, + 33, 0, 35, 32, 15, 11, 0, 0, 28, 41, + 65, 23, 0, 26, 17, 0, 12, 19, 0, 0, + 22, 13, 0, 27, 41, 65, 16, 0, 21, 24, + 25, 45, 251, 244, 0, 252, 248, 0, 250, 240, + 0, 241, 245, 317}; const int JavaScriptGrammar::goto_default [] = { - 6, 5, 23, 1, 4, 3, 22, 523, 524, 503, - 24, 519, 520, 378, 508, 219, 11, 252, 44, 52, - 483, 481, 376, 375, 35, 482, 374, 377, 130, 48, - 43, 168, 50, 39, 167, 45, 51, 80, 49, 34, - 54, 53, 289, 41, 283, 36, 279, 38, 281, 37, - 280, 46, 287, 47, 288, 40, 282, 278, 319, 431, - 284, 285, 214, 218, 220, 224, 225, 216, 215, 227, - 253, 226, 231, 250, 251, 217, 380, 379, 25, 542, - 541, 341, 342, 544, 344, 543, 343, 439, 443, 446, - 442, 441, 461, 462, 208, 222, 204, 207, 221, 229, - 228, 0}; + 6, 5, 13, 1, 4, 3, 527, 30, 29, 525, + 526, 15, 528, 522, 523, 385, 509, 226, 230, 259, + 51, 59, 490, 488, 383, 382, 42, 489, 381, 384, + 137, 55, 50, 175, 57, 46, 174, 52, 58, 87, + 56, 41, 61, 60, 296, 48, 290, 43, 286, 45, + 288, 44, 287, 53, 294, 54, 295, 47, 289, 285, + 326, 438, 291, 292, 221, 225, 227, 231, 232, 223, + 222, 234, 260, 233, 238, 257, 258, 224, 387, 386, + 32, 544, 543, 348, 349, 546, 351, 545, 350, 446, + 450, 453, 449, 448, 468, 469, 215, 229, 211, 214, + 228, 236, 235, 0}; const int JavaScriptGrammar::action_index [] = { - 62, -91, -18, -91, -40, 362, 44, 117, -91, -91, - -91, -91, -91, -91, -12, 144, 20, 130, -91, -91, - 14, -91, -91, 356, 127, 195, -91, 158, -91, -91, - -91, 11, 34, 678, 125, -91, 41, -9, -27, 204, - -91, 263, 58, -91, -91, 519, 61, 63, 220, 131, - -91, -91, -91, 330, 159, 678, -91, -91, -91, 154, - -91, 1176, 53, 678, 678, 678, 598, 678, -91, -91, - 678, 678, -91, -91, -91, -91, 678, -91, 678, 678, - -91, 678, 678, 118, 221, -91, -91, 678, 678, 678, - -91, -91, -91, 217, 678, 269, 678, 678, 678, 678, - 311, 678, 678, 678, 678, 678, 678, 228, 678, 678, - 678, 104, 65, 64, 187, 164, 214, 295, 295, 431, - 431, 345, 678, -7, 678, 90, 1089, 678, 678, -91, + -27, -91, 56, -91, -22, 60, 62, 109, -91, -91, + -91, 54, -91, -91, 438, -91, -91, -91, -91, 49, + 220, 53, 172, -91, -91, -91, 50, -91, -91, -91, + 415, 84, 207, -91, 226, -91, -91, -91, 61, 63, + 725, 80, -91, 68, 69, 59, 217, -91, 342, 74, + -91, -91, 566, 66, 72, 144, 140, -91, -91, -91, + 395, 160, 725, -91, -91, -91, 176, -91, 1223, 64, + 725, 725, 725, 645, 725, -91, -91, 725, 725, -91, + -91, -91, -91, 725, -91, 725, 725, -91, 725, 725, + 107, 178, -91, -91, 725, 725, 725, -91, -91, -91, + 187, 725, 342, 725, 725, 725, 725, 385, 725, 725, + 725, 725, 725, 725, 269, 725, 725, 725, 132, 113, + 79, 193, 269, 196, 199, 200, 370, 478, 478, 725, + 59, 725, 73, 1136, 725, 725, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, 113, 678, -91, -91, 42, -8, -91, - 678, -91, -91, 678, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, 678, 22, 678, - 678, 29, 5, 678, -91, 1089, 678, 678, -91, 110, - -91, 51, -91, -91, 36, -91, 184, 85, 60, -91, - 151, -91, 56, 1437, -91, -91, -91, -91, -91, 166, - -91, -91, 28, -91, -91, -91, -91, -91, -91, 1437, - -91, -91, 290, 244, 102, 1350, 49, 178, 73, 39, - 1698, 70, 678, -91, 72, 46, 678, 43, 37, 38, - -91, -91, -91, -91, -91, -91, -91, -91, 68, -91, - -91, -91, -91, 71, -91, -91, -91, -91, -91, -91, - 50, 54, 678, 88, 66, -91, -91, 842, -91, 87, - 47, 45, -91, 257, 59, 26, 486, 84, 146, 363, - 295, 205, 678, 249, 678, 678, 678, 678, 363, 678, - 678, 678, 678, 678, 295, 295, 295, 295, 295, 293, - 363, 363, 678, -21, 678, 18, 678, -91, 519, 678, - -91, 678, 13, -37, 678, -38, 1350, -91, 678, 98, - 1350, -91, 678, -28, 678, 678, 16, 8, 678, -91, - 0, 229, -15, -91, -91, 678, -91, 219, 678, -91, - -34, 678, -32, 1350, -91, 678, 89, 1350, -91, -6, - 197, -24, 1, 1437, -23, -91, 1350, -91, 678, 94, - 1350, 17, 1350, -91, 6, 15, -26, -91, -91, 1350, - -30, 231, 7, 278, 76, 678, 1350, -5, -36, 260, - -3, -29, 598, -4, -1, -91, 762, -91, 3, 19, - 4, 678, -2, -25, 678, 2, 678, -35, -10, 678, - -91, 1263, 52, -91, -91, -91, -91, -91, -91, 678, - -91, -91, -91, -91, 167, -91, 678, 21, -91, 1350, - -91, 74, -91, -91, 1350, -91, 678, 91, 25, -91, - 105, -91, 105, 97, 678, -91, 105, 55, -91, 23, - -91, 1350, -91, 101, 1350, -91, 208, -91, -91, 92, - 1350, 40, -91, 33, 35, -91, 180, 24, 31, -91, - -91, -91, -91, 678, 86, 1350, -91, 678, 93, 1350, - -91, 106, 57, 922, -91, 48, -91, 1002, -91, -91, - -91, -91, -91, 132, -91, -91, -91, -91, -91, -91, - -91, 10, 424, -91, -91, 421, -91, -91, 9, 30, - 678, 27, -91, 1611, 156, -91, 134, 342, -91, 95, - -91, -91, 12, 116, -91, 124, -91, 270, -91, -91, - 1524, -91, 112, 352, -91, 114, -91, -91, -91, -91, - 32, -91, 169, -91, -91, 678, -91, -91, 139, -91, - -91, -91, + 94, 725, -91, -91, 65, 47, -91, 725, -91, -91, + 725, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, 725, 46, 725, 725, 55, 51, + 725, -91, 1136, 725, 725, -91, 95, -91, 38, -91, + -91, 35, -91, 210, 48, 32, -91, 223, -91, 34, + 1484, -91, -91, -91, -91, -91, 240, -91, -91, 33, + -91, -91, -91, -91, -91, -91, 1484, -91, -91, 281, + 266, 71, 1397, 39, 216, 52, 45, 1745, 58, 725, + -91, 57, 44, 725, 43, 41, 42, -91, -91, -91, + -91, -91, -91, -91, -91, 104, -91, -91, -91, -91, + 106, -91, -91, -91, -91, -91, -91, -28, 27, 725, + 117, 100, -91, -91, 805, -91, 83, 70, 67, -91, + 260, 77, -56, 503, 12, 119, 289, 231, 204, 725, + 285, 725, 725, 725, 725, 333, 725, 725, 725, 725, + 725, 181, 157, 169, 177, 269, 410, 339, 317, 725, + -65, 725, 15, 725, -91, 566, 725, -91, 725, 9, + -42, 725, -38, 1397, -91, 725, 116, 1397, -91, 725, + -48, 725, 725, 5, 120, 725, -91, 25, 203, 13, + -91, -91, 725, -91, 218, 725, -91, -1, 725, -8, + 1397, -91, 725, 103, 1397, -91, 19, 225, -19, 4, + 1484, -25, -91, 1397, -91, 725, 97, 1397, 24, 1397, + -91, 26, 31, -23, -91, -91, 1397, -24, 337, 22, + 324, 81, 725, 1397, 40, 10, 252, -3, -33, 645, + 2, 1, -91, 889, -91, 11, -13, 3, 725, 8, + 18, 725, 21, 725, -2, -10, 725, -91, 1310, 29, + -91, -91, -91, -91, -91, -91, 725, -91, -91, -91, + -91, 194, -91, 725, -6, -91, 1397, -91, 78, -91, + -91, 1397, -91, 725, 128, -12, -91, 6, -91, 7, + 91, 725, -91, -4, 36, -91, -53, -91, 1397, -91, + 105, 1397, -91, 130, -91, -91, 108, 1397, 0, -91, + 14, 16, -91, 150, 23, 20, -91, -91, -91, -91, + 725, 121, 1397, -91, 725, 126, 1397, -91, 85, 30, + 1049, -91, 37, -91, 969, -91, -91, -91, -91, -91, + 96, -91, -91, -91, -91, -91, -91, -91, -9, -5, + 28, 725, 17, -91, -91, -91, 1658, 146, -91, 102, + 406, -91, 86, -91, -91, 98, -91, -91, 93, 279, + -91, -91, 1571, -91, 90, 384, -91, 88, -91, -91, + -91, -91, -11, -91, 206, -91, -91, 725, -91, -91, + 232, -91, -91, -91, - -102, -102, -102, -102, 34, 63, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 53, -102, -102, -102, -102, - -102, -102, -102, 235, -102, 9, -102, 4, -102, -102, - -102, -102, -102, -5, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -51, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 156, -102, -102, -102, 18, - -102, -102, -102, -11, 95, 88, 90, 79, -102, -102, - 80, 100, -102, -102, -102, -102, 114, -102, 101, 107, - -102, 73, 131, -102, -102, -102, -102, 108, 111, 115, - -102, -102, -102, -102, 165, -102, 83, 85, 118, 71, - -102, 120, 144, 145, 143, 147, 159, -102, 122, 129, - 66, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 41, -102, 65, -102, 77, 26, 19, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, 27, -102, -102, -102, -102, -102, - 28, -102, -102, 42, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, 139, -102, 138, - -1, -102, -102, 1, -102, 230, -10, 55, -102, -102, - -102, -102, -102, -102, -102, -102, -3, -102, -102, -102, - -4, -102, -102, 86, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, 254, - -102, -102, 56, 50, -102, 46, -102, -6, -102, -102, - -102, -102, -2, -102, -102, -102, 17, -28, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 5, -102, -102, -102, -102, 146, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, 43, 225, -102, 237, 226, 197, 196, -102, 127, - 136, 137, 135, 93, -102, -102, -102, -102, -102, -102, - -102, -102, 174, -102, 180, -102, 170, -102, -102, 183, - -102, 68, -102, -102, 70, -102, 49, -102, 48, -102, - 47, -102, 193, -102, 161, 219, -102, -102, 189, -102, - -102, -102, -102, -102, -102, 190, -102, 59, 72, -102, - -102, 75, -102, 57, -102, 58, -102, 51, -102, -102, - 64, -102, -102, 203, -102, -102, 44, -102, 32, -102, - 31, -102, 29, -102, -102, -102, -102, -102, -102, 40, - -102, 37, -102, 38, -102, 61, 36, -102, -102, 30, - -102, -102, 62, -102, -102, -102, 35, -102, -102, -102, - -102, 39, -102, 3, 128, -102, 155, -102, -102, 22, - -102, 14, -102, -102, -102, -102, -102, -102, -102, 13, - -102, -102, -102, -102, -102, -102, 123, -102, -102, 45, - -102, -102, -102, -102, 25, -102, 52, -102, -102, -102, - -102, -102, -80, -102, 54, -102, -72, -102, -102, -102, - -102, -73, -102, -102, -76, -102, -102, -102, -102, -102, - -102, -87, -102, -102, -45, -102, 12, -102, -31, -102, - -102, -102, -102, 20, -102, 15, -102, 98, -102, 6, - -102, -102, -102, 0, -102, 2, -102, -16, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 232, -102, -102, 238, -102, -102, -102, -102, - 11, -102, -102, 16, -9, -102, -7, 74, -102, -102, - -102, -102, 24, -102, -102, -102, -102, 194, -102, -102, - 8, -102, -8, 188, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 21, -102, -102, 60, -102, - -102, -102}; + -104, -104, -104, -104, -3, 5, -104, -104, -104, -104, + -104, -104, -104, -104, 241, -104, -104, -104, -104, -104, + 4, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 246, -104, 2, -104, 3, -104, -104, -104, -104, -104, + 15, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -45, -104, -104, -104, -104, -104, -104, -104, + -104, -104, 104, -104, -104, -104, -6, -104, -104, -104, + -14, 124, 119, 97, 113, -104, -104, 108, 112, -104, + -104, -104, -104, 127, -104, 120, 116, -104, 96, 85, + -104, -104, -104, -104, 128, 109, 105, -104, -104, -104, + -104, 89, -104, 146, 158, 143, 84, -104, 142, 136, + 135, 154, 145, 76, -104, 71, 134, 42, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, 70, + -104, 73, -104, 80, 37, 31, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, 34, -104, -104, -104, -104, -104, 27, -104, -104, + -18, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, 123, -104, 132, 22, -104, -104, + 24, -104, 180, 23, 90, -104, -104, -104, -104, -104, + -104, -104, -104, 7, -104, -104, -104, -2, -104, -104, + 26, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, 74, -104, -104, -8, + 19, -104, 28, -104, 1, -104, -104, -104, -104, 8, + -104, -104, -104, 17, -41, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, 67, + -104, -104, -104, -104, 93, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, 32, 202, + -104, 198, 188, 192, 189, -104, 151, 201, 45, 60, + 69, -104, -104, -104, -104, -104, -104, -104, -104, 169, + -104, 176, -104, 204, -104, -104, 268, -104, 77, -104, + -104, 68, -104, 55, -104, 57, -104, 56, -104, 170, + -104, 160, 161, -104, -104, 162, -104, -104, -104, -104, + -104, -104, 186, -104, 53, 78, -104, -104, 79, -104, + 62, -104, 51, -104, 50, -104, -104, 94, -104, -104, + 65, -104, -104, 48, -104, 49, -104, 47, -104, 44, + -104, -104, -104, -104, -104, -104, 43, -104, 36, -104, + 41, -104, 66, 63, -104, -104, 52, -104, -104, 59, + -104, -104, -104, 64, -104, -104, -104, -104, 30, -104, + -29, 131, -104, 155, -104, -104, 38, -104, 39, -104, + -104, -104, -104, -104, -104, -104, 29, -104, -104, -104, + -104, -104, -104, 91, -104, -104, 61, -104, -104, -104, + -104, 54, -104, 58, -104, -104, -104, -104, -104, -57, + -104, -11, -104, -83, -104, -104, -104, -104, -73, -104, + -104, -68, -104, -104, -104, -104, -104, -104, -86, -104, + -104, -60, -104, -20, -104, -63, -104, -104, -104, -104, + 0, -104, 18, -104, 21, -104, 16, -104, -104, -104, + 11, -104, 20, -104, 25, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -1, -104, -104, -104, -104, 13, 10, -104, 9, + 6, -104, -104, -104, -104, -104, -104, -104, -104, 81, + -104, -104, 14, -104, 33, 95, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -13, -104, -104, + 72, -104, -104, -104}; const int JavaScriptGrammar::action_info [] = { - 277, 473, -81, -89, -67, -94, -71, 368, 460, -97, - -70, -92, 193, 409, -100, 338, 355, 345, 332, 292, - 312, 164, 326, 411, 324, 423, 477, 351, 353, 421, - 360, 187, 365, 372, 363, 164, 362, 510, 509, 122, - 32, 33, 94, 512, 551, 502, 360, 7, 2, 545, - 170, 124, 172, 502, 27, 436, 484, 314, 440, 419, - 464, 484, 451, 187, 460, 490, 164, 316, 460, 466, - 122, 124, 206, 473, 477, 368, 460, 429, 450, 434, - 366, 428, 436, 256, 468, 277, 332, 321, 292, 213, - 272, 94, 0, 210, 164, 312, 164, 164, 463, 164, - 0, 164, 164, 0, 81, 81, 164, 447, 454, 164, - 444, 202, 464, 189, 485, 82, 82, 190, 164, 366, - 212, 164, 527, 314, 527, 0, 271, 276, 275, 262, - 261, 530, 267, 266, 513, 433, 432, 269, 268, 514, - 164, 366, 514, 87, 81, 502, 475, 0, 274, 357, - 2, 438, 448, 479, 370, 82, 538, 537, 330, 28, - 85, 0, 486, 269, 268, 81, 200, 502, 60, 165, - 536, 86, 528, 60, 164, 0, 82, 548, 9, 8, - 60, 0, 195, 60, 108, 60, 109, 28, 88, 108, - 0, 109, 494, 0, 89, 0, 334, 110, 0, 0, - 335, 196, 110, 426, 30, 72, 73, 60, 0, 60, - 72, 73, 108, 60, 109, 29, 164, 72, 73, 126, - 72, 73, 72, 73, 60, 110, 60, 255, 254, 87, - 549, 547, 30, 87, 60, 195, 0, 347, 127, 108, - 128, 109, 0, 29, 72, 73, 72, 73, 60, 0, - 72, 73, 110, 108, 196, 109, 197, 0, 0, 0, - 60, 72, 73, 72, 73, 0, 110, 294, 295, 458, - 457, 72, 73, 60, 88, 294, 295, 0, 88, 0, - 89, 96, 97, 0, 89, 72, 73, 96, 97, 60, - 348, 0, 260, 259, 296, 297, -311, 72, 73, 522, - 0, 0, 296, 297, 0, 265, 264, 60, 98, 99, - 72, 73, 0, 0, 98, 99, 299, 300, 0, 60, - 108, 0, 109, 0, 0, 301, 72, 73, 302, 19, - 303, 0, 0, 110, 101, 102, 72, 73, 0, 265, - 264, 0, 103, 104, 72, 73, 105, 0, 106, 0, - 484, 260, 259, 101, 102, 18, 72, 73, 0, 0, - 484, 103, 104, 0, 0, 105, 14, 106, 101, 102, - 0, 522, 14, 0, 0, 0, 103, 104, 15, 0, - 105, 522, 106, 0, 15, 16, 299, 300, 0, 0, - 0, 16, 0, 0, 0, 301, 0, 0, 302, 0, - 303, 19, 0, 0, 0, 0, 0, 0, 72, 73, - 0, 19, 0, 0, 0, 19, 0, 0, 72, 73, - 0, 19, 17, 20, 0, 0, 0, 18, 17, 20, - 21, 14, 0, 0, 14, 0, 21, 18, 0, 13, - 0, 18, 0, 15, 0, 13, 15, 18, 0, 0, - 16, 0, 0, 16, 101, 102, 0, 0, 0, 0, - 0, 0, 103, 104, 0, 0, 105, 0, 106, 0, - 0, 0, 0, 0, 0, 0, 506, 0, 0, 504, - 19, 0, 0, 19, 0, 0, 0, 17, 20, 174, - 17, 20, 0, 0, 0, 21, 0, 0, 21, 175, - 0, 0, 0, 176, 13, 0, 18, 13, 0, 18, - 0, 0, 177, 0, 178, 0, 0, 328, 0, 0, - 0, 0, 174, 0, 0, 179, 0, 180, 85, 0, - 0, 0, 175, 0, 0, 181, 176, 0, 182, 86, - 0, 0, 0, 0, 183, 177, 0, 178, 0, 0, - 184, 0, 0, 0, 0, 0, 0, 0, 179, 0, - 180, 85, 0, 0, 0, 185, 0, 0, 181, 0, - 0, 182, 86, 0, 0, 0, 0, 183, 0, 0, - 0, 0, 0, 184, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, + 319, 451, 457, 375, -69, 328, 547, 339, -73, -91, + -94, 451, 451, 321, 339, -96, 299, 171, -72, 331, + 471, 447, 333, 443, 510, 171, 484, 367, -99, -102, + 372, 430, 428, 416, 480, 511, 426, 370, 497, 418, + 379, 369, 352, 458, 362, 491, 284, -83, 278, 467, + 473, 467, 360, 467, 435, 367, 217, 194, 200, 373, + 358, 2, 553, 279, 441, 436, 2, 220, 194, 101, + 40, 213, 491, 177, 101, 284, 467, 480, 484, 513, + 443, 375, 171, 475, 299, 323, 14, 14, 263, 11, + 39, 516, 219, 492, 129, 0, 529, 373, 209, 517, + 532, 454, 171, 171, 171, 171, 529, 179, 517, 373, + 0, 171, 461, 171, 470, 34, 0, 129, 319, 88, + 88, 7, 196, 14, 171, 171, 197, 345, 471, 171, + 89, 89, 276, 275, 171, 14, 171, 131, 171, 440, + 439, 493, 276, 275, 538, 321, 455, 540, 539, 92, + 172, 207, 94, 88, 530, 0, 501, 377, 0, 202, + 93, 283, 282, 364, 89, 269, 268, 274, 273, 341, + 9, 8, 88, 342, 0, 67, 337, 281, 203, 67, + 204, 482, 115, 89, 116, 115, 486, 116, 445, 0, + 94, 465, 464, 0, 115, 117, 116, 95, 117, 94, + 0, 35, 115, 96, 116, 67, 115, 117, 116, 202, + 0, 354, 79, 80, 550, 117, 79, 80, 115, 117, + 116, 115, 0, 116, 115, 115, 116, 116, 203, 0, + 433, 117, 133, 67, 117, 95, 67, 117, 117, 67, + 0, 96, 79, 80, 95, 67, 37, 67, 171, 67, + 96, 134, 67, 135, 67, 35, 115, 36, 116, 0, + 0, 67, 0, 0, 355, 0, 0, 551, 549, 117, + 79, 80, 0, 79, 80, 0, 79, 80, 301, 302, + 0, 67, 79, 80, 79, 80, 79, 80, -313, 79, + 80, 79, 80, 0, 115, 67, 116, 0, 79, 80, + 37, 262, 261, 301, 302, 303, 304, 117, 21, 0, + 67, 36, 306, 307, 0, 0, 0, 0, 79, 80, + 0, 308, 0, 0, 309, 0, 310, 272, 271, 0, + 303, 304, 79, 80, 0, 0, 0, 0, 25, 0, + 306, 307, 267, 266, 0, 79, 80, 79, 80, 308, + 0, 0, 309, 67, 310, 0, 306, 307, 0, 0, + 103, 104, 306, 307, 24, 308, 67, 0, 309, 0, + 310, 308, 0, 0, 309, 0, 310, 0, 0, 0, + 0, 0, 0, 0, 0, 272, 271, 105, 106, 0, + 79, 80, 491, 108, 109, 0, 0, 0, 267, 266, + 0, 110, 111, 79, 80, 112, 0, 113, 108, 109, + 0, 0, 0, 21, 491, 0, 110, 111, 108, 109, + 112, 0, 113, 0, 0, 19, 110, 111, 0, 0, + 112, 0, 113, 306, 307, 21, 0, 20, 0, 0, + 0, 0, 308, 25, 21, 309, 0, 310, 19, 0, + 79, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 25, 0, 21, 0, 24, + 514, 0, 79, 80, 25, 0, 0, 0, 0, 0, + 0, 22, 26, 0, 0, 0, 0, 0, 0, 27, + 0, 24, 0, 23, 0, 0, 0, 25, 18, 0, + 24, 108, 109, 0, 22, 26, 181, 0, 0, 110, + 111, 0, 27, 112, 0, 113, 182, 0, 0, 0, + 183, 18, 0, 24, 0, 0, 0, 0, 0, 184, + 0, 185, 0, 0, 335, 0, 0, 0, 0, 0, + 0, 0, 186, 0, 187, 92, 0, 0, 0, 0, + 0, 0, 188, 0, 0, 189, 93, 0, 0, 0, + 0, 190, 0, 0, 0, 0, 0, 191, 0, 181, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, + 0, 0, 192, 183, 0, 0, 0, 0, 0, 0, + 0, 0, 184, 0, 185, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 186, 0, 187, 92, 0, + 0, 0, 0, 0, 0, 188, 0, 0, 189, 93, + 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, + 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 0, 0, 0, 73, 0, + 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 0, 60, 0, 0, - 0, 61, 62, 0, 63, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 0, 69, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 73, 74, + 0, 0, 76, 0, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 72, 73, 0, 75, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 77, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 55, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 0, 60, 0, 0, - 0, 61, 62, 0, 63, 0, 0, 0, 64, 0, - 65, 66, 67, 0, 0, 69, 0, 0, 0, 70, - 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 72, 73, 0, 75, 0, 76, - 0, 78, 0, 79, 0, 0, 0, 0, 68, 77, - 58, 0, 0, 0, 0, 0, 0, 0, 0, -90, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 291, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 492, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 489, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 132, 133, 134, 0, 0, 136, 138, - 139, 0, 0, 140, 0, 141, 0, 0, 0, 143, - 144, 145, 0, 0, 0, 0, 0, 0, 60, 146, - 147, 148, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 0, - 0, 0, 0, 0, 0, 72, 73, 153, 154, 155, - 0, 157, 158, 159, 160, 161, 162, 0, 0, 150, - 156, 142, 135, 137, 151, 0, 0, 0, 0, 0, - 132, 133, 134, 0, 0, 136, 138, 139, 0, 0, - 140, 0, 141, 0, 0, 0, 143, 144, 145, 0, - 0, 0, 0, 0, 0, 413, 146, 147, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, - 0, 0, 0, 414, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 152, 0, 0, 0, 0, - 0, 418, 415, 417, 153, 154, 155, 0, 157, 158, - 159, 160, 161, 162, 0, 0, 150, 156, 142, 135, - 137, 151, 0, 0, 0, 0, 0, 132, 133, 134, - 0, 0, 136, 138, 139, 0, 0, 140, 0, 141, - 0, 0, 0, 143, 144, 145, 0, 0, 0, 0, - 0, 0, 413, 146, 147, 148, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 0, 0, 0, - 414, 0, 0, 0, 0, 0, 0, 0, 416, 0, - 0, 0, 152, 0, 0, 0, 0, 0, 418, 415, - 417, 153, 154, 155, 0, 157, 158, 159, 160, 161, - 162, 0, 0, 150, 156, 142, 135, 137, 151, 0, - 0, 0, 0, 0, 232, 0, 0, 0, 0, 233, - 0, 55, 56, 57, 235, 0, 0, 0, 0, 0, - 0, 236, 59, 0, 0, 0, 0, 0, 0, 238, - 239, 0, 0, 240, 62, 0, 63, 0, 0, 0, - 64, 0, 65, 66, 67, 0, 0, 69, 0, 0, - 0, 70, 0, 71, 0, 0, 0, 0, 0, 242, - 0, 243, 0, 0, 0, 74, 241, 244, 245, 75, - 246, 76, 247, 78, 21, 79, 248, 249, 0, 0, - 68, 77, 58, 13, 234, 0, 0, 0, 0, 0, - 0, 232, 0, 0, 0, 0, 233, 0, 55, 56, - 57, 235, 0, 0, 0, 0, 0, 0, 236, 237, - 0, 0, 0, 0, 0, 0, 238, 239, 0, 0, - 240, 62, 0, 63, 0, 0, 0, 64, 0, 65, - 66, 67, 0, 0, 69, 0, 0, 0, 70, 0, - 71, 0, 0, 0, 0, 0, 242, 0, 243, 0, - 0, 0, 74, 241, 244, 245, 75, 246, 76, 247, - 78, 21, 79, 248, 249, 0, 0, 68, 77, 58, - 13, 234, 0, 0, 0, 0, 0, 0, 232, 0, - 0, 0, 0, 233, 0, 55, 56, 57, 235, 0, - 0, 0, 0, 0, 0, 236, 59, 0, 0, 0, - 0, 0, 0, 532, 239, 0, 0, 240, 533, 0, - 63, 0, 0, 0, 64, 0, 65, 66, 67, 0, - 0, 69, 0, 0, 0, 70, 0, 71, 0, 0, - 0, 0, 0, 242, 0, 243, 0, 0, 0, 74, - 241, 244, 245, 75, 246, 76, 247, 78, 21, 79, - 248, 249, 0, 0, 68, 77, 58, 13, 234, 0, - 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, - 233, 0, 55, 56, 57, 235, 0, 0, 0, 0, - 0, 0, 236, 59, 0, 0, 0, 0, 0, 0, - 516, 239, 0, 0, 240, 517, 0, 63, 0, 0, - 0, 64, 0, 65, 66, 67, 0, 0, 69, 0, - 0, 0, 70, 0, 71, 0, 0, 0, 0, 0, - 242, 0, 243, 0, 0, 0, 74, 241, 244, 245, - 75, 246, 76, 247, 78, 21, 79, 248, 249, 0, - 0, 68, 77, 58, 13, 234, 0, 518, 0, 0, - 0, 0, 381, 133, 134, 0, 0, 383, 138, 385, - 56, 57, 386, 0, 141, 0, 0, 0, 143, 388, - 389, 0, 0, 0, 0, 0, 0, 390, 391, 147, - 148, 240, 62, 0, 63, 0, 0, 0, 64, 0, - 65, 392, 67, 0, 0, 394, 0, 0, 0, 70, - 0, 71, 0, -236, 0, 0, 0, 396, 0, 243, - 0, 0, 0, 398, 395, 397, 399, 400, 401, 76, - 403, 404, 405, 406, 407, 408, 0, 0, 393, 402, - 387, 382, 384, 151, 0, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 83, 0, 85, 0, + 86, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 73, 74, + 0, 0, 76, 0, 0, 0, 77, 0, 78, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 83, 0, 85, 298, + 86, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 496, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 499, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 139, 140, 141, 0, 0, 143, 145, 146, 0, 0, + 147, 0, 148, 0, 0, 0, 150, 151, 152, 0, + 0, 0, 0, 0, 0, 67, 153, 154, 155, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, + 0, 0, 79, 80, 160, 161, 162, 0, 164, 165, + 166, 167, 168, 169, 0, 0, 157, 163, 149, 142, + 144, 158, 0, 0, 0, 0, 0, 139, 140, 141, + 0, 0, 143, 145, 146, 0, 0, 147, 0, 148, + 0, 0, 0, 150, 151, 152, 0, 0, 0, 0, + 0, 0, 420, 153, 154, 155, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 421, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 159, 0, 0, 0, 0, 0, 425, 422, + 424, 160, 161, 162, 0, 164, 165, 166, 167, 168, + 169, 0, 0, 157, 163, 149, 142, 144, 158, 0, + 0, 0, 0, 0, 139, 140, 141, 0, 0, 143, + 145, 146, 0, 0, 147, 0, 148, 0, 0, 0, + 150, 151, 152, 0, 0, 0, 0, 0, 0, 420, + 153, 154, 155, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 156, 0, 0, 0, 421, 0, 0, + 0, 0, 0, 0, 0, 423, 0, 0, 0, 159, + 0, 0, 0, 0, 0, 425, 422, 424, 160, 161, + 162, 0, 164, 165, 166, 167, 168, 169, 0, 0, + 157, 163, 149, 142, 144, 158, 0, 0, 0, 0, + 0, 239, 0, 0, 0, 0, 240, 0, 62, 63, + 64, 242, 0, 0, 0, 0, 0, 0, 243, 66, + 0, 0, 0, 0, 0, 0, 245, 246, 0, 0, + 247, 69, 0, 70, 0, 0, 0, 71, 0, 72, + 73, 74, 0, 0, 76, 0, 0, 0, 77, 0, + 78, 0, 0, 0, 0, 0, 249, 0, 250, 0, + 0, 0, 81, 248, 251, 252, 82, 253, 83, 254, + 85, 27, 86, 255, 256, 0, 0, 75, 84, 65, + 18, 241, 0, 0, 0, 0, 0, 0, 239, 0, + 0, 0, 0, 240, 0, 62, 63, 64, 242, 0, + 0, 0, 0, 0, 0, 243, 244, 0, 0, 0, + 0, 0, 0, 245, 246, 0, 0, 247, 69, 0, + 70, 0, 0, 0, 71, 0, 72, 73, 74, 0, + 0, 76, 0, 0, 0, 77, 0, 78, 0, 0, + 0, 0, 0, 249, 0, 250, 0, 0, 0, 81, + 248, 251, 252, 82, 253, 83, 254, 85, 27, 86, + 255, 256, 0, 0, 75, 84, 65, 18, 241, 0, + 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, + 240, 0, 62, 63, 64, 242, 0, 0, 0, 0, + 0, 0, 243, 66, 0, 0, 0, 0, 0, 0, + 534, 246, 0, 0, 247, 535, 0, 70, 0, 0, + 0, 71, 0, 72, 73, 74, 0, 0, 76, 0, + 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, + 249, 0, 250, 0, 0, 0, 81, 248, 251, 252, + 82, 253, 83, 254, 85, 27, 86, 255, 256, 0, + 0, 75, 84, 65, 18, 241, 0, 0, 0, 0, + 0, 0, 239, 0, 0, 0, 0, 240, 0, 62, + 63, 64, 242, 0, 0, 0, 0, 0, 0, 243, + 66, 0, 0, 0, 0, 0, 0, 519, 246, 0, + 0, 247, 520, 0, 70, 0, 0, 0, 71, 0, + 72, 73, 74, 0, 0, 76, 0, 0, 0, 77, + 0, 78, 0, 0, 0, 0, 0, 249, 0, 250, + 0, 0, 0, 81, 248, 251, 252, 82, 253, 83, + 254, 85, 27, 86, 255, 256, 0, 0, 75, 84, + 65, 18, 241, 0, 521, 0, 0, 0, 0, 388, + 140, 141, 0, 0, 390, 145, 392, 63, 64, 393, + 0, 148, 0, 0, 0, 150, 395, 396, 0, 0, + 0, 0, 0, 0, 397, 398, 154, 155, 247, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 399, 74, + 0, 0, 401, 0, 0, 0, 77, 0, 78, 0, + -238, 0, 0, 0, 403, 0, 250, 0, 0, 0, + 405, 402, 404, 406, 407, 408, 83, 410, 411, 412, + 413, 414, 415, 0, 0, 400, 409, 394, 389, 391, + 158, 0, 0, 0, 0, 0, - 455, 534, 521, 452, 493, 199, 465, 173, 488, 539, - 42, 445, 359, 322, 211, 209, 449, 470, 31, 480, - 273, 531, 487, 192, 491, 194, 511, 540, 476, 515, - 467, 469, 456, 526, 459, 474, 205, 420, 435, 10, - 412, 163, 373, 169, 371, 546, 410, 369, 205, 270, - 322, 166, 171, 422, 456, 258, 263, 367, 430, 270, - 331, 340, 327, 329, 358, 459, 186, 437, 263, 453, - 354, 501, 0, 356, 258, 0, 83, 340, 540, 169, - 26, 12, 209, 322, 525, 322, 201, 322, 123, 0, - 322, 424, 12, 0, 425, 129, 83, 0, 203, 230, - 83, 83, 223, 0, 131, 113, 83, 0, 83, 0, - 125, 84, 121, 478, 83, 83, 497, 498, 83, 424, - 83, 0, 425, 83, 100, 496, 119, 323, 83, 325, - 83, 350, 495, 308, 352, 83, 83, 499, 471, 0, - 550, 349, 83, 83, 472, 90, 83, 169, 91, 83, - 83, 500, 92, 83, 427, 83, 0, 83, 361, 120, - 107, 111, 83, 83, 83, 471, 83, 304, 112, 93, - 83, 83, 83, 83, 83, 307, 305, 306, 83, 83, - 83, 286, 83, 116, 114, 115, 290, 117, 188, 191, - 83, 83, 472, 203, 83, 535, 83, 0, 525, 118, - 83, 290, 529, 0, 525, 318, 12, 0, 95, 83, - 290, 0, 12, 336, 290, 83, 230, 0, 318, 223, - 290, 0, 313, 290, 318, 318, 315, 317, 83, 290, - 290, 83, 83, 290, 505, 0, 290, 290, 311, 310, - 320, 507, 0, 333, 507, 0, 339, 346, 129, 26, - 12, 0, 26, 12, 318, 26, 12, 131, 198, 290, - 83, 83, 0, 0, 0, 290, 290, 230, 309, 293, - 223, 0, 83, 0, 0, 0, 337, 290, 0, 298, + 474, 476, 10, 500, 477, 459, 460, 456, 193, 472, + 462, 12, 265, 548, 212, 180, 512, 481, 218, 38, + 524, 366, 542, 466, 508, 329, 17, 216, 518, 533, + 541, 487, 49, 483, 463, 466, 452, 498, 485, 270, + 206, 237, 494, 277, 536, 0, 0, 463, 199, 0, + 201, 495, 347, 178, 170, 427, 265, 176, 429, 380, + 173, 270, 378, 374, 417, 365, 376, 419, 363, 442, + 334, 338, 212, 347, 336, 444, 437, 361, 277, 90, + 237, 329, 90, 120, 280, 329, 0, 313, 0, 237, + 431, 531, 542, 432, 329, 329, 329, 90, 0, 0, + 136, 17, 314, 90, 537, 210, 90, 90, 90, 138, + 90, 315, 118, 90, 216, 17, 176, 176, 125, 130, + 132, 90, 90, 208, 434, 100, 90, 128, 431, 332, + 293, 432, 0, 90, 102, 297, 91, 356, 330, 357, + 359, 90, 90, 210, 99, 90, 90, 505, 98, 90, + 90, 506, 504, 90, 552, 479, 90, 90, 503, 478, + 90, 90, 371, 502, 90, 90, 507, 97, 90, 90, + 478, 90, 90, 90, 195, 119, 264, 122, 121, 90, + 90, 0, 90, 90, 114, 198, 127, 124, 90, 107, + 368, 90, 90, 311, 479, 90, 123, 90, 325, 325, + 136, 126, 297, 297, 297, 0, 90, 90, 0, 138, + 205, 297, 297, 90, 343, 0, 0, 0, 297, 320, + 344, 346, 340, 325, 322, 90, 90, 0, 297, 90, + 297, 297, 316, 318, 297, 90, 317, 0, 90, 90, + 297, 325, 305, 312, 297, 353, 297, 28, 300, 0, + 0, 0, 28, 31, 515, 0, 0, 0, 31, 16, + 33, 17, 0, 324, 16, 33, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, + 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 257, 0}; + 0, 0}; const int JavaScriptGrammar::action_check [] = { - 36, 36, 7, 7, 7, 7, 7, 36, 33, 7, - 7, 7, 7, 7, 7, 7, 31, 17, 2, 1, - 48, 8, 60, 8, 61, 55, 36, 61, 60, 55, - 36, 2, 55, 16, 33, 8, 60, 7, 29, 48, - 29, 7, 1, 29, 0, 33, 36, 65, 88, 17, - 8, 78, 60, 33, 66, 36, 8, 78, 33, 7, - 20, 8, 7, 2, 33, 8, 8, 8, 33, 36, - 48, 78, 36, 36, 36, 36, 33, 7, 55, 7, - 7, 60, 36, 55, 60, 36, 2, 61, 1, 33, - 36, 1, -1, 8, 8, 48, 8, 8, 6, 8, - -1, 8, 8, -1, 40, 40, 8, 10, 7, 8, - 5, 60, 20, 50, 8, 51, 51, 54, 8, 7, - 60, 8, 8, 78, 8, -1, 76, 61, 62, 61, - 62, 7, 61, 62, 7, 61, 62, 61, 62, 15, - 8, 7, 15, 12, 40, 33, 60, -1, 60, 60, - 88, 60, 55, 60, 60, 51, 61, 62, 60, 29, - 42, -1, 56, 61, 62, 40, 56, 33, 29, 56, - 56, 53, 56, 29, 8, -1, 51, 8, 61, 62, - 29, -1, 15, 29, 25, 29, 27, 29, 57, 25, - -1, 27, 60, -1, 63, -1, 50, 38, -1, -1, - 54, 34, 38, 36, 74, 66, 67, 29, -1, 29, - 66, 67, 25, 29, 27, 85, 8, 66, 67, 15, - 66, 67, 66, 67, 29, 38, 29, 61, 62, 12, - 61, 62, 74, 12, 29, 15, -1, 8, 34, 25, - 36, 27, -1, 85, 66, 67, 66, 67, 29, -1, - 66, 67, 38, 25, 34, 27, 36, -1, -1, -1, - 29, 66, 67, 66, 67, -1, 38, 18, 19, 61, - 62, 66, 67, 29, 57, 18, 19, -1, 57, -1, - 63, 18, 19, -1, 63, 66, 67, 18, 19, 29, - 61, -1, 61, 62, 45, 46, 36, 66, 67, 29, - -1, -1, 45, 46, -1, 61, 62, 29, 45, 46, - 66, 67, -1, -1, 45, 46, 23, 24, -1, 29, - 25, -1, 27, -1, -1, 32, 66, 67, 35, 59, - 37, -1, -1, 38, 23, 24, 66, 67, -1, 61, - 62, -1, 31, 32, 66, 67, 35, -1, 37, -1, - 8, 61, 62, 23, 24, 85, 66, 67, -1, -1, - 8, 31, 32, -1, -1, 35, 10, 37, 23, 24, - -1, 29, 10, -1, -1, -1, 31, 32, 22, -1, - 35, 29, 37, -1, 22, 29, 23, 24, -1, -1, - -1, 29, -1, -1, -1, 32, -1, -1, 35, -1, - 37, 59, -1, -1, -1, -1, -1, -1, 66, 67, - -1, 59, -1, -1, -1, 59, -1, -1, 66, 67, - -1, 59, 66, 67, -1, -1, -1, 85, 66, 67, - 74, 10, -1, -1, 10, -1, 74, 85, -1, 83, - -1, 85, -1, 22, -1, 83, 22, 85, -1, -1, - 29, -1, -1, 29, 23, 24, -1, -1, -1, -1, - -1, -1, 31, 32, -1, -1, 35, -1, 37, -1, - -1, -1, -1, -1, -1, -1, 55, -1, -1, 55, - 59, -1, -1, 59, -1, -1, -1, 66, 67, 3, - 66, 67, -1, -1, -1, 74, -1, -1, 74, 13, - -1, -1, -1, 17, 83, -1, 85, 83, -1, 85, - -1, -1, 26, -1, 28, -1, -1, 31, -1, -1, - -1, -1, 3, -1, -1, 39, -1, 41, 42, -1, - -1, -1, 13, -1, -1, 49, 17, -1, 52, 53, - -1, -1, -1, -1, 58, 26, -1, 28, -1, -1, - 64, -1, -1, -1, -1, -1, -1, -1, 39, -1, - 41, 42, -1, -1, -1, 79, -1, -1, 49, -1, - -1, 52, 53, -1, -1, -1, -1, 58, -1, -1, - -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, + 48, 5, 55, 36, 7, 61, 17, 2, 7, 7, + 7, 5, 5, 78, 2, 7, 1, 8, 7, 61, + 20, 33, 60, 36, 29, 8, 36, 36, 7, 7, + 55, 55, 55, 7, 36, 7, 7, 33, 8, 8, + 16, 60, 17, 7, 31, 8, 36, 7, 76, 33, + 36, 33, 60, 33, 60, 36, 8, 2, 7, 7, + 61, 88, 0, 36, 7, 7, 88, 33, 2, 1, + 7, 36, 8, 8, 1, 36, 33, 36, 36, 29, + 36, 36, 8, 60, 1, 8, 33, 33, 55, 29, + 29, 7, 60, 8, 48, -1, 8, 7, 60, 15, + 7, 10, 8, 8, 8, 8, 8, 60, 15, 7, + -1, 8, 7, 8, 6, 66, -1, 48, 48, 40, + 40, 65, 50, 33, 8, 8, 54, 7, 20, 8, + 51, 51, 61, 62, 8, 33, 8, 78, 8, 61, + 62, 56, 61, 62, 56, 78, 55, 61, 62, 42, + 56, 56, 12, 40, 56, -1, 60, 60, -1, 15, + 53, 61, 62, 60, 51, 61, 62, 61, 62, 50, + 61, 62, 40, 54, -1, 29, 60, 60, 34, 29, + 36, 60, 25, 51, 27, 25, 60, 27, 60, -1, + 12, 61, 62, -1, 25, 38, 27, 57, 38, 12, + -1, 29, 25, 63, 27, 29, 25, 38, 27, 15, + -1, 8, 66, 67, 8, 38, 66, 67, 25, 38, + 27, 25, -1, 27, 25, 25, 27, 27, 34, -1, + 36, 38, 15, 29, 38, 57, 29, 38, 38, 29, + -1, 63, 66, 67, 57, 29, 74, 29, 8, 29, + 63, 34, 29, 36, 29, 29, 25, 85, 27, -1, + -1, 29, -1, -1, 61, -1, -1, 61, 62, 38, + 66, 67, -1, 66, 67, -1, 66, 67, 18, 19, + -1, 29, 66, 67, 66, 67, 66, 67, 36, 66, + 67, 66, 67, -1, 25, 29, 27, -1, 66, 67, + 74, 61, 62, 18, 19, 45, 46, 38, 29, -1, + 29, 85, 23, 24, -1, -1, -1, -1, 66, 67, + -1, 32, -1, -1, 35, -1, 37, 61, 62, -1, + 45, 46, 66, 67, -1, -1, -1, -1, 59, -1, + 23, 24, 61, 62, -1, 66, 67, 66, 67, 32, + -1, -1, 35, 29, 37, -1, 23, 24, -1, -1, + 18, 19, 23, 24, 85, 32, 29, -1, 35, -1, + 37, 32, -1, -1, 35, -1, 37, -1, -1, -1, + -1, -1, -1, -1, -1, 61, 62, 45, 46, -1, + 66, 67, 8, 23, 24, -1, -1, -1, 61, 62, + -1, 31, 32, 66, 67, 35, -1, 37, 23, 24, + -1, -1, -1, 29, 8, -1, 31, 32, 23, 24, + 35, -1, 37, -1, -1, 10, 31, 32, -1, -1, + 35, -1, 37, 23, 24, 29, -1, 22, -1, -1, + -1, -1, 32, 59, 29, 35, -1, 37, 10, -1, + 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, 59, -1, 29, -1, 85, + 55, -1, 66, 67, 59, -1, -1, -1, -1, -1, + -1, 66, 67, -1, -1, -1, -1, -1, -1, 74, + -1, 85, -1, 55, -1, -1, -1, 59, 83, -1, + 85, 23, 24, -1, 66, 67, 3, -1, -1, 31, + 32, -1, 74, 35, -1, 37, 13, -1, -1, -1, + 17, 83, -1, 85, -1, -1, -1, -1, -1, 26, + -1, 28, -1, -1, 31, -1, -1, -1, -1, -1, + -1, -1, 39, -1, 41, 42, -1, -1, -1, -1, + -1, -1, 49, -1, -1, 52, 53, -1, -1, -1, + -1, 58, -1, -1, -1, -1, -1, 64, -1, 3, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, + -1, -1, 79, 17, -1, -1, -1, -1, -1, -1, + -1, -1, 26, -1, 28, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 39, -1, 41, 42, -1, + -1, -1, -1, -1, -1, 49, -1, -1, 52, 53, + -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, -1, -1, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, + 65, 66, 67, -1, 69, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 80, 81, 82, -1, -1, + -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, 67, -1, 69, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 80, 81, - 82, -1, -1, -1, -1, -1, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, 67, -1, 69, -1, 71, - -1, 73, -1, 75, -1, -1, -1, -1, 80, 81, - 82, -1, -1, -1, -1, -1, -1, -1, -1, 7, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, -1, 71, -1, 73, -1, 75, -1, -1, - -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, -1, 71, -1, 73, 74, 75, -1, -1, - -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, 56, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, -1, 71, -1, 73, -1, 75, -1, -1, - -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, 56, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, -1, 71, -1, 73, -1, 75, -1, -1, - -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, - -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, - 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, - 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, - 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, - -1, -1, -1, -1, -1, 66, 67, 68, 69, 70, - -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, - 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, + 65, 66, 67, -1, 69, -1, 71, -1, 73, -1, + 75, -1, -1, -1, -1, 80, 81, 82, -1, -1, + -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, 67, -1, 69, -1, 71, -1, 73, 74, + 75, -1, -1, -1, -1, 80, 81, 82, -1, -1, + -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, + 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, + 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, 56, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, + 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, + 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, 56, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, + 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, + 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, - -1, 65, 66, 67, 68, 69, 70, -1, 72, 73, + -1, -1, 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, - 47, -1, -1, -1, -1, -1, -1, -1, 55, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, -1, - -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, - -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, - -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, - 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, -1, -1, -1, -1, 59, - -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, - 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, + 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, + 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, + 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, + -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, + -1, -1, -1, -1, -1, 65, 66, 67, 68, 69, + 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, + 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, @@ -696,51 +699,62 @@ const int JavaScriptGrammar::action_check [] = { -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, - -1, 80, 81, 82, 83, 84, -1, 86, -1, -1, - -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, - 12, 13, 14, -1, 16, -1, -1, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, + -1, 80, 81, 82, 83, 84, -1, -1, -1, -1, + -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, + 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, + 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, + -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, 55, -1, -1, -1, 59, -1, 61, + -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, - 82, 83, 84, 85, -1, -1, -1, -1, -1, + 82, 83, 84, -1, 86, -1, -1, -1, -1, 4, + 5, 6, -1, -1, 9, 10, 11, 12, 13, 14, + -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, + 55, -1, -1, -1, 59, -1, 61, -1, -1, -1, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, + 85, -1, -1, -1, -1, -1, - 76, 9, 9, 76, 15, 15, 93, 58, 24, 18, - 15, 91, 18, 15, 18, 18, 88, 62, 14, 13, - 15, 13, 20, 24, 24, 24, 15, 18, 13, 13, - 18, 62, 15, 9, 62, 15, 18, 24, 13, 5, - 26, 15, 13, 24, 13, 24, 24, 15, 18, 13, - 15, 24, 24, 13, 15, 18, 18, 13, 13, 13, - 13, 18, 13, 15, 13, 62, 24, 15, 18, 15, - 13, 18, -1, 15, 18, -1, 35, 18, 18, 24, - 17, 18, 18, 15, 10, 15, 31, 15, 47, -1, - 15, 29, 18, -1, 32, 18, 35, -1, 37, 13, - 35, 35, 16, -1, 27, 39, 35, -1, 35, -1, - 45, 38, 41, 15, 35, 35, 37, 37, 35, 29, - 35, -1, 32, 35, 41, 37, 41, 59, 35, 59, - 35, 59, 37, 40, 59, 35, 35, 37, 37, -1, - 80, 82, 35, 35, 37, 37, 35, 24, 37, 35, - 35, 37, 37, 35, 31, 35, -1, 35, 94, 41, - 40, 39, 35, 35, 35, 37, 35, 40, 39, 38, - 35, 35, 35, 35, 35, 40, 40, 40, 35, 35, - 35, 35, 35, 40, 40, 40, 40, 40, 49, 51, - 35, 35, 37, 37, 35, 7, 35, -1, 10, 40, - 35, 40, 8, -1, 10, 35, 18, -1, 43, 35, - 40, -1, 18, 52, 40, 35, 13, -1, 35, 16, - 40, -1, 48, 40, 35, 35, 46, 57, 35, 40, - 40, 35, 35, 40, 2, -1, 40, 40, 42, 42, - 57, 6, -1, 50, 6, -1, 57, 57, 18, 17, - 18, -1, 17, 18, 35, 17, 18, 27, 28, 40, - 35, 35, -1, -1, -1, 40, 40, 13, 42, 44, - 16, -1, 35, -1, -1, -1, 57, 40, -1, 42, + 20, 64, 5, 17, 64, 78, 17, 90, 26, 95, + 78, 6, 20, 26, 20, 60, 17, 17, 20, 16, + 11, 20, 20, 64, 20, 17, 20, 20, 15, 15, + 20, 15, 17, 15, 17, 64, 93, 26, 17, 20, + 17, 15, 22, 15, 11, -1, -1, 17, 26, -1, + 26, 26, 20, 26, 17, 26, 20, 26, 15, 15, + 26, 20, 15, 15, 26, 15, 17, 28, 17, 15, + 15, 15, 20, 20, 17, 17, 15, 15, 15, 37, + 15, 17, 37, 41, 17, 17, -1, 42, -1, 15, + 31, 10, 20, 34, 17, 17, 17, 37, -1, -1, + 20, 20, 42, 37, 9, 39, 37, 37, 37, 29, + 37, 42, 41, 37, 20, 20, 26, 26, 42, 49, + 47, 37, 37, 33, 33, 40, 37, 43, 31, 61, + 37, 34, -1, 37, 45, 42, 40, 84, 61, 61, + 61, 37, 37, 39, 39, 37, 37, 39, 39, 37, + 37, 39, 39, 37, 82, 39, 37, 37, 39, 39, + 37, 37, 97, 39, 37, 37, 39, 39, 37, 37, + 39, 37, 37, 37, 51, 41, 102, 42, 42, 37, + 37, -1, 37, 37, 42, 53, 43, 42, 37, 43, + 96, 37, 37, 42, 39, 37, 42, 37, 37, 37, + 20, 43, 42, 42, 42, -1, 37, 37, -1, 29, + 30, 42, 42, 37, 54, -1, -1, -1, 42, 50, + 59, 59, 52, 37, 48, 37, 37, -1, 42, 37, + 42, 42, 44, 44, 42, 37, 44, -1, 37, 37, + 42, 37, 44, 42, 42, 59, 42, 6, 46, -1, + -1, -1, 6, 12, 8, -1, -1, -1, 12, 18, + 19, 20, -1, 59, 18, 19, 20, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, + 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 100, -1}; + -1, -1}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index c01d1cc..3b98238 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -150,15 +150,15 @@ public: T_XOR = 78, T_XOR_EQ = 79, - ACCEPT_STATE = 551, - RULE_COUNT = 315, - STATE_COUNT = 552, + ACCEPT_STATE = 553, + RULE_COUNT = 317, + STATE_COUNT = 554, TERMINAL_COUNT = 91, - NON_TERMINAL_COUNT = 102, + NON_TERMINAL_COUNT = 104, - GOTO_INDEX_OFFSET = 552, - GOTO_INFO_OFFSET = 1789, - GOTO_CHECK_OFFSET = 1789 + GOTO_INDEX_OFFSET = 554, + GOTO_INFO_OFFSET = 1836, + GOTO_CHECK_OFFSET = 1836 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 897f0ce..0857eef 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -199,51 +199,55 @@ case 8: { } break; case 9: { + sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); +} break; + +case 10: { AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; -case 10: { +case 11: { sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); } break; -case 11: { +case 12: { AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMemberList, sym(3).UiObjectMember); sym(1).Node = node; } break; -case 12: { +case 13: { AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0); node->lbraceToken = loc(1); node->rbraceToken = loc(2); sym(1).Node = node; } break; -case 13: { +case 14: { AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; - case 14: -case 15: { + case 15: +case 16: { AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; - case 16: + case 17: { AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; - case 18: -case 19: { + case 20: +case 21: { AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -252,33 +256,33 @@ case 19: { sym(1).Node = node; } break; -case 20: { +case 22: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 24: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; - case 23: case 24: -case 25: { + case 25: case 26: +case 27: { AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 26: +case 28: -case 27: { +case 29: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); break; } -case 29: { +case 31: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (JavaScriptNameIdImpl *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -287,7 +291,7 @@ case 29: { sym(1).Node = node; } break; -case 30: { +case 32: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -295,7 +299,7 @@ case 30: { sym(1).Node = node; } break; -case 31: { +case 33: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -305,7 +309,7 @@ case 31: { sym(1).Node = node; } break; -case 32: { +case 34: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -315,7 +319,7 @@ case 32: { sym(1).Node = node; } break; -case 33: { +case 35: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -327,126 +331,124 @@ case 33: { sym(1).Node = node; } break; -case 34: { +case 36: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 35: { +case 37: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 36: -case 37: +case 38: +case 39: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 39: { +case 41: { QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 40: { +case 42: { QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 41: { +case 43: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 42: { +case 44: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 43: { +case 45: { AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 44: { +case 46: { AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 45: { +case 47: { AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 48: { AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 49: { AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 48: { +case 50: { AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 49: { +case 51: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 50: { +case 52: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; // ### remove me } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); sym(1).Node = node; } break; -case 51: { +case 53: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); sym(1).Node = node; } break; -case 52: { +case 54: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 53: { +case 55: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 54: { +case 56: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -454,7 +456,7 @@ case 54: { sym(1).Node = node; } break; -case 55: { +case 57: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), @@ -466,7 +468,7 @@ case 55: { sym(1).Node = node; } break; -case 56: { +case 58: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -474,51 +476,51 @@ case 56: { sym(1).Node = node; } break; -case 57: { +case 59: { AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 58: { +case 60: { sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 59: { +case 61: { AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 60: { +case 62: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 61: { +case 63: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 62: { +case 64: { sym(1).Node = 0; } break; -case 63: { +case 65: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 64: { +case 66: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 65: { +case 67: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -526,40 +528,36 @@ case 65: { sym(1).Node = node; } break; -case 66: { +case 68: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 67: -case 68: { +case 69: +case 70: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 69: { +case 71: { AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 70: { +case 72: { AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 71: { +case 73: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 72: - -case 73: - case 74: case 75: @@ -617,25 +615,29 @@ case 100: case 101: case 102: + +case 103: + +case 104: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 107: { +case 109: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 108: { +case 110: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 109: { +case 111: { AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -643,316 +645,309 @@ case 109: { sym(1).Node = node; } break; -case 111: { +case 113: { AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 112: { +case 114: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 113: { +case 115: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 114: { +case 116: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 115: { +case 117: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 116: { +case 118: { sym(1).Node = 0; } break; -case 117: { +case 119: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 118: { +case 120: { sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression); } break; -case 119: { +case 121: { AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 123: { +case 125: { AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 124: { +case 126: { AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 126: { +case 128: { AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 127: { +case 129: { AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 128: { +case 130: { AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 129: { +case 131: { AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 130: { +case 132: { AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 131: { +case 133: { AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 132: { +case 134: { AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 133: { +case 135: { AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 136: { AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 136: { +case 138: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 137: { +case 139: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 138: { +case 140: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 142: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 141: { +case 143: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 145: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 144: { +case 146: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 147: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 149: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 148: { +case 150: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 151: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 152: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { +case 153: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 154: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 156: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 155: { +case 157: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 158: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 157: { +case 159: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 160: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 162: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 161: { +case 163: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 164: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 165: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 167: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +case 168: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +case 169: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { - AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::StrictNotEqual, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - case 170: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -966,7 +961,7 @@ case 172: { case 174: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -980,7 +975,7 @@ case 176: { case 178: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -994,7 +989,7 @@ case 180: { case 182: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1008,7 +1003,7 @@ case 184: { case 186: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1021,6 +1016,13 @@ case 188: { } break; case 190: { + AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 192: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1028,7 +1030,7 @@ case 190: { sym(1).Node = node; } break; -case 192: { +case 194: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1036,112 +1038,112 @@ case 192: { sym(1).Node = node; } break; -case 194: { +case 196: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 196: { +case 198: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 197: { +case 199: { sym(1).ival = QSOperator::Assign; } break; -case 198: { +case 200: { sym(1).ival = QSOperator::InplaceMul; } break; -case 199: { +case 201: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 200: { +case 202: { sym(1).ival = QSOperator::InplaceMod; } break; -case 201: { +case 203: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 202: { +case 204: { sym(1).ival = QSOperator::InplaceSub; } break; -case 203: { +case 205: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 204: { +case 206: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 205: { +case 207: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 206: { +case 208: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 207: { +case 209: { sym(1).ival = QSOperator::InplaceXor; } break; -case 208: { +case 210: { sym(1).ival = QSOperator::InplaceOr; } break; -case 210: { +case 212: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 211: { +case 213: { sym(1).Node = 0; } break; -case 214: { +case 216: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 215: { +case 217: { sym(1).Node = 0; } break; -case 232: { +case 234: { AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 233: { +case 235: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement); } break; -case 234: { +case 236: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 235: { +case 237: { sym(1).Node = 0; } break; -case 236: { +case 238: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 238: { +case 240: { AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1149,76 +1151,76 @@ case 238: { sym(1).Node = node; } break; -case 239: { +case 241: { sym(1).ival = T_CONST; } break; -case 240: { +case 242: { sym(1).ival = T_VAR; } break; -case 241: { +case 243: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 242: { +case 244: { AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 243: { +case 245: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 244: { +case 246: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 245: { +case 247: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 246: { +case 248: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 247: { +case 249: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 248: { +case 250: { sym(1).Node = 0; } break; -case 250: { +case 252: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 251: { +case 253: { sym(1).Node = 0; } break; -case 253: { +case 255: { AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 255: { +case 257: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 256: { +case 258: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1227,7 +1229,7 @@ case 256: { sym(1).Node = node; } break; -case 257: { +case 259: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1235,7 +1237,7 @@ case 257: { sym(1).Node = node; } break; -case 259: { +case 261: { AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1245,7 +1247,7 @@ case 259: { sym(1).Node = node; } break; -case 260: { +case 262: { AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1253,7 +1255,7 @@ case 260: { sym(1).Node = node; } break; -case 261: { +case 263: { AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1264,7 +1266,7 @@ case 261: { sym(1).Node = node; } break; -case 262: { +case 264: { AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1277,7 +1279,7 @@ case 262: { sym(1).Node = node; } break; -case 263: { +case 265: { AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1287,7 +1289,7 @@ case 263: { sym(1).Node = node; } break; -case 264: { +case 266: { AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1298,14 +1300,14 @@ case 264: { sym(1).Node = node; } break; -case 266: { +case 268: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 268: { +case 270: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1313,14 +1315,14 @@ case 268: { sym(1).Node = node; } break; -case 270: { +case 272: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 272: { +case 274: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1328,14 +1330,14 @@ case 272: { sym(1).Node = node; } break; -case 274: { +case 276: { AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 275: { +case 277: { AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1343,7 +1345,7 @@ case 275: { sym(1).Node = node; } break; -case 276: { +case 278: { AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1351,90 +1353,90 @@ case 276: { sym(1).Node = node; } break; -case 277: { +case 279: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 278: { +case 280: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 279: { +case 281: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause); } break; -case 280: { +case 282: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 281: { +case 283: { sym(1).Node = 0; } break; -case 282: { +case 284: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 283: { +case 285: { AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 284: { +case 286: { AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 285: -case 286: { +case 287: +case 288: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 287: { +case 289: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 289: { +case 291: { AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 290: { +case 292: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 291: { +case 293: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 292: { +case 294: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 293: { +case 295: { AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1443,20 +1445,20 @@ case 293: { sym(1).Node = node; } break; -case 294: { +case 296: { AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 296: { +case 298: { AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 297: { +case 299: { AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1467,7 +1469,7 @@ case 297: { sym(1).Node = node; } break; -case 298: { +case 300: { AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1479,56 +1481,56 @@ case 298: { sym(1).Node = node; } break; -case 299: { +case 301: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 300: { +case 302: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 301: { +case 303: { sym(1).Node = 0; } break; -case 302: { +case 304: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 303: { +case 305: { sym(1).Node = 0; } break; -case 305: { +case 307: { sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 306: { +case 308: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement); } break; -case 307: { +case 309: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 308: { +case 310: { sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement); } break; -case 309: { +case 311: { sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 310: { +case 312: { sym(1).sval = 0; } break; -case 312: { +case 314: { sym(1).Node = 0; } break; @@ -1552,10 +1554,8 @@ case 312: { yylloc.startColumn += yylloc.length; yylloc.length = 0; - const QString msg = QString::fromUtf8("Missing `;'"); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, - yylloc.startLine, yylloc.startColumn, msg)); + //const QString msg = QString::fromUtf8("Missing `;'"); + //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; last_token = &token_buffer[1]; @@ -1581,8 +1581,7 @@ case 312: { if (t_action(errorState, yytoken)) { const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; goto _Lcheck_token; @@ -1611,8 +1610,7 @@ case 312: { if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; yylval = 0; @@ -1634,8 +1632,7 @@ case 312: { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; yylval = 0; @@ -1648,8 +1645,7 @@ case 312: { } const QString msg = QString::fromUtf8("Syntax error"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } return false; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 497fae8..5e68fe7 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -119,10 +119,10 @@ public: enum Kind { Warning, Error }; DiagnosticMessage() - : kind(Error), line(0), column(0) {} + : kind(Error) {} - DiagnosticMessage(Kind kind, int line, int column, const QString &message) - : kind(kind), line(line), column(column), message(message) {} + DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} bool isWarning() const { return kind == Warning; } @@ -131,8 +131,7 @@ public: { return kind == Error; } Kind kind; - int line; - int column; + JavaScript::AST::SourceLocation loc; QString message; }; @@ -162,10 +161,10 @@ public: { return diagnosticMessage().message; } inline int errorLineNumber() const - { return diagnosticMessage().line; } + { return diagnosticMessage().loc.startLine; } inline int errorColumnNumber() const - { return diagnosticMessage().column; } + { return diagnosticMessage().loc.startColumn; } protected: void reallocateStack(); @@ -206,9 +205,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 50 +#define J_SCRIPT_REGEXPLITERAL_RULE1 52 -#define J_SCRIPT_REGEXPLITERAL_RULE2 51 +#define J_SCRIPT_REGEXPLITERAL_RULE2 53 QT_END_NAMESPACE diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 5198264..99e30e4 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -29,6 +29,7 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlvmemetaobject_p.h \ qml/qml.h \ qml/qmlbindablevalue.h \ + qml/qmlbindablevalue_p.h \ qml/qmlmetaproperty.h \ qml/qmlcomponent.h \ qml/qmlcomponent_p.h \ diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index b312b40..3950f82 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -41,6 +41,7 @@ #include <qml.h> #include "qmlbindablevalue.h" +#include "qmlbindablevalue_p.h" #include <qmlcontext.h> #include <QVariant> #include <qfxperf.h> @@ -50,20 +51,25 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(scriptWarnings, QML_SCRIPT_WARNINGS); +QmlBindableValuePrivate::QmlBindableValuePrivate() +: inited(false) +{ +} + QML_DEFINE_NOCREATE_TYPE(QmlBindableValue); QmlBindableValue::QmlBindableValue(QObject *parent) -: QmlPropertyValueSource(parent), _inited(false) +: QmlPropertyValueSource(*new QmlBindableValuePrivate, parent) { qFatal("QmlBindableValue: Default constructor not supported"); } QmlBindableValue::QmlBindableValue(void *data, QmlRefCount *rc, QObject *obj, QObject *parent) -: QmlPropertyValueSource(parent), QmlExpression(QmlContext::activeContext(), data, rc, obj), _inited(false) +: QmlPropertyValueSource(*new QmlBindableValuePrivate, parent), QmlExpression(QmlContext::activeContext(), data, rc, obj) { } QmlBindableValue::QmlBindableValue(const QString &str, QObject *obj, bool sse, QObject *parent) -: QmlPropertyValueSource(parent), QmlExpression(QmlContext::activeContext(), str, obj, sse), _inited(false) +: QmlPropertyValueSource(*new QmlBindableValuePrivate, parent), QmlExpression(QmlContext::activeContext(), str, obj, sse) { } @@ -73,16 +79,25 @@ QmlBindableValue::~QmlBindableValue() void QmlBindableValue::setTarget(const QmlMetaProperty &prop) { - _property = prop; + Q_D(QmlBindableValue); + d->property = prop; update(); } +QmlMetaProperty QmlBindableValue::property() const +{ + Q_D(const QmlBindableValue); + return d->property; +} + void QmlBindableValue::init() { - if (_inited) + Q_D(QmlBindableValue); + + if (d->inited) return; - _inited = true; + d->inited = true; update(); } @@ -95,20 +110,22 @@ void QmlBindableValue::setExpression(const QString &expr) Q_DECLARE_METATYPE(QList<QObject *>); void QmlBindableValue::update() { + Q_D(QmlBindableValue); + #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer<QFxPerf::BindableValueUpdate> bu; #endif - if (!_inited) + if (!d->inited) return; - if (_property.propertyCategory() == QmlMetaProperty::List) { + if (d->property.propertyCategory() == QmlMetaProperty::List) { QVariant value = this->value(); - int listType = QmlMetaType::listType(_property.propertyType()); + int listType = QmlMetaType::listType(d->property.propertyType()); if (value.userType() == qMetaTypeId<QList<QObject *> >()) { const QList<QObject *> &list = qvariant_cast<QList<QObject *> >(value); - QVariant listVar = _property.read(); + QVariant listVar = d->property.read(); QmlMetaType::clear(listVar); for (int ii = 0; ii < list.count(); ++ii) { QVariant v = QmlMetaType::fromObject(list.at(ii), listType); @@ -117,14 +134,14 @@ void QmlBindableValue::update() } else if (value.type() == uint(listType) || value.userType() == listType) { - QVariant listVar = _property.read(); + QVariant listVar = d->property.read(); QmlMetaType::clear(listVar); QmlMetaType::append(listVar, value); } - } else if (_property.propertyCategory() == QmlMetaProperty::QmlList) { + } else if (d->property.propertyCategory() == QmlMetaProperty::QmlList) { // XXX - optimize! QVariant value = this->value(); - QVariant list = _property.read(); + QVariant list = d->property.read(); QmlPrivate::ListInterface *li = *(QmlPrivate::ListInterface **)list.constData(); @@ -153,20 +170,20 @@ void QmlBindableValue::update() void *d = (void *)&obj; li->append(d); } - } else if (_property.propertyCategory() == QmlMetaProperty::Bindable) { + } else if (d->property.propertyCategory() == QmlMetaProperty::Bindable) { // NOTE: We assume that only core properties can have // propertyType == Bindable - int idx = _property.coreIndex(); + int idx = d->property.coreIndex(); Q_ASSERT(idx != -1); void *a[1]; QmlBindableValue *t = this; a[0] = (void *)&t; - _property.object()->qt_metacall(QMetaObject::WriteProperty, - idx, a); + d->property.object()->qt_metacall(QMetaObject::WriteProperty, + idx, a); - } else if (_property.propertyCategory() == QmlMetaProperty::Object) { + } else if (d->property.propertyCategory() == QmlMetaProperty::Object) { QVariant value = this->value(); if ((int)value.type() != qMetaTypeId<QObject *>()) { @@ -186,17 +203,17 @@ void QmlBindableValue::update() // NOTE: We assume that only core properties can have // propertyType == Object - int idx = _property.coreIndex(); + int idx = d->property.coreIndex(); Q_ASSERT(idx != -1); void *a[1]; a[0] = (void *)&obj; - _property.object()->qt_metacall(QMetaObject::WriteProperty, + d->property.object()->qt_metacall(QMetaObject::WriteProperty, idx, a); - } else if (_property.propertyCategory() == QmlMetaProperty::Normal) { + } else if (d->property.propertyCategory() == QmlMetaProperty::Normal) { QVariant value = this->value(); - _property.write(value); + d->property.write(value); } } diff --git a/src/declarative/qml/qmlbindablevalue.h b/src/declarative/qml/qmlbindablevalue.h index 578fc12..c4ef64a 100644 --- a/src/declarative/qml/qmlbindablevalue.h +++ b/src/declarative/qml/qmlbindablevalue.h @@ -56,6 +56,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QmlExpression; class QmlContext; +class QmlBindableValuePrivate; class Q_DECLARATIVE_EXPORT QmlBindableValue : public QmlPropertyValueSource, public QmlExpression { @@ -67,7 +68,7 @@ public: ~QmlBindableValue(); virtual void setTarget(const QmlMetaProperty &); - QmlMetaProperty property() const { return _property; } + QmlMetaProperty property() const; Q_CLASSINFO("DefaultProperty", "expression"); Q_PROPERTY(QString expression READ expression WRITE setExpression); @@ -82,8 +83,7 @@ protected: virtual void valueChanged(); private: - bool _inited; - QmlMetaProperty _property; + Q_DECLARE_PRIVATE(QmlBindableValue) }; QML_DECLARE_TYPE(QmlBindableValue); diff --git a/src/declarative/qml/qmlbindablevalue_p.h b/src/declarative/qml/qmlbindablevalue_p.h new file mode 100644 index 0000000..b6de5b7 --- /dev/null +++ b/src/declarative/qml/qmlbindablevalue_p.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLBINDABLEVALUE_P_H +#define QMLBINDABLEVALUE_P_H + +#include <private/qobject_p.h> +#include <qmlbindablevalue.h> +#include <qmlmetaproperty.h> + +QT_BEGIN_NAMESPACE + +class QmlBindableValuePrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlBindableValue); +public: + QmlBindableValuePrivate(); + + bool inited; + QmlMetaProperty property; +}; + +QT_END_NAMESPACE + +#endif // QMLBINDABLEVALUE_P_H diff --git a/src/declarative/qml/qmlcompiledcomponent.cpp b/src/declarative/qml/qmlcompiledcomponent.cpp index 2c76f0c..c69af44 100644 --- a/src/declarative/qml/qmlcompiledcomponent.cpp +++ b/src/declarative/qml/qmlcompiledcomponent.cpp @@ -76,80 +76,6 @@ void QmlCompiledComponent::dumpInstructions() qWarning() << "-------------------------------------------------------------------------------"; } -void QmlCompiledComponent::dump(int indent, Property *p) -{ - QByteArray ba(indent * 4, ' '); - for (int ii = 0; ii < p->values.count(); ++ii) - dump(indent, p->values.at(ii)); - if (p->value) - dump(indent, p->value); -} - -void QmlCompiledComponent::dump(int indent, Object *o) -{ - QByteArray ba(indent * 4, ' '); - if (o->type != -1) { - qWarning() << ba.constData() << "Object:" << types.at(o->type).className; - } else { - qWarning() << ba.constData() << "Object: fetched"; - } - - for (QHash<QByteArray, Property *>::ConstIterator iter = o->properties.begin(); - iter != o->properties.end(); - ++iter) { - qWarning() << ba.constData() << " Property" << iter.key(); - dump(indent + 1, *iter); - } - - if (o->defaultProperty) { - qWarning() << ba.constData() << " Default property"; - dump(indent + 1, o->defaultProperty); - } -} - -void QmlCompiledComponent::dump(int indent, Value *v) -{ - QByteArray type; - switch(v->type) { - default: - case Value::Unknown: - type = "Unknown"; - break; - case Value::Literal: - type = "Literal"; - break; - case Value::PropertyBinding: - type = "PropertyBinding"; - break; - case Value::ValueSource: - type = "ValueSource"; - break; - case Value::CreatedObject: - type = "CreatedObject"; - break; - case Value::SignalObject: - type = "SignalObject"; - break; - case Value::SignalExpression: - type = "SignalExpression"; - break; - case Value::Component: - type = "Component"; - break; - case Value::Id: - type = "Id"; - break; - }; - - QByteArray ba(indent * 4, ' '); - if (v->object) { - qWarning() << ba.constData() << "Value (" << type << "):"; - dump(indent + 1, v->object); - } else { - qWarning() << ba.constData() << "Value (" << type << "):" << v->primitive; - } -} - void QmlCompiledComponent::dumpPre() { if (!(dumpStatus & DumpPre)) { diff --git a/src/declarative/qml/qmlcompiledcomponent_p.h b/src/declarative/qml/qmlcompiledcomponent_p.h index 883ad64..c5e1226 100644 --- a/src/declarative/qml/qmlcompiledcomponent_p.h +++ b/src/declarative/qml/qmlcompiledcomponent_p.h @@ -67,9 +67,6 @@ public: private: enum DumpStatus { NoDump = 0x00, DumpPre = 0x01, DumpPost = 0x02 } dumpStatus; void dumpInstructions(); - void dump(int indent, QmlParser::Property *p); - void dump(int indent, QmlParser::Object *o); - void dump(int indent, QmlParser::Value *v); void dump(QmlInstruction *, int idx = -1); friend class QmlCompiler; friend class QmlDomDocument; diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 9ae1278..13fc332 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -136,6 +136,22 @@ int QmlCompiledData::indexForInt(int *data, int count) return idx; } +int QmlCompiledData::indexForLocation(const QmlParser::Location &l) +{ + // ### FIXME + int rv = locations.count(); + locations << l; + return rv; +} + +int QmlCompiledData::indexForLocation(const QmlParser::LocationSpan &l) +{ + // ### FIXME + int rv = locations.count(); + locations << l.start << l.end; + return rv; +} + QmlCompiler::QmlCompiler() : exceptionLine(-1), exceptionColumn(-1), output(0) { @@ -434,8 +450,8 @@ void QmlCompiler::reset(QmlCompiledComponent *cc, bool deleteMemory) #define COMPILE_EXCEPTION2(token, desc) \ { \ - exceptionLine = token->line; \ - exceptionColumn = token->column; \ + exceptionLine = token->location.start.line; \ + exceptionColumn = token->location.start.column; \ QDebug d(&exceptionDescription); \ d << desc; \ return false; \ @@ -443,8 +459,8 @@ void QmlCompiler::reset(QmlCompiledComponent *cc, bool deleteMemory) #define COMPILE_EXCEPTION(desc) \ { \ - exceptionLine = obj->line; \ - exceptionColumn = obj->column; \ + exceptionLine = obj->location.start.line; \ + exceptionColumn = obj->location.start.column; \ QDebug d(&exceptionDescription); \ d << desc; \ return false; \ @@ -541,7 +557,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) // Create the object QmlInstruction create; create.type = QmlInstruction::CreateObject; - create.line = obj->line; + create.line = obj->location.start.line; create.create.data = -1; create.create.type = obj->type; output->bytecode << create; @@ -552,7 +568,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) if (output->types.at(obj->type).component) { QmlInstruction begin; begin.type = QmlInstruction::TryBeginObject; - begin.line = obj->line; + begin.line = obj->location.start.line; output->bytecode << begin; } else { int cast = QmlMetaType::qmlParserStatusCast(QmlMetaType::type(output->types.at(obj->type).className)); @@ -560,7 +576,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) QmlInstruction begin; begin.type = QmlInstruction::BeginObject; begin.begin.castValue = cast; - begin.line = obj->line; + begin.line = obj->location.start.line; output->bytecode << begin; } } @@ -611,7 +627,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) if (output->types.at(obj->type).component) { QmlInstruction complete; complete.type = QmlInstruction::TryCompleteObject; - complete.line = obj->line; + complete.line = obj->location.start.line; output->bytecode << complete; } else { int cast = QmlMetaType::qmlParserStatusCast(QmlMetaType::type(output->types.at(obj->type).className)); @@ -619,7 +635,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) QmlInstruction complete; complete.type = QmlInstruction::CompleteObject; complete.complete.castValue = cast; - complete.line = obj->line; + complete.line = obj->location.start.line; output->bytecode << complete; } } @@ -661,7 +677,7 @@ bool QmlCompiler::compileComponent(Object *obj, int ctxt) int pref = output->indexForString(val); QmlInstruction id; id.type = QmlInstruction::SetId; - id.line = idProp->line; + id.line = idProp->location.start.line; id.setId.value = pref; id.setId.save = -1; output->bytecode << id; @@ -675,14 +691,14 @@ bool QmlCompiler::compileComponentFromRoot(Object *obj, int ctxt) output->bytecode.push_back(QmlInstruction()); QmlInstruction &create = output->bytecode.last(); create.type = QmlInstruction::CreateComponent; - create.line = obj->line; - create.createComponent.endLine = obj->endLine; + create.line = obj->location.start.line; + create.createComponent.endLine = obj->location.end.line; int count = output->bytecode.count(); QmlInstruction init; init.type = QmlInstruction::Init; init.init.dataSize = 0; - init.line = obj->line; + init.line = obj->location.start.line; output->bytecode << init; QSet<QString> oldIds = ids; @@ -732,7 +748,7 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) if (rv) { QmlInstruction assign; assign.type = QmlInstruction::AssignSignalObject; - assign.line = prop->values.at(0)->line; + assign.line = prop->values.at(0)->location.start.line; assign.assignSignalObject.signal = pr; output->bytecode << assign; @@ -755,7 +771,7 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) QmlInstruction assign; assign.type = QmlInstruction::AssignSignal; - assign.line = prop->values.at(0)->line; + assign.line = prop->values.at(0)->location.start.line; assign.assignSignal.signal = pr; assign.assignSignal.value = idx; @@ -878,7 +894,7 @@ bool QmlCompiler::compileIdProperty(QmlParser::Property *prop, assign.type = QmlInstruction::StoreString; assign.storeString.propertyIndex = prop->index; assign.storeString.value = pref; - assign.line = prop->values.at(0)->line; + assign.line = prop->values.at(0)->location.start.line; output->bytecode << assign; prop->values.at(0)->type = Value::Id; @@ -888,10 +904,9 @@ bool QmlCompiler::compileIdProperty(QmlParser::Property *prop, QmlInstruction id; id.type = QmlInstruction::SetId; - id.line = prop->values.at(0)->line; + id.line = prop->values.at(0)->location.start.line; id.setId.value = pref; id.setId.save = -1; - id.line = prop->values.at(0)->line; output->bytecode << id; obj->id = val.toLatin1(); @@ -909,7 +924,7 @@ bool QmlCompiler::compileAttachedProperty(QmlParser::Property *prop, QmlInstruction fetch; fetch.type = QmlInstruction::FetchAttached; - fetch.line = prop->line; + fetch.line = prop->location.start.line; int id = QmlMetaType::attachedPropertiesFuncId(prop->name); if (id == -1) COMPILE_EXCEPTION("Non-existant attached property object" << prop->name); @@ -920,7 +935,7 @@ bool QmlCompiler::compileAttachedProperty(QmlParser::Property *prop, QmlInstruction pop; pop.type = QmlInstruction::PopFetchedObject; - pop.line = prop->line; + pop.line = prop->location.start.line; output->bytecode << pop; return true; @@ -942,14 +957,14 @@ bool QmlCompiler::compileNestedProperty(QmlParser::Property *prop, fetch.type = QmlInstruction::ResolveFetchObject; fetch.fetch.property = output->indexForByteArray(prop->name); } - fetch.line = prop->line; + fetch.line = prop->location.start.line; output->bytecode << fetch; COMPILE_CHECK(compileFetchedObject(prop->value, ctxt + 1)); QmlInstruction pop; pop.type = QmlInstruction::PopFetchedObject; - pop.line = prop->line; + pop.line = prop->location.start.line; output->bytecode << pop; return true; @@ -962,7 +977,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, int t = prop->type; if (QmlMetaType::isQmlList(t)) { QmlInstruction fetch; - fetch.line = prop->line; + fetch.line = prop->location.start.line; fetch.type = QmlInstruction::FetchQmlList; fetch.fetchQmlList.property = prop->index; fetch.fetchQmlList.type = QmlMetaType::qmlListType(t); @@ -975,7 +990,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, COMPILE_CHECK(compileObject(v->object, ctxt)); QmlInstruction assign; assign.type = QmlInstruction::AssignObjectList; - assign.line = prop->line; + assign.line = prop->location.start.line; assign.assignObject.property = output->indexForByteArray(prop->name); assign.assignObject.castValue = 0; output->bytecode << assign; @@ -986,14 +1001,14 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, QmlInstruction pop; pop.type = QmlInstruction::PopQList; - pop.line = prop->line; + pop.line = prop->location.start.line; output->bytecode << pop; } else { Q_ASSERT(QmlMetaType::isList(t)); QmlInstruction fetch; fetch.type = QmlInstruction::FetchQList; - fetch.line = prop->line; + fetch.line = prop->location.start.line; fetch.fetch.property = prop->index; output->bytecode << fetch; @@ -1005,7 +1020,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, COMPILE_CHECK(compileObject(v->object, ctxt)); QmlInstruction assign; assign.type = QmlInstruction::AssignObjectList; - assign.line = v->line; + assign.line = v->location.start.line; assign.assignObject.property = output->indexForByteArray(prop->name); assign.assignObject.castValue = 0; output->bytecode << assign; @@ -1013,7 +1028,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, if (assignedBinding) COMPILE_EXCEPTION("Can only assign one binding to lists"); - compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->line); + compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->location.start.line); v->type = Value::PropertyBinding; } else { COMPILE_EXCEPTION("Cannot assign primitives to lists"); @@ -1021,7 +1036,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, } QmlInstruction pop; - pop.line = prop->line; + pop.line = prop->location.start.line; pop.type = QmlInstruction::PopQList; output->bytecode << pop; } @@ -1086,7 +1101,7 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, QmlInstruction assign; assign.type = QmlInstruction::AssignObject; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.assignObject.castValue = 0; if (prop->isDefault) assign.assignObject.property = -1; @@ -1101,7 +1116,7 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, QmlInstruction assign; assign.type = QmlInstruction::StoreObject; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.storeObject.propertyIndex = prop->index; // XXX - this cast may not be 0 assign.storeObject.cast = 0; @@ -1114,7 +1129,7 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, QmlInstruction assign; assign.type = QmlInstruction::StoreObject; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.storeObject.propertyIndex = prop->index; // XXX - this cast may not be 0 assign.storeObject.cast = 0; @@ -1127,13 +1142,13 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, if (prop->index != -1) { QmlInstruction assign; assign.type = QmlInstruction::StoreValueSource; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.assignValueSource.property = prop->index; output->bytecode << assign; } else { QmlInstruction assign; assign.type = QmlInstruction::AssignValueSource; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.assignValueSource.property = output->indexForByteArray(prop->name);; output->bytecode << assign; } @@ -1148,7 +1163,7 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, QmlInstruction assign; assign.type = QmlInstruction::AssignObject; - assign.line = v->object->line; + assign.line = v->object->location.start.line; assign.assignObject.property = output->indexForByteArray(prop->name); assign.assignObject.castValue = 0; output->bytecode << assign; @@ -1166,14 +1181,14 @@ bool QmlCompiler::compilePropertyLiteralAssignment(QmlParser::Property *prop, { if (isBinding(v->primitive)) { - compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->line); + compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->location.start.line); v->type = Value::PropertyBinding; } else { QmlInstruction assign; - assign.line = v->line; + assign.line = v->location.start.line; bool doassign = true; if (prop->index != -1) { @@ -1286,7 +1301,7 @@ bool QmlCompiler::compileDynamicMeta(QmlParser::Object *obj) store.type = QmlInstruction::StoreMetaObject; store.storeMeta.data = output->mos.count() - 1; store.storeMeta.slotData = slotStart; - store.line = obj->line; + store.line = obj->location.start.line; output->bytecode << store; for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) { @@ -1301,7 +1316,7 @@ bool QmlCompiler::compileDynamicMeta(QmlParser::Object *obj) if (!p.onValueChanged.isEmpty()) { QmlInstruction assign; assign.type = QmlInstruction::AssignSignal; - assign.line = obj->line; + assign.line = obj->location.start.line; assign.assignSignal.signal = output->indexForByteArray(p.name + "Changed()"); assign.assignSignal.value = diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index e2b8388..b885e7b 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -48,6 +48,8 @@ #include <qmlerror.h> #include <private/qmlinstruction_p.h> #include <private/qmlcompositetypemanager_p.h> +#include <private/qmlparser_p.h> + class QStringList; QT_BEGIN_NAMESPACE @@ -56,12 +58,6 @@ class QmlComponent; class QmlCompiledComponent; class QmlContext; -namespace QmlParser { - class Object; - class Property; - class Value; -}; - class QmlCompiledData { public: @@ -98,6 +94,7 @@ public: QList<CustomTypeData> customTypeData; QList<QByteArray> datas; QList<QMetaObject *> mos; + QList<QmlParser::Location> locations; QList<QmlInstruction> bytecode; private: @@ -106,6 +103,8 @@ private: int indexForByteArray(const QByteArray &); int indexForFloat(float *, int); int indexForInt(int *, int); + int indexForLocation(const QmlParser::Location &); + int indexForLocation(const QmlParser::LocationSpan &); }; class Q_DECLARATIVE_EXPORT QmlCompiler diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 08755b1..689446b 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -181,7 +181,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data) } if (td->data.tree()) { - component.dump(0, td->data.tree()); + td->data.tree()->dump(); d->root = td->data.tree(); d->root->addref(); } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 7dcab6f..be5226e 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -74,10 +74,7 @@ QT_BEGIN_NAMESPACE -DEFINE_BOOL_CONFIG_OPTION(bindValueDebug, QML_BINDVALUE_DEBUG); -#ifdef QT_SCRIPTTOOLS_LIB -DEFINE_BOOL_CONFIG_OPTION(debuggerEnabled, QML_DEBUGGER); -#endif +DEFINE_BOOL_CONFIG_OPTION(qmlDebugger, QML_DEBUGGER); Q_DECLARE_METATYPE(QmlMetaProperty); @@ -171,7 +168,7 @@ void QmlEnginePrivate::init() objectClass = new QmlObjectScriptClass(q); rootContext = new QmlContext(q); #ifdef QT_SCRIPTTOOLS_LIB - if (debuggerEnabled()){ + if (qmlDebugger()){ debugger = new QScriptEngineDebugger(q); debugger->attachTo(&scriptEngine); } @@ -723,17 +720,17 @@ QmlEngine *QmlEngine::activeEngine() QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b) -: q(b), ctxt(0), sseData(0), proxy(0), me(0), trackChange(false) +: q(b), ctxt(0), sseData(0), proxy(0), me(0), trackChange(false), log(0) { } QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b, void *expr, QmlRefCount *rc) -: q(b), ctxt(0), sse((const char *)expr, rc), sseData(0), proxy(0), me(0), trackChange(true) +: q(b), ctxt(0), sse((const char *)expr, rc), sseData(0), proxy(0), me(0), trackChange(true), log(0) { } QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b, const QString &expr, bool ssecompile) -: q(b), ctxt(0), expression(expr), sseData(0), proxy(0), me(0), trackChange(true) +: q(b), ctxt(0), expression(expr), sseData(0), proxy(0), me(0), trackChange(true), log(0) { if (ssecompile) { #ifdef Q_ENABLE_PERFORMANCE_LOG @@ -748,6 +745,7 @@ QmlExpressionPrivate::~QmlExpressionPrivate() sse.deleteScriptState(sseData); sseData = 0; delete proxy; + delete log; } /*! @@ -884,8 +882,6 @@ void BindExpressionProxy::changed() */ QVariant QmlExpression::value() { - if (bindValueDebug()) - qWarning() << "QmlEngine: Evaluating:" << expression(); QVariant rv; if (!d->ctxt || (!d->sse.isValid() && d->expression.isEmpty())) return rv; @@ -990,34 +986,51 @@ QVariant QmlExpression::value() if (changedIndex == -1) changedIndex = BindExpressionProxy::staticMetaObject.indexOfSlot("changed()"); - if (bindValueDebug()) - qWarning() << " Depends on:"; - - for (int ii = 0; ii < ep->capturedProperties.count(); ++ii) { - const QmlMetaProperty &prop = - ep->capturedProperties.at(ii); - - if (prop.hasChangedNotifier()) { - prop.connectNotifier(d->proxy, changedIndex); - if (bindValueDebug()) - qWarning() << " property" - << prop.name() - << prop.object() - << prop.object()->metaObject()->superClass()->className(); - } else if (bindValueDebug()) { - qWarning() << " non-subscribable property" - << prop.name() - << prop.object() - << prop.object()->metaObject()->superClass()->className(); + if(qmlDebugger()) { + QmlExpressionLog log; + log.setExpression(expression()); + log.setResult(rv); + + for (int ii = 0; ii < ep->capturedProperties.count(); ++ii) { + const QmlMetaProperty &prop = + ep->capturedProperties.at(ii); + + if (prop.hasChangedNotifier()) { + prop.connectNotifier(d->proxy, changedIndex); + } else { + QString warn = QLatin1String("Expression depends on property without a NOTIFY signal: ") + QLatin1String(prop.object()->metaObject()->className()) + QLatin1String(".") + prop.name(); + log.addWarning(warn); + } + } + d->addLog(log); + + } else { + for (int ii = 0; ii < ep->capturedProperties.count(); ++ii) { + const QmlMetaProperty &prop = + ep->capturedProperties.at(ii); + + if (prop.hasChangedNotifier()) + prop.connectNotifier(d->proxy, changedIndex); } } + } else { + QmlExpressionLog log; + log.setExpression(expression()); + log.setResult(rv); + d->addLog(log); + } + + } else { + if(qmlDebugger()) { + QmlExpressionLog log; + log.setExpression(expression()); + log.setResult(rv); + d->addLog(log); } } + ep->capturedProperties.clear(); - if (bindValueDebug()) - qWarning() << " Result:" << rv - << "(SSE: " << d->sse.isValid() << ")"; return rv; } @@ -1396,4 +1409,65 @@ void QmlObjectScriptClass::setProperty(QScriptValue &object, scriptEngine->currentContext()->setActivationObject(oldact); } +void QmlExpressionPrivate::addLog(const QmlExpressionLog &l) +{ + if (!log) + log = new QList<QmlExpressionLog>(); + log->append(l); +} + +QmlExpressionLog::QmlExpressionLog() +{ +} + +QmlExpressionLog::QmlExpressionLog(const QmlExpressionLog &o) +: m_expression(o.m_expression), + m_result(o.m_result), + m_warnings(o.m_warnings) +{ +} + +QmlExpressionLog::~QmlExpressionLog() +{ +} + +QmlExpressionLog &QmlExpressionLog::operator=(const QmlExpressionLog &o) +{ + m_expression = o.m_expression; + m_result = o.m_result; + m_warnings = o.m_warnings; + return *this; +} + + +QString QmlExpressionLog::expression() const +{ + return m_expression; +} + +void QmlExpressionLog::setExpression(const QString &e) +{ + m_expression = e; +} + +QStringList QmlExpressionLog::warnings() const +{ + return m_warnings; +} + +void QmlExpressionLog::addWarning(const QString &w) +{ + m_warnings << w; +} + +QVariant QmlExpressionLog::result() const +{ + return m_result; +} + +void QmlExpressionLog::setResult(const QVariant &r) +{ + m_result = r; +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index b72c680..7d5176e 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -192,6 +192,30 @@ public: const QScriptValue &value); }; +class QmlExpressionLog +{ +public: + QmlExpressionLog(); + QmlExpressionLog(const QmlExpressionLog &); + ~QmlExpressionLog(); + + QmlExpressionLog &operator=(const QmlExpressionLog &); + + QString expression() const; + void setExpression(const QString &); + + QStringList warnings() const; + void addWarning(const QString &); + + QVariant result() const; + void setResult(const QVariant &); + +private: + QString m_expression; + QVariant m_result; + QStringList m_warnings; +}; + class QmlExpressionPrivate { public: @@ -208,6 +232,9 @@ public: BindExpressionProxy *proxy; QObject *me; bool trackChange; + + void addLog(const QmlExpressionLog &); + QList<QmlExpressionLog> *log; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlexpression.h b/src/declarative/qml/qmlexpression.h index 4f9502b..0ab5d9c 100644 --- a/src/declarative/qml/qmlexpression.h +++ b/src/declarative/qml/qmlexpression.h @@ -85,6 +85,7 @@ protected: private: friend class BindExpressionProxy; + friend class QmlDebugger; QmlExpressionPrivate *d; }; diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index e9c81d6..02e084d 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -165,6 +165,9 @@ public: // NoOp - Do nothing NoOp }; + QmlInstruction() + : type(NoOp), line(0) {} + Type type; unsigned short line; union { diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index a6cb2ca..2bd41e2 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE using namespace QmlParser; QmlParser::Object::Object() -: type(-1), metatype(0), extObjectData(0), defaultProperty(0), line(-1), column(-1), endLine(-1), endColumn(-1) +: type(-1), metatype(0), extObjectData(0), defaultProperty(0) { } @@ -132,13 +132,35 @@ QmlParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o) { } +void QmlParser::Object::dump(int indent) const +{ + QByteArray ba(indent * 4, ' '); + if (type != -1) { + qWarning() << ba.constData() << "Object:" << typeName; + } else { + qWarning() << ba.constData() << "Object: fetched"; + } + + for (QHash<QByteArray, Property *>::ConstIterator iter = properties.begin(); + iter != properties.end(); + ++iter) { + qWarning() << ba.constData() << " Property" << iter.key(); + (*iter)->dump(indent + 1); + } + + if (defaultProperty) { + qWarning() << ba.constData() << " Default property"; + defaultProperty->dump(indent + 1); + } +} + QmlParser::Property::Property() -: type(0), index(-1), value(0), isDefault(true), line(-1), column(-1) +: type(0), index(-1), value(0), isDefault(true) { } QmlParser::Property::Property(const QByteArray &n) -: type(0), index(-1), value(0), name(n), isDefault(false), line(-1), column(-1) +: type(0), index(-1), value(0), name(n), isDefault(false) { } @@ -157,17 +179,20 @@ Object *QmlParser::Property::getValue() void QmlParser::Property::addValue(Value *v) { - if (::getenv("DUI_DEBUG")) { - if (v->object) - qDebug() << "Property" << name << "addValue Object(" << v->object->typeName << ")"; - else - qDebug() << "Property" << name << "addValue" << v->primitive; - } values << v; } +void QmlParser::Property::dump(int indent) const +{ + QByteArray ba(indent * 4, ' '); + for (int ii = 0; ii < values.count(); ++ii) + values.at(ii)->dump(indent); + if (value) + value->dump(indent); +} + QmlParser::Value::Value() -: type(Unknown), object(0), line(-1), column(-1) +: type(Unknown), object(0) { } @@ -176,4 +201,47 @@ QmlParser::Value::~Value() if (object) object->release(); } +void QmlParser::Value::dump(int indent) const +{ + QByteArray type; + switch(this->type) { + default: + case Value::Unknown: + type = "Unknown"; + break; + case Value::Literal: + type = "Literal"; + break; + case Value::PropertyBinding: + type = "PropertyBinding"; + break; + case Value::ValueSource: + type = "ValueSource"; + break; + case Value::CreatedObject: + type = "CreatedObject"; + break; + case Value::SignalObject: + type = "SignalObject"; + break; + case Value::SignalExpression: + type = "SignalExpression"; + break; + case Value::Component: + type = "Component"; + break; + case Value::Id: + type = "Id"; + break; + }; + + QByteArray ba(indent * 4, ' '); + if (object) { + qWarning() << ba.constData() << "Value (" << type << "):"; + object->dump(indent + 1); + } else { + qWarning() << ba.constData() << "Value (" << type << "):" << primitive; + } +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index aa22928..31f8702 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -45,10 +45,8 @@ #include <QByteArray> #include <QList> #include <qml.h> -#include "qmlcomponent_p.h" #include <private/qmlrefcount_p.h> -#include "qmlcompiledcomponent_p.h" - +#include <private/qobject_p.h> QT_BEGIN_HEADER @@ -69,6 +67,19 @@ QT_MODULE(Declarative) */ namespace QmlParser { + struct Location + { + Location() : line(-1), column(-1) {} + int line; + int column; + }; + + struct LocationSpan + { + Location start; + Location end; + }; + class Property; class Object : public QmlRefCount { @@ -103,11 +114,7 @@ namespace QmlParser Property *defaultProperty; QHash<QByteArray, Property *> properties; - qint64 line; - qint64 column; - - qint64 endLine; - qint64 endColumn; + LocationSpan location; struct DynamicProperty { DynamicProperty(); @@ -141,6 +148,8 @@ namespace QmlParser QList<DynamicSignal> dynamicSignals; // The list of dynamic slots QList<DynamicSlot> dynamicSlots; + + void dump(int = 0) const; }; class Value : public QmlRefCount @@ -176,8 +185,9 @@ namespace QmlParser // Object value Object *object; - qint64 line; - qint64 column; + LocationSpan location; + + void dump(int = 0) const; }; class Property : public QmlRefCount @@ -207,8 +217,9 @@ namespace QmlParser // True if this property was accessed as the default property. bool isDefault; - qint64 line; - qint64 column; + LocationSpan location; + + void dump(int = 0) const; }; } diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 8be0e5a..4385601 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -37,18 +37,19 @@ class ProcessAST: protected AST::Visitor push(State(obj)); } - void pushProperty(const QString &name, int lineNumber) + void pushProperty(const QString &name, const LocationSpan &location) { const State &state = top(); if (state.property) { State s(state.property->getValue(), state.property->getValue()->getProperty(name.toLatin1())); - s.property->line = lineNumber; + s.property->location = location; push(s); } else { State s(state.object, state.object->getProperty(name.toLatin1())); - s.property->line = lineNumber; + + s.property->location = location; push(s); } } @@ -65,14 +66,19 @@ protected: AST::UiQualifiedId *propertyName, const QString &objectType, AST::SourceLocation typeLocation, + LocationSpan location, AST::UiObjectInitializer *initializer = 0); Object *defineObjectBinding_helper(int line, AST::UiQualifiedId *propertyName, const QString &objectType, AST::SourceLocation typeLocation, + LocationSpan location, AST::UiObjectInitializer *initializer = 0); QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); - void defineProperty(const QString &propertyName, int line, const QString &primitive); + void defineProperty(const QString &propertyName, const LocationSpan &location, const QString &primitive); + + LocationSpan location(AST::SourceLocation start, AST::SourceLocation end); + LocationSpan location(AST::UiQualifiedId *); using AST::Visitor::visit; using AST::Visitor::endVisit; @@ -192,18 +198,21 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const return s; } -Object *ProcessAST::defineObjectBinding_helper(int line, - AST::UiQualifiedId *propertyName, - const QString &objectType, - AST::SourceLocation typeLocation, - AST::UiObjectInitializer *initializer) +Object * +ProcessAST::defineObjectBinding_helper(int line, + AST::UiQualifiedId *propertyName, + const QString &objectType, + AST::SourceLocation typeLocation, + LocationSpan location, + AST::UiObjectInitializer *initializer) { bool isType = !objectType.isEmpty() && objectType.at(0).isUpper() && !objectType.contains(QLatin1Char('.')); int propertyCount = 0; for (; propertyName; propertyName = propertyName->next){ ++propertyCount; - _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); + _stateStack.pushProperty(propertyName->name->asString(), + this->location(propertyName)); } if (!isType) { @@ -217,7 +226,8 @@ Object *ProcessAST::defineObjectBinding_helper(int line, return 0; } - _stateStack.pushProperty(objectType, line); + _stateStack.pushProperty(objectType, + this->location(propertyName)); accept(initializer); _stateStack.pop(); @@ -233,18 +243,14 @@ Object *ProcessAST::defineObjectBinding_helper(int line, _scope.append(objectType); obj->typeName = qualifiedNameId().toLatin1(); _scope.removeLast(); - obj->line = line; - - if(initializer) { - obj->endLine = initializer->rbraceToken.startLine; - obj->endColumn = initializer->rbraceToken.startColumn; - } + obj->location = location; if (propertyCount) { + Property *prop = currentProperty(); Value *v = new Value; v->object = obj; - v->line = line; + v->location = obj->location; prop->addValue(v); while (propertyCount--) @@ -258,7 +264,7 @@ Object *ProcessAST::defineObjectBinding_helper(int line, const State state = _stateStack.top(); Value *v = new Value; v->object = obj; - v->line = line; + v->location = obj->location; if (state.property) state.property->addValue(v); else @@ -278,11 +284,12 @@ Object *ProcessAST::defineObjectBinding(int line, AST::UiQualifiedId *qualifiedId, const QString &objectType, AST::SourceLocation typeLocation, + LocationSpan location, AST::UiObjectInitializer *initializer) { if (objectType == QLatin1String("Connection")) { - Object *obj = defineObjectBinding_helper(line, 0, objectType, typeLocation); + Object *obj = defineObjectBinding_helper(line, 0, objectType, typeLocation, location); _stateStack.pushObject(obj); @@ -300,7 +307,10 @@ Object *ProcessAST::defineObjectBinding(int line, } else { script = asString(scriptBinding->statement); } - defineProperty(QLatin1String("script"), line, script); + + LocationSpan l = this->location(scriptBinding->statement->firstSourceLocation(), + scriptBinding->statement->lastSourceLocation()); + defineProperty(QLatin1String("script"), l, script); } else { accept(it->member); } @@ -311,15 +321,30 @@ Object *ProcessAST::defineObjectBinding(int line, return obj; } - return defineObjectBinding_helper(line, qualifiedId, objectType, typeLocation, initializer); + return defineObjectBinding_helper(line, qualifiedId, objectType, typeLocation, location, initializer); } -void ProcessAST::defineProperty(const QString &propertyName, int line, const QString &primitive) +LocationSpan ProcessAST::location(AST::UiQualifiedId *id) { - _stateStack.pushProperty(propertyName, line); + return location(id->identifierToken, id->identifierToken); +} + +LocationSpan ProcessAST::location(AST::SourceLocation start, AST::SourceLocation end) +{ + LocationSpan rv; + rv.start.line = start.startLine; + rv.start.column = start.startColumn; + rv.end.line = end.startLine; + rv.end.column = end.startColumn + end.length - 1; + return rv; +} + +void ProcessAST::defineProperty(const QString &propertyName, const LocationSpan &location, const QString &primitive) +{ + _stateStack.pushProperty(propertyName, location); Value *value = new Value; value->primitive = primitive; - value->line = line; + value->location = location; currentProperty()->addValue(value); _stateStack.pop(); } @@ -396,6 +421,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) if (node->expression) { // default value property.defaultValue = new Property; Value *value = new Value; + value->location = location(node->expression->firstSourceLocation(), + node->expression->lastSourceLocation()); value->primitive = getPrimitive("value", node->expression); property.defaultValue->values << value; } @@ -410,11 +437,14 @@ bool ProcessAST::visit(AST::UiPublicMember *node) // UiObjectMember: T_IDENTIFIER UiObjectInitializer ; bool ProcessAST::visit(AST::UiObjectDefinition *node) { + LocationSpan l = location(node->firstSourceLocation(), + node->lastSourceLocation());; defineObjectBinding(node->identifierToken.startLine, 0, node->name->asString(), node->identifierToken, + l, node->initializer); return false; @@ -424,10 +454,14 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node) // UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; bool ProcessAST::visit(AST::UiObjectBinding *node) { + LocationSpan l; + l = location(node->identifierToken, node->initializer->rbraceToken); + defineObjectBinding(node->identifierToken.startLine, node->qualifiedId, node->name->asString(), node->identifierToken, + l, node->initializer); return false; @@ -467,7 +501,8 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) AST::UiQualifiedId *propertyName = node->qualifiedId; for (; propertyName; propertyName = propertyName->next){ ++propertyCount; - _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); + _stateStack.pushProperty(propertyName->name->asString(), + location(propertyName)); } Property *prop = currentProperty(); @@ -490,8 +525,9 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) Value *v = new Value; v->primitive = primitive; - v->line = node->statement->firstSourceLocation().startLine; - v->column = node->statement->firstSourceLocation().startColumn; + v->location = location(node->statement->firstSourceLocation(), + node->statement->lastSourceLocation()); + prop->addValue(v); while (propertyCount--) @@ -507,7 +543,8 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) AST::UiQualifiedId *propertyName = node->qualifiedId; for (; propertyName; propertyName = propertyName->next){ ++propertyCount; - _stateStack.pushProperty(propertyName->name->asString(), propertyName->identifierToken.startLine); + _stateStack.pushProperty(propertyName->name->asString(), + location(propertyName)); } accept(node->members); @@ -564,8 +601,9 @@ bool ProcessAST::visit(AST::UiSourceElement *node) } Value *value = new Value; + value->location = location(node->firstSourceLocation(), + node->lastSourceLocation()); value->primitive = source; - value->line = line; obj->getDefaultProperty()->addValue(value); } @@ -614,8 +652,8 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) QmlError error; error.setUrl(url); error.setDescription(m.message); - error.setLine(m.line); - error.setColumn(m.column); + error.setLine(m.loc.startLine); + error.setColumn(m.loc.startColumn); _errors << error; } diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 82df3bc..ca4f9c9 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -48,6 +48,7 @@ #include <private/qmlcustomparser_p.h> #include <qperformancelog.h> #include <QStack> +#include <QWidget> #include <private/qmlcompiledcomponent_p.h> #include <QColor> #include <QPointF> @@ -274,7 +275,11 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in } if (!stack.isEmpty()) { QObject *parent = stack.top(); - o->setParent(parent); + if (o->isWidgetType()) { + qobject_cast<QWidget*>(o)->setParent(qobject_cast<QWidget*>(parent)); + } else { + o->setParent(parent); + } } stack.push(o); } diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp index 0dc16c9..5ed8852 100644 --- a/src/gui/dialogs/qabstractprintdialog.cpp +++ b/src/gui/dialogs/qabstractprintdialog.cpp @@ -400,7 +400,7 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter) QAbstractPrintDialog::setEnabledOptions() and QAbstractPrintDialog::addEnabledOption() have no effect. - In Qt 4.4, it was possible to use the satic functions to show a sheet on + In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5. If you want this functionality, use QPrintDialog::open(). diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 92be62f..bc9b2fa 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1966,7 +1966,7 @@ void QGraphicsItem::setOpacity(qreal opacity) itemChange(ItemOpacityHasChanged, newOpacity); // Update. - d_ptr->fullUpdateHelper(); + d_ptr->fullUpdateHelper(/*childrenOnly=*/false, /*maybeDirtyClipPath=*/false, /*ignoreOpacity=*/true); } /*! @@ -3512,10 +3512,16 @@ bool QGraphicsItem::contains(const QPointF &point) const } /*! - Returns true if this item collides with \a other; otherwise returns false. - The ways items collide is determined by \a mode. The default value for \a - mode is Qt::IntersectsItemShape; \a other collides with this item if it - either intersects, contains, or is contained by this item's shape. + + Returns true if this item collides with \a other; otherwise + returns false. + + The \a mode is applied to \a other, and the resulting shape or + bounding rectangle is then compared to this item's shape. The + default value for \a mode is Qt::IntersectsItemShape; \a other + collides with this item if it either intersects, contains, or is + contained by this item's shape (see Qt::ItemSelectionMode for + details). The default implementation is based on shape intersection, and it calls shape() on both items. Because the complexity of arbitrary shape-shape @@ -3570,6 +3576,11 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Qt::IntersectsItemShape; \a path collides with this item if it either intersects, contains, or is contained by this item's shape. + Note that this function checks whether the item's shape or + bounding rectangle (depending on \a mode) is contained within \a + path, and not whether \a path is contained within the items shape + or bounding rectangle. + \sa collidesWithItem(), contains(), shape() */ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const @@ -3610,11 +3621,12 @@ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelection /*! Returns a list of all items that collide with this item. - The way collisions are detected is determined by \a mode. The default - value for \a mode is Qt::IntersectsItemShape; All items whose shape - intersects or is contained by this item's shape are returned. + The way collisions are detected is determined by applying \a mode + to items that are compared to this item, i.e., each item's shape + or bounding rectangle is checked against this item's shape. The + default value for \a mode is Qt::IntersectsItemShape. - \sa QGraphicsScene::collidingItems(), collidesWithItem() + \sa collidesWithItem() */ QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const { @@ -3898,9 +3910,8 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) \internal Returns true if we can discard an update request; otherwise false. */ -bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, - bool ignoreVisibleBit, - bool ignoreDirtyBit) const +bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, bool ignoreVisibleBit, + bool ignoreDirtyBit, bool ignoreOpacity) const { // No scene, or if the scene is updating everything, means we have nothing // to do. The only exception is if the scene tracks the growing scene rect. @@ -3909,7 +3920,7 @@ bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, || !scene || (scene->d_func()->updateAll && scene->d_func()->hasSceneRect) || (!ignoreClipping && (childrenClippedToShape() && isClippedAway())) - || (childrenCombineOpacity() && isFullyTransparent()); + || (!ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); } /*! @@ -3939,11 +3950,10 @@ void QGraphicsItemPrivate::updateHelper(const QRectF &rect, bool force, bool may Propagates updates to \a item and all its children. */ -void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath) +void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath, bool ignoreOpacity) { - if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, - /*ignoreVisibleBit=*/false, - /*ignoreDirtyBit=*/true)) { + if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, /*ignoreVisibleBit=*/false, + /*ignoreDirtyBit=*/true, ignoreOpacity)) { return; } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index bcbd737..062274f 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -175,11 +175,10 @@ public: void setPosHelper(const QPointF &pos); void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); - bool discardUpdateRequest(bool ignoreClipping = false, - bool ignoreVisibleBit = false, - bool ignoreDirtyBit = false) const; + bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false, + bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false); - void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false); + void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false, bool ignoreOpacity = false); void updateEffectiveOpacity(); void resolveEffectiveOpacity(qreal effectiveParentOpacity); void resolveDepth(int parentDepth); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 644e843..2876016 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1081,8 +1081,12 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg QList<QGraphicsItem *> itemList(scene->items()); int i = 0; while (i < itemList.size()) { + const QGraphicsItem *item = itemList.at(i); // But we only want to include items that are visible - if (!itemList.at(i)->isVisible()) + // The following check is basically the same as item->d_ptr->isInvisible(), except + // that we don't check whether the item clips children to shape or propagates its + // opacity (we loop through all items, so those checks are wrong in this context). + if (!item->isVisible() || item->d_ptr->isClippedAway() || item->d_ptr->isFullyTransparent()) itemList.removeAt(i); else ++i; diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 5de39d9..7f36be9 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1337,6 +1337,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device) \row \o TIFF \o Tagged Image File Format \row \o XBM \o X11 Bitmap \row \o XPM \o X11 Pixmap + \row \o SVG \o Scalable Vector Graphics \endtable Reading and writing SVG files is supported through Qt's diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 61f1b5b..ab03fea 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -680,10 +680,9 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto // refresh the height cache here; we don't really lose anything by getting the size hint, // since QAbstractItemView::dataChanged() will get the visualRect for the items anyway - QModelIndex top = topLeft.sibling(topLeft.row(), 0); - int topViewIndex = d->viewIndex(top); + int topViewIndex = d->viewIndex(topLeft); if (topViewIndex == 0) - d->defaultItemHeight = indexRowSizeHint(top); + d->defaultItemHeight = indexRowSizeHint(topLeft); bool sizeChanged = false; if (topViewIndex != -1) { if (topLeft == bottomRight) { @@ -691,8 +690,7 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto d->invalidateHeightCache(topViewIndex); sizeChanged = (oldHeight != d->itemHeight(topViewIndex)); } else { - QModelIndex bottom = bottomRight.sibling(bottomRight.row(), 0); - int bottomViewIndex = d->viewIndex(bottom); + int bottomViewIndex = d->viewIndex(bottomRight); for (int i = topViewIndex; i <= bottomViewIndex; ++i) { int oldHeight = d->itemHeight(i); d->invalidateHeightCache(i); @@ -1815,10 +1813,10 @@ void QTreeView::mouseDoubleClickEvent(QMouseEvent *event) if (i == -1) return; // user clicked outside the items - const QModelIndex &index = d->viewItems.at(i).index; + const QPersistentModelIndex firstColumnIndex = d->viewItems.at(i).index; int column = d->header->logicalIndexAt(event->x()); - QPersistentModelIndex persistent = index.sibling(index.row(), column); + QPersistentModelIndex persistent = firstColumnIndex.sibling(firstColumnIndex.row(), column); if (d->pressedIndex != persistent) { mousePressEvent(event); @@ -1841,10 +1839,10 @@ void QTreeView::mouseDoubleClickEvent(QMouseEvent *event) if (d->itemsExpandable && d->expandsOnDoubleClick && d->hasVisibleChildren(persistent)) { - if (!((i < d->viewItems.count()) && (d->viewItems.at(i).index == persistent))) { + if (!((i < d->viewItems.count()) && (d->viewItems.at(i).index == firstColumnIndex))) { // find the new index of the item for (i = 0; i < d->viewItems.count(); ++i) { - if (d->viewItems.at(i).index == persistent) + if (d->viewItems.at(i).index == firstColumnIndex) break; } if (i == d->viewItems.count()) @@ -2422,14 +2420,10 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end) ? d->viewItems.count() : d->viewItems.at(parentItem).total) - 1; - int firstColumn = 0; - while (isColumnHidden(firstColumn) && firstColumn < header()->count() - 1) - ++firstColumn; - const int delta = end - start + 1; QVector<QTreeViewItem> insertedItems(delta); for (int i = 0; i < delta; ++i) { - insertedItems[i].index = d->model->index(i + start, firstColumn, parent); + insertedItems[i].index = d->model->index(i + start, 0, parent); insertedItems[i].level = childLevel; } if (d->viewItems.isEmpty()) @@ -2612,7 +2606,7 @@ void QTreeView::expandAll() d->viewItems[i].expanded = true; d->layout(i); QModelIndex idx = d->viewItems.at(i).index; - d->expandedIndexes.insert(idx.sibling(idx.row(), 0)); + d->expandedIndexes.insert(idx); } updateGeometries(); d->viewport->update(); @@ -3130,13 +3124,9 @@ void QTreeViewPrivate::layout(int i) int last = 0; int children = 0; - int firstColumn = 0; - while (header->isSectionHidden(firstColumn) && firstColumn < header->count()) - ++firstColumn; - for (int j = first; j < first + count; ++j) { - current = model->index(j - first, firstColumn, parent); - if (isRowHidden(current.sibling(current.row(), 0))) { + current = model->index(j - first, 0, parent); + if (isRowHidden(current)) { ++hidden; last = j - hidden + children; } else { @@ -3319,15 +3309,11 @@ int QTreeViewPrivate::itemAtCoordinate(int coordinate) const int QTreeViewPrivate::viewIndex(const QModelIndex &_index) const { - Q_Q(const QTreeView); if (!_index.isValid() || viewItems.isEmpty()) return -1; const int totalCount = viewItems.count(); - int firstColumn = 0; - while (q->isColumnHidden(firstColumn) && firstColumn < header->count()) - ++firstColumn; - const QModelIndex index = _index.sibling(_index.row(), firstColumn); + const QModelIndex index = _index.sibling(_index.row(), 0); // A quick check near the last item to see if we are just incrementing diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 60ac062..1cbc960 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -199,6 +199,7 @@ extern "C" { composingText = new QString(); composing = false; sendKeyEvents = true; + currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -213,10 +214,16 @@ extern "C" { object:self]; } --(void)registerDragTypes:(bool)accept +-(void)registerDragTypes { QMacCocoaAutoReleasePool pool; - if (accept) { + // Calling registerForDraggedTypes is slow, so only do it once for each widget + // or when the custom types change. + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { + if (currentCustomTypes == 0) + currentCustomTypes = new QStringList(); + *currentCustomTypes = customTypes; const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, NSFilenamesPboardType, NSStringPboardType, @@ -228,13 +235,10 @@ extern "C" { NSFilesPromisePboardType, NSInkTextPboardType, NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; // Add custom types supported by the application. - const QStringList& customTypes = qEnabledDraggedTypes(); for (int i = 0; i < customTypes.size(); i++) { [supportedTypes addObject:reinterpret_cast<const NSString *>(QCFString::toCFStringRef(customTypes[i]))]; } [self registerForDraggedTypes:supportedTypes]; - } else { - [self unregisterDraggedTypes]; } } @@ -283,6 +287,8 @@ extern "C" { - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { + if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; [self addDropData:sender]; QMimeData *mimeData = dropData; if (QDragManager::self()->source()) @@ -416,6 +422,8 @@ extern "C" { { delete composingText; [[NSNotificationCenter defaultCenter] removeObserver:self]; + delete currentCustomTypes; + [self unregisterDraggedTypes]; [super dealloc]; } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index ec1281e..1d4e3e4 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -84,6 +84,7 @@ Q_GUI_EXPORT int composingLength; bool sendKeyEvents; QString *composingText; + QStringList *currentCustomTypes; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; - (void) finishInitWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -92,7 +93,7 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; -- (void)registerDragTypes:(bool)accept; +- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id <NSDraggingInfo>)sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp index e2d6108..a665c89 100644 --- a/src/gui/kernel/qformlayout.cpp +++ b/src/gui/kernel/qformlayout.cpp @@ -689,12 +689,16 @@ void QFormLayoutPrivate::setupVerticalLayoutData(int width) // are split. maxLabelWidth = 0; if (!wrapAllRows) { + int maxFieldMinWidth = 0; //the maximum minimum size of the field for (int i = 0; i < rr; ++i) { const QFormLayoutItem *label = m_matrix(i, 0); const QFormLayoutItem *field = m_matrix(i, 1); - if (label && (label->sizeHint.width() + (field ? field->minSize.width() : 0) <= width)) + if (label && field && label->sideBySide) maxLabelWidth = qMax(maxLabelWidth, label->sizeHint.width()); + if (field) + maxFieldMinWidth = qMax(maxFieldMinWidth, field->minSize.width() + field->sbsHSpace); } + maxLabelWidth = qMin(maxLabelWidth, width - maxFieldMinWidth); } else { maxLabelWidth = width; } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index f000292..9165836 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -826,13 +826,28 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev QWidget *qwidget = [theView qt_qwidget]; QWidget *widgetToGetMouse = qwidget; QWidget *popup = qAppInstance()->activePopupWidget(); - if (popup && popup != qwidget->window()) - widgetToGetMouse = popup; NSView *tmpView = theView; - if (widgetToGetMouse != qwidget) { - tmpView = qt_mac_nativeview_for(widgetToGetMouse); + + if (popup && popup != qwidget->window()) { + widgetToGetMouse = popup; + tmpView = qt_mac_nativeview_for(popup); windowPoint = [[tmpView window] convertScreenToBase:globalPoint]; + + QPoint qWindowPoint(windowPoint.x, windowPoint.y); + if (widgetToGetMouse->rect().contains(qWindowPoint)) { + // Keeping the mouse pressed on a combobox button will make + // the popup pop in front of the mouse. But all mouse events + // will be sendt to the button. Since we want mouse events + // to be sendt to widgets inside the popup, we search for the + // widget in front of the mouse: + tmpView = [tmpView hitTest:windowPoint]; + if (!tmpView) + return false; + widgetToGetMouse = + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(tmpView) qt_qwidget]; + } } + NSPoint localPoint = [tmpView convertPoint:windowPoint fromView:nil]; QPoint qlocalPoint(localPoint.x, localPoint.y); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dd95053..cbf9585 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4810,7 +4810,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, Q_ASSERT(engine); QPaintEnginePrivate *enginePriv = engine->d_func(); Q_ASSERT(enginePriv); - QPaintDevice *target = painter->worldMatrixEnabled() ? engine->paintDevice() : painter->device(); + QPaintDevice *target = engine->paintDevice(); Q_ASSERT(target); // Render via a pixmap when dealing with non-opaque painters or printers. diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9da0b6b..1896b97 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4491,8 +4491,8 @@ void QWidgetPrivate::registerDropSite(bool on) SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else NSView *view = qt_mac_nativeview_for(q); - if ([view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes:on]; + if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes]; } #endif } diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp index 6329135..ae93efe 100644 --- a/src/gui/kernel/qx11embed_x11.cpp +++ b/src/gui/kernel/qx11embed_x11.cpp @@ -1297,9 +1297,6 @@ bool QX11EmbedContainer::eventFilter(QObject *o, QEvent *event) // focus is set to our focus proxy. We want to intercept all // keypresses. if (o == window() && d->client) { - if (!d->isEmbedded() && d->activeContainer == this) - d->moveInputToProxy(); - if (d->clientIsXEmbed) { sendXEmbedMessage(d->client, x11Info().display(), XEMBED_WINDOW_ACTIVATE); } else { @@ -1307,6 +1304,8 @@ bool QX11EmbedContainer::eventFilter(QObject *o, QEvent *event) if (hasFocus()) XSetInputFocus(x11Info().display(), d->client, XRevertToParent, x11Time()); } + if (!d->isEmbedded()) + d->moveInputToProxy(); } break; case QEvent::WindowDeactivate: @@ -1729,10 +1728,10 @@ void QX11EmbedContainerPrivate::acceptClient(WId window) checkGrab(); if (q->hasFocus()) { XSetInputFocus(q->x11Info().display(), client, XRevertToParent, x11Time()); - } else { - if (!isEmbedded()) - moveInputToProxy(); } + } else { + if (!isEmbedded()) + moveInputToProxy(); } emit q->clientIsEmbedded(); @@ -1749,11 +1748,9 @@ void QX11EmbedContainerPrivate::acceptClient(WId window) void QX11EmbedContainerPrivate::moveInputToProxy() { Q_Q(QX11EmbedContainer); - WId focus; - int revert_to; - XGetInputFocus(q->x11Info().display(), &focus, &revert_to); - if (focus != focusProxy->internalWinId()) - XSetInputFocus(q->x11Info().display(), focusProxy->internalWinId(), XRevertToParent, x11Time()); + // Following Owen Taylor's advice from the XEmbed specification to + // always use CurrentTime when no explicit user action is involved. + XSetInputFocus(q->x11Info().display(), focusProxy->internalWinId(), XRevertToParent, CurrentTime); } /*! \internal diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index 16dd617..8f4a2bf 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -44,8 +44,6 @@ QT_BEGIN_NAMESPACE -static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; - struct SourceOnlyAlpha { inline uchar alpha(uchar src) const { return src; } @@ -140,14 +138,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha { template <typename SRC, typename T> void qt_scale_image_16bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); @@ -617,14 +612,11 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha { template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8077b9b..3428faf 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2577,7 +2577,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe QRasterPaintEngineState *s = state(); const bool aa = s->flags.antialiased || s->flags.bilinear; if (!aa && sr.size() == QSize(1, 1)) { - fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + // as fillRect will apply the aliased coordinate delta we need to + // subtract it here as we don't use it for image drawing + const QRectF targetRect = r.translated(-aliasedCoordinateDelta, + -aliasedCoordinateDelta); + fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); return; } diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 4b2fbca..9cc9683 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1543,6 +1543,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p QX11PaintEnginePrivate::GCMode gcMode, QPaintEngine::PolygonDrawMode mode) { + Q_Q(QX11PaintEngine); + int clippedCount = 0; qt_float_point *clippedPoints = 0; @@ -1617,7 +1619,29 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p } else #endif if (fill.style() != Qt::NoBrush) { - if (clippedCount > 0) { + if (clippedCount > 200000) { + QPolygon poly; + for (int i = 0; i < clippedCount; ++i) + poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y)); + + const QRect bounds = poly.boundingRect(); + const QRect aligned = bounds + & QRect(QPoint(), QSize(pdev->width(), pdev->height())); + + QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied); + img.fill(0); + + QPainter painter(&img); + painter.translate(-aligned.x(), -aligned.y()); + painter.setPen(Qt::NoPen); + painter.setBrush(fill); + if (gcMode == BrushGC) + painter.setBrushOrigin(q->painter()->brushOrigin()); + painter.drawPolygon(poly); + painter.end(); + + q->drawImage(aligned, img, img.rect(), Qt::AutoColor); + } else if (clippedCount > 0) { QVarLengthArray<XPoint> xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { xpoints[i].x = qFloor(clippedPoints[i].x); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ebddfd5..dcc11b8 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4758,7 +4758,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_LineEdit: #ifndef QT_NO_SPINBOX // ### hopelessly broken QAbstractSpinBox (part 2) - if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w->parentWidget())) { + if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) { QRenderRule rule = renderRule(spinBox, opt); if (rule.hasBox() || !rule.hasNativeBorder()) return csz; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 47fe5c2..d7a9c23 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -624,6 +624,45 @@ QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int /* margin */, const Q return rgbMask; } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) +{ + glyph_metrics_t gm = boundingBox(glyph); + int glyph_x = qFloor(gm.x.toReal()); + int glyph_y = qFloor(gm.y.toReal()); + int glyph_width = qCeil((gm.x + gm.width).toReal()) - glyph_x; + int glyph_height = qCeil((gm.y + gm.height).toReal()) - glyph_y; + + if (glyph_width <= 0 || glyph_height <= 0) + return QImage(); + QFixedPoint pt; + pt.x = 0; + pt.y = -glyph_y; // the baseline + QPainterPath path; + QImage im(glyph_width + qAbs(glyph_x) + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); + im.fill(Qt::transparent); + QPainter p(&im); + p.setRenderHint(QPainter::Antialiasing); + addGlyphsToPath(&glyph, &pt, 1, &path, 0); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawPath(path); + p.end(); + + QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); + QVector<QRgb> colors(256); + for (int i=0; i<256; ++i) + colors[i] = qRgba(0, 0, 0, i); + indexed.setColorTable(colors); + + for (int y=0; y<im.height(); ++y) { + uchar *dst = (uchar *) indexed.scanLine(y); + uint *src = (uint *) im.scanLine(y); + for (int x=0; x<im.width(); ++x) + dst[x] = qAlpha(src[x]); + } + + return indexed; +} void QFontEngine::removeGlyphFromCache(glyph_t) { diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index cb0b436..de03a3c 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1788,9 +1788,11 @@ QImage QFontEngineFT::alphaMapForGlyph(glyph_t g) GlyphFormat glyph_format = antialias ? Format_A8 : Format_Mono; - Glyph *glyph = loadGlyph(g, glyph_format); - if (!glyph) - return QImage(); + Glyph *glyph = defaultGlyphSet.outline_drawing ? 0 : loadGlyph(g, glyph_format); + if (!glyph) { + unlockFace(); + return QFontEngine::alphaMapForGlyph(g); + } const int pitch = antialias ? (glyph->width + 3) & ~3 : ((glyph->width + 31)/32) * 4; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 8f6b92a..92efb6c 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -178,7 +178,7 @@ public: * Create a qimage with the alpha values for the glyph. * Returns an image indexed_8 with index values ranging from 0=fully transparant to 255=opaque */ - virtual QImage alphaMapForGlyph(glyph_t) = 0; + virtual QImage alphaMapForGlyph(glyph_t); virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index c327b9f..48963bb 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1074,7 +1074,10 @@ QTextCursor::QTextCursor(const QTextCursor &cursor) } /*! - Makes a copy of \a cursor and assigns it to this QTextCursor. + Makes a copy of \a cursor and assigns it to this QTextCursor. Note + that QTextCursor is an \l{Implicitly Shared Classes}{implicitly + shared} class. + */ QTextCursor &QTextCursor::operator=(const QTextCursor &cursor) { diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index e84b324..873f846 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -287,7 +287,7 @@ QTextCodec *Qt::codecForHtml(const QByteArray &ba) that inform connected editor widgets about the state of the undo/redo system. - \sa QTextCursor QTextEdit \link richtext.html Rich Text Processing\endlink + \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example} */ /*! diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index 3f4c8e5..71b68e0 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE objects, you will also need to reimplement QTextDocument::createObject() which acts as a factory method for creating text objects. - \sa QTextDocument + \sa QTextDocument, {Text Object Example} */ /*! diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 1afb28a..502c1e9 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -480,9 +480,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->hide(); oldMenuBar->deleteLater(); } -#ifdef Q_WS_WINCE - if (menuBar && menuBar->size().height() > 0) -#endif d->layout->setMenuBar(menuBar); } diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index a51ed2d..14efd23 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -629,7 +629,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx) if (viewport->updatesEnabled() && viewport->isVisible()) { int dy = 0; - if (doc->findBlockByLineNumber(control->topBlock).isValid()) { + if (doc->findBlockByNumber(control->topBlock).isValid()) { dy = (int)(-q->blockBoundingGeometry(block).y()) + verticalOffset() - verticalOffset(blockNumber, lineNumber); } diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index ce1ac09..0b4ce9d 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1084,7 +1084,7 @@ void QTabBar::setTabData(int index, const QVariant & data) } /*! - Returns the datad of the tab at position \a index, or a null + Returns the data of the tab at position \a index, or a null variant if \a index is out of range. */ QVariant QTabBar::tabData(int index) const @@ -2223,6 +2223,7 @@ void QTabBar::setTabButton(int index, ButtonPosition position, QWidget *widget) d->tabList[index].rightWidget = widget; } d->layoutTabs(); + d->refresh(); update(); } diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 14a04f1..d42370d 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -193,7 +193,11 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) } else { QString templateName = d->tmpCacheFileName(); cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); - cacheItem->file->open(); + if (!cacheItem->file->open()) { + qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file"; + delete cacheItem; + return 0; + } cacheItem->writeHeader(cacheItem->file); device = cacheItem->file; } @@ -231,7 +235,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem) if (QFile::exists(fileName)) { if (!QFile::remove(fileName)) { - qWarning() << "QNetworkDiskCache: could't remove the cache file " << fileName; + qWarning() << "QNetworkDiskCache: couldn't remove the cache file " << fileName; return; } } diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp index d6b1507..77a999b 100644 --- a/src/network/socket/qlocalserver.cpp +++ b/src/network/socket/qlocalserver.cpp @@ -276,9 +276,13 @@ QLocalSocket *QLocalServer::nextPendingConnection() if (d->pendingConnections.isEmpty()) return 0; QLocalSocket *nextSocket = d->pendingConnections.dequeue(); +#ifndef QT_LOCALSOCKET_TCP + if (d->pendingConnections.size() <= d->maxPendingConnections) #ifndef Q_OS_WIN - d->socketNotifier->setEnabled(d->pendingConnections.size() - <= d->maxPendingConnections); + d->socketNotifier->setEnabled(true); +#else + d->connectionEventNotifier->setEnabled(true); +#endif #endif return nextSocket; } diff --git a/src/network/socket/qlocalserver.h b/src/network/socket/qlocalserver.h index 8e8babd..1488a75 100644 --- a/src/network/socket/qlocalserver.h +++ b/src/network/socket/qlocalserver.h @@ -86,15 +86,7 @@ protected: private: Q_DISABLE_COPY(QLocalServer) -#if defined(QT_LOCALSOCKET_TCP) Q_PRIVATE_SLOT(d_func(), void _q_onNewConnection()) -#elif defined(Q_OS_WIN) - Q_PRIVATE_SLOT(d_func(), void _q_openSocket(HANDLE handle)) - Q_PRIVATE_SLOT(d_func(), void _q_stoppedListening()) - Q_PRIVATE_SLOT(d_func(), void _q_setError(QAbstractSocket::SocketError error, const QString &errorString)) -#else - Q_PRIVATE_SLOT(d_func(), void _q_socketActivated()) -#endif }; #endif // QT_NO_LOCALSERVER diff --git a/src/network/socket/qlocalserver_p.h b/src/network/socket/qlocalserver_p.h index 8e96401..7b31082 100644 --- a/src/network/socket/qlocalserver_p.h +++ b/src/network/socket/qlocalserver_p.h @@ -63,7 +63,7 @@ # include <qtcpserver.h> #elif defined(Q_OS_WIN) # include <qt_windows.h> -# include <qthread.h> +# include <private/qwineventnotifier_p.h> #else # include <private/qnativesocketengine_p.h> # include <qsocketnotifier.h> @@ -71,52 +71,13 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP) - -/*! - \internal - QLocalServerThread exists because Windows does not have a - way to provide notifications when there is a new connections to - the server. - */ -class QLocalServerThread : public QThread -{ - Q_OBJECT - -Q_SIGNALS: - void connected(HANDLE newSocket); - void error(QAbstractSocket::SocketError error, const QString &errorString); - -public: - QLocalServerThread(QObject *parent = 0); - ~QLocalServerThread(); - void closeServer(); - -public: - QString setName(const QString &name); - void run(); - void stop(); - bool makeHandle(); - - HANDLE gotConnectionEvent; - QQueue<HANDLE> pendingHandles; - int maxPendingConnections; -private: - HANDLE stopEvent; - QString fullServerName; -}; - -#endif - class QLocalServerPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QLocalServer) public: QLocalServerPrivate() : -#if defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP) - inWaitingFunction(false), -#elif !defined(QT_LOCALSOCKET_TCP) +#if !defined(QT_LOCALSOCKET_TCP) && !defined(Q_OS_WIN) listenSocket(-1), socketNotifier(0), #endif maxPendingConnections(30), error(QAbstractSocket::UnknownSocketError) @@ -128,22 +89,26 @@ public: static bool removeServer(const QString &name); void closeServer(); void waitForNewConnection(int msec, bool *timedOut); + void _q_onNewConnection(); #if defined(QT_LOCALSOCKET_TCP) - void _q_onNewConnection(); QTcpServer tcpServer; QMap<quintptr, QTcpSocket*> socketMap; #elif defined(Q_OS_WIN) - void _q_openSocket(HANDLE socket); - void _q_stoppedListening(); - void _q_setError(QAbstractSocket::SocketError error, const QString &errorString); + struct Listener { + HANDLE handle; + OVERLAPPED overlapped; + }; + + void setError(const QString &function); + bool addListener(); - QLocalServerThread waitForConnection; - bool inWaitingFunction; + QList<Listener> listeners; + HANDLE eventHandle; + QWinEventNotifier *connectionEventNotifier; #else void setError(const QString &function); - void _q_socketActivated(); int listenSocket; QSocketNotifier *socketNotifier; diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index e7d2252..53ee6b6 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -132,7 +132,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName) socketNotifier = new QSocketNotifier(listenSocket, QSocketNotifier::Read, q); q->connect(socketNotifier, SIGNAL(activated(int)), - q, SLOT(_q_socketActivated())); + q, SLOT(_q_onNewConnection())); socketNotifier->setEnabled(maxPendingConnections > 0); return true; } @@ -164,7 +164,7 @@ void QLocalServerPrivate::closeServer() We have received a notification that we can read on the listen socket. Accept the new socket. */ -void QLocalServerPrivate::_q_socketActivated() +void QLocalServerPrivate::_q_onNewConnection() { Q_Q(QLocalServer); if (-1 == listenSocket) @@ -209,7 +209,7 @@ void QLocalServerPrivate::waitForNewConnection(int msec, bool *timedOut) break; } if (result > 0) - _q_socketActivated(); + _q_onNewConnection(); } if (timedOut) *timedOut = (result == 0); diff --git a/src/network/socket/qlocalserver_win.cpp b/src/network/socket/qlocalserver_win.cpp index 880cd7e..b14bbf7 100644 --- a/src/network/socket/qlocalserver_win.cpp +++ b/src/network/socket/qlocalserver_win.cpp @@ -44,68 +44,26 @@ #include "qlocalsocket.h" #include <qdebug.h> -#include <qdatetime.h> -#include <qcoreapplication.h> -#include <QMetaType> // The buffer size need to be 0 otherwise data could be // lost if the socket that has written data closes the connection // before it is read. Pipewriter is used for write buffering. #define BUFSIZE 0 -QT_BEGIN_NAMESPACE - -QLocalServerThread::QLocalServerThread(QObject *parent) : QThread(parent), - maxPendingConnections(1) -{ - stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - gotConnectionEvent = CreateEvent(NULL, TRUE, FALSE, NULL); -} +// ###: This should be a property. Should replace the insane 50 on unix as well. +#define SYSTEM_MAX_PENDING_SOCKETS 8 -QLocalServerThread::~QLocalServerThread() -{ - stop(); - closeServer(); - CloseHandle(stopEvent); - CloseHandle(gotConnectionEvent); -} - -void QLocalServerThread::stop() -{ - if (isRunning()) { - SetEvent(stopEvent); - wait(); - ResetEvent(stopEvent); - } -} - -void QLocalServerThread::closeServer() -{ - while (!pendingHandles.isEmpty()) - CloseHandle(pendingHandles.dequeue()); -} - -QString QLocalServerThread::setName(const QString &name) -{ - QString pipePath = QLatin1String("\\\\.\\pipe\\"); - if (name.startsWith(pipePath)) - fullServerName = name; - else - fullServerName = pipePath + name; - for (int i = pendingHandles.count(); i < maxPendingConnections; ++i) - if (!makeHandle()) - break; - return fullServerName; -} +QT_BEGIN_NAMESPACE -bool QLocalServerThread::makeHandle() +bool QLocalServerPrivate::addListener() { - if (pendingHandles.count() >= maxPendingConnections) - return false; + // The object must not change its address once the + // contained OVERLAPPED struct is passed to Windows. + listeners << Listener(); + Listener &listener = listeners.last(); - HANDLE handle = INVALID_HANDLE_VALUE; QT_WA({ - handle = CreateNamedPipeW( + listener.handle = CreateNamedPipeW( (TCHAR*)fullServerName.utf16(), // pipe name PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access PIPE_TYPE_MESSAGE | // message type pipe @@ -117,7 +75,7 @@ bool QLocalServerThread::makeHandle() 3000, // client time-out NULL); }, { - handle = CreateNamedPipeA( + listener.handle = CreateNamedPipeA( fullServerName.toLocal8Bit().constData(), // pipe name PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access PIPE_TYPE_MESSAGE | // message type pipe @@ -129,68 +87,43 @@ bool QLocalServerThread::makeHandle() 3000, // client time-out NULL); }); - - if (INVALID_HANDLE_VALUE == handle) { + if (listener.handle == INVALID_HANDLE_VALUE) { + setError(QLatin1String("QLocalServerPrivate::addListener")); + listeners.removeLast(); return false; } - pendingHandles.enqueue(handle); + + memset(&listener.overlapped, 0, sizeof(listener.overlapped)); + listener.overlapped.hEvent = eventHandle; + if (!ConnectNamedPipe(listener.handle, &listener.overlapped)) { + switch (GetLastError()) { + case ERROR_IO_PENDING: + break; + case ERROR_PIPE_CONNECTED: + SetEvent(eventHandle); + break; + default: + CloseHandle(listener.handle); + setError(QLatin1String("QLocalServerPrivate::addListener")); + listeners.removeLast(); + return false; + } + } else { + Q_ASSERT_X(false, "QLocalServerPrivate::addListener", "The impossible happened"); + SetEvent(eventHandle); + } return true; } -void QLocalServerThread::run() +void QLocalServerPrivate::setError(const QString &function) { - OVERLAPPED op; - HANDLE handleArray[2]; - memset(&op, 0, sizeof(op)); - handleArray[0] = op.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - handleArray[1] = stopEvent; - HANDLE handle = INVALID_HANDLE_VALUE; - - forever { - if (INVALID_HANDLE_VALUE == handle) { - makeHandle(); - if (!pendingHandles.isEmpty()) - handle = pendingHandles.dequeue(); - } - if (INVALID_HANDLE_VALUE == handle) { - int windowsError = GetLastError(); - QString function = QLatin1String("QLocalServer::run"); - QString errorString = QLocalServer::tr("%1: Unknown error %2").arg(function).arg(windowsError); - emit error(QAbstractSocket::UnknownSocketError, errorString); - CloseHandle(handleArray[0]); - SetEvent(gotConnectionEvent); - return; - } - - BOOL isConnected = ConnectNamedPipe(handle, &op) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); - if (!isConnected) { - switch (WaitForMultipleObjects(2, handleArray, FALSE, INFINITE)) - { - case WAIT_OBJECT_0 + 1: - CloseHandle(handle); - CloseHandle(handleArray[0]); - return; - } - } - emit connected(handle); - handle = INVALID_HANDLE_VALUE; - ResetEvent(handleArray[0]); - SetEvent(gotConnectionEvent); - } + int windowsError = GetLastError(); + errorString = QString::fromLatin1("%1: %2").arg(function).arg(qt_error_string(windowsError)); + error = QAbstractSocket::UnknownSocketError; } void QLocalServerPrivate::init() { - Q_Q(QLocalServer); - qRegisterMetaType<HANDLE>("HANDLE"); - q->connect(&waitForConnection, SIGNAL(connected(HANDLE)), - q, SLOT(_q_openSocket(HANDLE)), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(finished()), - q, SLOT(_q_stoppedListening()), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(terminated()), - q, SLOT(_q_stoppedListening()), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(error(QAbstractSocket::SocketError, const QString &)), - q, SLOT(_q_setError(QAbstractSocket::SocketError, const QString &))); } bool QLocalServerPrivate::removeServer(const QString &name) @@ -201,35 +134,71 @@ bool QLocalServerPrivate::removeServer(const QString &name) bool QLocalServerPrivate::listen(const QString &name) { - fullServerName = waitForConnection.setName(name); - serverName = name; - waitForConnection.start(); - return true; -} + Q_Q(QLocalServer); -void QLocalServerPrivate::_q_setError(QAbstractSocket::SocketError e, const QString &eString) -{ - error = e; - errorString = eString; -} + QString pipePath = QLatin1String("\\\\.\\pipe\\"); + if (name.startsWith(pipePath)) + fullServerName = name; + else + fullServerName = pipePath + name; -void QLocalServerPrivate::_q_stoppedListening() -{ - Q_Q(QLocalServer); - if (!inWaitingFunction) - q->close(); + // Use only one event for all listeners of one socket. + // The idea is that listener events are rare, so polling all listeners once in a while is + // cheap compared to waiting for N additional events in each iteration of the main loop. + eventHandle = CreateEvent(NULL, TRUE, FALSE, NULL); + connectionEventNotifier = new QWinEventNotifier(eventHandle , q); + q->connect(connectionEventNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_onNewConnection())); + + for (int i = 0; i < SYSTEM_MAX_PENDING_SOCKETS; ++i) + if (!addListener()) + return false; + return true; } -void QLocalServerPrivate::_q_openSocket(HANDLE handle) +void QLocalServerPrivate::_q_onNewConnection() { Q_Q(QLocalServer); - q->incomingConnection((int)handle); + DWORD dummy; + + // Reset first, otherwise we could reset an event which was asserted + // immediately after we checked the conn status. + ResetEvent(eventHandle); + + // Testing shows that there is indeed absolutely no guarantee which listener gets + // a client connection first, so there is no way around polling all of them. + for (int i = 0; i < listeners.size(); ) { + HANDLE handle = listeners[i].handle; + if (GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, FALSE)) { + listeners.removeAt(i); + + addListener(); + + if (pendingConnections.size() > maxPendingConnections) + connectionEventNotifier->setEnabled(false); + + // Make this the last thing so connected slots can wreak the least havoc + q->incomingConnection((quintptr)handle); + } else { + if (GetLastError() != ERROR_IO_INCOMPLETE) { + setError(QLatin1String("QLocalServerPrivate::_q_onNewConnection")); + closeServer(); + return; + } + + ++i; + } + } } void QLocalServerPrivate::closeServer() { - waitForConnection.stop(); - waitForConnection.closeServer(); + connectionEventNotifier->setEnabled(false); // Otherwise, closed handle is checked before deleter runs + connectionEventNotifier->deleteLater(); + connectionEventNotifier = 0; + CloseHandle(eventHandle); + for (int i = 0; i < listeners.size(); ++i) + CloseHandle(listeners[i].handle); + listeners.clear(); } void QLocalServerPrivate::waitForNewConnection(int msecs, bool *timedOut) @@ -238,14 +207,12 @@ void QLocalServerPrivate::waitForNewConnection(int msecs, bool *timedOut) if (!pendingConnections.isEmpty() || !q->isListening()) return; - DWORD result = WaitForSingleObject(waitForConnection.gotConnectionEvent, - (msecs == -1) ? INFINITE : msecs); + DWORD result = WaitForSingleObject(eventHandle, (msecs == -1) ? INFINITE : msecs); if (result == WAIT_TIMEOUT) { if (timedOut) *timedOut = true; } else { - ResetEvent(waitForConnection.gotConnectionEvent); - QCoreApplication::instance()->processEvents(); + _q_onNewConnection(); } } diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 505c662..7fec2df 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -64,9 +64,9 @@ #ifndef QT_NO_DEBUG_STREAM #include <QtCore/qdebug.h> +#endif QT_BEGIN_NAMESPACE -#endif /*! Constructs an empty QSslCipher object. diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 77ff9fb..aee351d 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5067,9 +5067,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte // fall back to drawing a polygon if the scale factor is large, or // we use a gradient pen - if (ti.fontEngine->fontDef.pixelSize >= 64 - || (d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern - && d->pen_brush_style <= Qt::ConicalGradientPattern)) { + if ((d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern + && d->pen_brush_style <= Qt::ConicalGradientPattern)) { QPaintEngine::drawTextItem(p, textItem); return; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 6d8f617..91a60e7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -80,7 +80,7 @@ template <typename T> inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr<bool>(const bool &) { return 0; } template <typename device, typename T1, typename T2, typename T3> static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - QDirectFBPaintEnginePrivate::Scale scale, bool matrixRotShear, bool simplePen, + int scale, bool matrixRotShear, bool simplePen, bool dfbHandledClip, bool forceRasterPrimitives, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, @@ -211,6 +211,8 @@ static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { public: + enum Scale { NoScale, Scaled, NegativeScale }; + QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p); ~QDirectFBPaintEnginePrivate(); @@ -266,7 +268,7 @@ private: bool simplePen; bool matrixRotShear; - enum Scale { NoScale, Scaled, NegativeScale } scale; + Scale scale; SurfaceCache *surfaceCache; QTransform transform; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 25e24fd..f571d1b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -818,7 +818,7 @@ static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags -static void printDirectFBInfo(IDirectFB *fb) +static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) { DFBResult result; DFBGraphicsDeviceDescription dev; @@ -829,10 +829,14 @@ static void printDirectFBInfo(IDirectFB *fb) return; } - qDebug("Device: %s (%s), Driver: %s v%i.%i (%s)\n" + DFBSurfacePixelFormat pixelFormat; + primarySurface->GetPixelFormat(primarySurface, &pixelFormat); + + qDebug("Device: %s (%s), Driver: %s v%i.%i (%s) Pixelformat: %d (%d)\n" "acceleration: 0x%x%s\nblit: 0x%x%s\ndraw: 0x%0x%s\nvideo: %iKB\n", dev.name, dev.vendor, dev.driver.name, dev.driver.major, - dev.driver.minor, dev.driver.vendor, dev.acceleration_mask, + dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat), + QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask, ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), @@ -883,9 +887,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } - if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) - printDirectFBInfo(d_ptr->dfb); - if (displayArgs.contains(QLatin1String("videoonly"), Qt::CaseInsensitive)) d_ptr->directFBFlags |= VideoOnly; @@ -952,6 +953,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } + if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) + printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); + // Work out what format we're going to use for surfaces with an alpha channel d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface); setPixelFormat(d_ptr->alphaPixmapFormat); diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index c053c30..a1a6d52 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -158,7 +158,10 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XFail) { QTestElement *failureElement = new QTestElement(QTest::LET_Failure); failureElement->addAttribute(QTest::AI_Result, typeBuf); - failureElement->addAttribute(QTest::AI_File, file); + if(file) + failureElement->addAttribute(QTest::AI_File, file); + else + failureElement->addAttribute(QTest::AI_File, ""); QTest::qt_snprintf(buf, sizeof(buf), "%i", line); failureElement->addAttribute(QTest::AI_Line, buf); failureElement->addAttribute(QTest::AI_Description, description); diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index cf99b96..055abe0 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -54,7 +54,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted) QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag), sizeof(cdataTag)); QTest::qt_snprintf(formatted, 1024, "<Incident type=\"%s\" %s>\n" - " <DataTag><![CDATA[%s]]></Description>\n" + " <DataTag><![CDATA[%s]]></DataTag>\n" " <Description><![CDATA[%s]]></Description>\n" "</Incident>\n", element->attributeValue(QTest::AI_Result), location, cdataTag, cdataDesc); |