From beab75abef7dfb221418ca3b3e04e918f175d32f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 8 May 2009 13:09:56 +1000 Subject: highlight color property --- src/declarative/fx/qfxtextedit.cpp | 30 ++++++++++++++++++++++++++++++ src/declarative/fx/qfxtextedit.h | 4 ++++ src/declarative/fx/qfxtextedit_p.h | 1 + 3 files changed, 35 insertions(+) diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 3bc9696..fb46a0e 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -292,6 +292,36 @@ void QFxTextEdit::setColor(const QColor &color) } /*! + \qmlproperty color TextEdit::highlightColor + + The text highlight color, used behind selections. +*/ + +/*! + \property QFxTextEdit::highlightColor + \brief the text edit's default text highlight color +*/ +QColor QFxTextEdit::highlightColor() const +{ + Q_D(const QFxTextEdit); + return d->highlightColor; +} + +void QFxTextEdit::setHighlightColor(const QColor &color) +{ + Q_D(QFxTextEdit); + if (d->highlightColor == color) + return; + + clearCache(); + d->highlightColor = color; + QPalette pal = d->control->palette(); + pal.setColor(QPalette::Highlight, color); + d->control->setPalette(pal); + update(); +} + +/*! \qmlproperty enumeration TextEdit::hAlign \qmlproperty enumeration TextEdit::vAlign diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h index 068a25a..5d95cd1 100644 --- a/src/declarative/fx/qfxtextedit.h +++ b/src/declarative/fx/qfxtextedit.h @@ -69,6 +69,7 @@ class Q_DECLARATIVE_EXPORT QFxTextEdit : public QFxPaintedItem Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setHighlightColor) Q_PROPERTY(QmlFont * font READ font) Q_PROPERTY(HAlignment hAlign READ hAlign WRITE setHAlign) Q_PROPERTY(VAlignment vAlign READ vAlign WRITE setVAlign) @@ -111,6 +112,9 @@ public: QColor color() const; void setColor(const QColor &c); + QColor highlightColor() const; + void setHighlightColor(const QColor &c); + HAlignment hAlign() const; void setHAlign(HAlignment align); diff --git a/src/declarative/fx/qfxtextedit_p.h b/src/declarative/fx/qfxtextedit_p.h index f4591f5..dd2a1bf 100644 --- a/src/declarative/fx/qfxtextedit_p.h +++ b/src/declarative/fx/qfxtextedit_p.h @@ -80,6 +80,7 @@ public: QString text; QmlFont font; QColor color; + QColor highlightColor; QString style; QColor styleColor; bool imgDirty; -- cgit v0.12 From 0aa5eae761bfde781100602577f33cf667a0640d Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 8 May 2009 13:10:17 +1000 Subject: highlight in tune with background image --- demos/declarative/flickr/content/MediaLineEdit.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/declarative/flickr/content/MediaLineEdit.qml b/demos/declarative/flickr/content/MediaLineEdit.qml index 37caf24..691bb5b 100644 --- a/demos/declarative/flickr/content/MediaLineEdit.qml +++ b/demos/declarative/flickr/content/MediaLineEdit.qml @@ -89,6 +89,7 @@ Item { id: Editor font.bold: true color: "white" + highlightColor: "green" width: 0 clip: true anchors.left: Label.right -- cgit v0.12 From 9dcc7f9fea95d41f82fdde700f1a17da81257451 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 8 May 2009 13:36:19 +1000 Subject: Remove non-working scale-to-width code. This does not belong here. Zooming can be done by parent. Also, it doesn't work. (was previously also removed from QFxWebView) --- src/declarative/fx/qfxpainteditem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp index 950b468..4d2e327 100644 --- a/src/declarative/fx/qfxpainteditem.cpp +++ b/src/declarative/fx/qfxpainteditem.cpp @@ -252,9 +252,7 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) const QRectF clipf = p.sceneClipRect; #endif - qreal hscale = widthValid() ? qreal(width()) / content.width() : heightValid() ? qreal(height()) / content.height() : 1.0; - qreal vscale = heightValid() ? qreal(height()) / content.height() : widthValid() ? qreal(width()) / content.width() : 1.0; - const QRect clip = mapFromScene(QRectF(clipf.x()/hscale,clipf.y()/vscale,clipf.width()/hscale,clipf.height()/vscale)).toRect(); + const QRect clip = mapFromScene(clipf).toRect(); QRegion topaint(clip); topaint &= content; @@ -272,7 +270,7 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) for (int i=0; iimagecache.count(); ++i) { QRect area = d->imagecache[i]->area; if (topaint.contains(area)) { - QRectF target(area.x()*hscale, area.y()*vscale, area.width()*hscale, area.height()*vscale); + QRectF target(area.x(), area.y(), area.width(), area.height()); p.drawImage(target.toRect(), d->imagecache[i]->image); topaint -= area; d->imagecache[i]->age=0; @@ -324,7 +322,7 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) newitem->image.setImage(img); #endif d->imagecache.append(newitem); - QRectF target(r.x()*hscale, r.y()*vscale, r.width()*hscale, r.height()*vscale); + QRectF target(r.x(), r.y(), r.width(), r.height()); p.drawImage(target.toRect(), newitem->image); } } -- cgit v0.12 From 0a06e7437763fca81d77c4fdd938a3c1aa890ed2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 May 2009 14:28:17 +1000 Subject: Fix removal of items that span a range greater than the visible range. --- src/declarative/fx/qfxflickable.cpp | 4 +++ src/declarative/fx/qfxlistview.cpp | 49 +++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp index 890bb31..4ace811 100644 --- a/src/declarative/fx/qfxflickable.cpp +++ b/src/declarative/fx/qfxflickable.cpp @@ -129,10 +129,12 @@ void QFxFlickablePrivate::fixupX() vTime = _tl.time(); if (_moveX.value() > q->minXExtent() || q->maxXExtent() > 0) { + _tl.clear(); _tl.move(_moveX, q->minXExtent(), QEasingCurve(QEasingCurve::InOutQuad), 200); flicked = false; //emit flickingChanged(); } else if (_moveX.value() < q->maxXExtent()) { + _tl.clear(); _tl.move(_moveX, q->maxXExtent(), QEasingCurve(QEasingCurve::InOutQuad), 200); flicked = false; //emit flickingChanged(); @@ -148,9 +150,11 @@ void QFxFlickablePrivate::fixupY() vTime = _tl.time(); if (_moveY.value() > q->minYExtent() || (q->maxYExtent() > q->minYExtent())) { + _tl.clear(); _tl.move(_moveY, q->minYExtent(), QEasingCurve(QEasingCurve::InOutQuad), 200); //emit flickingChanged(); } else if (_moveY.value() < q->maxYExtent()) { + _tl.clear(); _tl.move(_moveY, q->maxYExtent(), QEasingCurve(QEasingCurve::InOutQuad), 200); //emit flickingChanged(); } else { diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index ad752a7..bb71a91 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -293,6 +293,29 @@ public: } return -1; // Not in visibleList } + + bool mapRangeFromModel(int &index, int &count) const { + if (index + count < visibleIndex) + return false; + + int lastIndex = -1; + for (int i = visibleItems.count()-1; i >= 0; --i) { + FxListItem *listItem = visibleItems.at(i); + if (listItem->index != -1) { + lastIndex = listItem->index; + break; + } + } + + if (index > lastIndex) + return false; + + int last = qMin(index + count - 1, lastIndex); + index = qMax(index, visibleIndex); + count = last - index + 1; + + return true; + } // for debugging only void checkVisible() const { @@ -468,7 +491,7 @@ void QFxListViewPrivate::refill(qreal from, qreal to) ++modelIndex; changed = true; } - while (visibleIndex > 0 && visiblePos > from) { + while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > from) { //qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos; item = getItem(visibleIndex-1); --visibleIndex; @@ -1388,20 +1411,19 @@ void QFxListView::itemsInserted(int modelIndex, int count) { Q_D(QFxListView); if (!d->visibleItems.count() || d->model->count() <= 1) { - refill(); + d->layout(); d->updateCurrent(qMax(0, qMin(d->currentIndex, d->model->count()-1))); emit countChanged(); return; } - int index = d->mapFromModel(modelIndex); - if (index == -1) { + if (!d->mapRangeFromModel(modelIndex, count)) { int i = d->visibleItems.count() - 1; while (i > 0 && d->visibleItems.at(i)->index == -1) --i; if (d->visibleItems.at(i)->index + 1 == modelIndex) { // Special case of appending an item to the model. - index = d->visibleIndex + d->visibleItems.count(); + modelIndex = d->visibleIndex + d->visibleItems.count(); } else { if (modelIndex + count - 1 < d->visibleIndex) { // Insert before visible items @@ -1418,27 +1440,22 @@ void QFxListView::itemsInserted(int modelIndex, int count) if (d->currentItem) d->currentItem->index = d->currentIndex; } + d->layout(); emit countChanged(); return; } } // At least some of the added items will be visible - int insertCount = count; - if (index < d->visibleIndex) { - insertCount -= d->visibleIndex - index; - index = d->visibleIndex; - modelIndex = d->visibleIndex; - } - index -= d->visibleIndex; + int index = modelIndex - d->visibleIndex; int to = d->buffer+d->position()+d->size()-1; // index can be the next item past the end of the visible items list (i.e. appended) int pos = index < d->visibleItems.count() ? d->visibleItems.at(index)->position() : d->visibleItems.at(index-1)->endPosition()+1; int initialPos = pos; QList added; - for (int i = 0; i < insertCount && pos <= to; ++i) { + for (int i = 0; i < count && pos <= to; ++i) { FxListItem *item = d->createItem(modelIndex + i); d->visibleItems.insert(index, item); item->setPosition(pos); @@ -1479,8 +1496,7 @@ void QFxListView::itemsInserted(int modelIndex, int count) void QFxListView::itemsRemoved(int modelIndex, int count) { Q_D(QFxListView); - int index = d->mapFromModel(modelIndex); - if (index == -1) { + if (!d->mapRangeFromModel(modelIndex, count)) { if (modelIndex + count - 1 < d->visibleIndex) { // Items removed before our visible items. d->visibleIndex -= count; @@ -1504,6 +1520,7 @@ void QFxListView::itemsRemoved(int modelIndex, int count) d->currentIndex = -1; d->updateCurrent(qMin(modelIndex, d->model->count()-1)); } + d->layout(); emit countChanged(); return; } @@ -1561,6 +1578,8 @@ void QFxListView::itemsRemoved(int modelIndex, int count) if (d->visibleItems.isEmpty()) { d->visibleIndex = 0; + d->visiblePos = 0; + d->_tl.clear(); d->setPosition(0); if (d->model->count() == 0) update(); -- cgit v0.12 From f7a9bffd11efce32f0fa318c01de8c8088fe4d95 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 8 May 2009 15:17:39 +1000 Subject: Correct spelling. setConsitentTiming -> setConsistentTiming --- src/corelib/animation/qabstractanimation.cpp | 2 +- src/corelib/animation/qabstractanimation_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 6a824b6..f5b9323 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -205,7 +205,7 @@ void QUnifiedTimer::setTimingInterval(int interval) this allows to have a consistent timer interval at each tick from the timer not taking the real time that passed into account. */ -void QUnifiedTimer::setConsitentTiming(bool b) +void QUnifiedTimer::setConsistentTiming(bool b) { consistentTiming = b; } diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 49c0195..41983a5 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -122,7 +122,7 @@ public: void unregisterAnimation(QAbstractAnimation *animation); void setTimingInterval(int interval); - void setConsitentTiming(bool consistent); + void setConsistentTiming(bool consistent); int elapsedTime() const; -- cgit v0.12 From 7bbd286d474f27c1ff0cd021d27c9e9c577ab0a8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 May 2009 16:08:49 +1000 Subject: Add canvas debugger module --- src/declarative/debugger/debugger.pri | 6 +- src/declarative/debugger/qmlcanvasdebugger.cpp | 164 +++++++++++++++++++++++++ src/declarative/debugger/qmlcanvasdebugger_p.h | 84 +++++++++++++ src/declarative/debugger/qmldebugger.cpp | 13 +- src/declarative/debugger/qmldebugger.h | 4 + src/declarative/util/qfxview.cpp | 1 + 6 files changed, 269 insertions(+), 3 deletions(-) create mode 100644 src/declarative/debugger/qmlcanvasdebugger.cpp create mode 100644 src/declarative/debugger/qmlcanvasdebugger_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 4df7e51..c386d74 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -2,10 +2,12 @@ SOURCES += debugger/qmldebugger.cpp \ debugger/qmldebuggerstatus.cpp \ debugger/qmlpropertyview.cpp \ debugger/qmlwatches.cpp \ - debugger/qmlobjecttree.cpp + debugger/qmlobjecttree.cpp \ + debugger/qmlcanvasdebugger.cpp HEADERS += debugger/qmldebugger.h \ debugger/qmldebuggerstatus.h \ debugger/qmlpropertyview_p.h \ debugger/qmlwatches_p.h \ - debugger/qmlobjecttree_p.h + debugger/qmlobjecttree_p.h \ + debugger/qmlcanvasdebugger_p.h diff --git a/src/declarative/debugger/qmlcanvasdebugger.cpp b/src/declarative/debugger/qmlcanvasdebugger.cpp new file mode 100644 index 0000000..90ec742 --- /dev/null +++ b/src/declarative/debugger/qmlcanvasdebugger.cpp @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include + +QmlCanvasDebugger::QmlCanvasDebugger(QmlWatches *w, QWidget *parent) +: QWidget(parent), m_watches(w), m_tree(0), m_canvas(0), m_debugCanvas(0) +{ + QVBoxLayout *layout = new QVBoxLayout; + setLayout(layout); + QPushButton *pb = new QPushButton("Refresh", this); + QObject::connect(pb, SIGNAL(clicked()), this, SLOT(refresh())); + layout->addWidget(pb); + + QSplitter *splitter = new QSplitter(this); + + m_tree = new QTreeWidget(this); + QObject::connect(m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(itemExpanded(QTreeWidgetItem*))); + QObject::connect(m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(itemCollapsed(QTreeWidgetItem*))); + QObject::connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*))); + m_canvas = new QSimpleCanvas(QSimpleCanvas::SimpleCanvas, this); + splitter->addWidget(m_tree); + splitter->addWidget(m_canvas); + splitter->setStretchFactor(1, 2); + layout->addWidget(splitter); +} + +void QmlCanvasDebugger::refresh() +{ + setCanvas(m_debugCanvas); +} + +class QmlCanvasDebuggerItem : public QTreeWidgetItem +{ +public: + QmlCanvasDebuggerItem(QTreeWidget *tree) + : QTreeWidgetItem(tree), me(0) + { + } + + QmlCanvasDebuggerItem(QTreeWidgetItem *item) + : QTreeWidgetItem(item), me(0) + { + } + + QPointer them; + QFxRect *me; +}; + +void QmlCanvasDebugger::itemExpanded(QTreeWidgetItem *i) +{ + QmlCanvasDebuggerItem *item = static_cast(i); + if(item->me) + item->me->setOpacity(1); +} + +void QmlCanvasDebugger::itemClicked(QTreeWidgetItem *i) +{ + QmlCanvasDebuggerItem *item = static_cast(i); + if(item->them) + emit objectClicked(m_watches->objectId(item->them)); +} + +void QmlCanvasDebugger::itemCollapsed(QTreeWidgetItem *i) +{ + QmlCanvasDebuggerItem *item = static_cast(i); + if(item->me) + item->me->setOpacity(0); +} + +void QmlCanvasDebugger::clone(QTreeWidgetItem *item, QSimpleCanvasItem *me, QSimpleCanvasItem *them) +{ + const QList &children = them->children(); + + foreach(QSimpleCanvasItem *child, children) { + QmlCanvasDebuggerItem *childItem = new QmlCanvasDebuggerItem(item); + childItem->setText(0, QmlWatches::objectToString(child)); + childItem->setExpanded(true); + + QFxRect *rect = new QFxRect; + rect->setParent(me); + rect->setX(child->x()); + rect->setY(child->y()); + rect->setWidth(child->width()); + rect->setHeight(child->height()); + + if(child->hasActiveFocus()) + rect->setColor(QColor(0, 0, 0, 10)); + else if(child->options() & QSimpleCanvasItem::IsFocusPanel) + rect->setColor(QColor(0, 255, 0, 10)); + else if(child->options() & QSimpleCanvasItem::IsFocusRealm) + rect->setColor(QColor(0, 0, 255, 10)); + else + rect->setColor(QColor(255, 0, 0, 10)); + + childItem->them = child; + childItem->me = rect; + + clone(childItem, rect, child); + } +} + +void QmlCanvasDebugger::setCanvas(QSimpleCanvas *canvas) +{ + QList children = m_canvas->root()->children(); + qDeleteAll(children); + m_tree->clear(); + + m_debugCanvas = canvas; + if(!m_debugCanvas) + return; + + QTreeWidgetItem *root = new QmlCanvasDebuggerItem(m_tree); + root->setText(0, "Root"); + root->setExpanded(true); + clone(root, m_canvas->root(), m_debugCanvas->root()); +} + diff --git a/src/declarative/debugger/qmlcanvasdebugger_p.h b/src/declarative/debugger/qmlcanvasdebugger_p.h new file mode 100644 index 0000000..24240ee --- /dev/null +++ b/src/declarative/debugger/qmlcanvasdebugger_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** 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 QMLCANVASDEBUGGER_P_H +#define QMLCANVASDEBUGGER_P_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QSimpleCanvas; +class QSimpleCanvasItem; +class QTreeWidget; +class QTreeWidgetItem; +class QmlWatches; +class QmlCanvasDebugger : public QWidget +{ + Q_OBJECT +public: + QmlCanvasDebugger(QmlWatches *, QWidget *parent = 0); + + void setCanvas(QSimpleCanvas *); + +signals: + void objectClicked(quint32); + +private slots: + void refresh(); + void itemClicked(QTreeWidgetItem *); + void itemExpanded(QTreeWidgetItem *); + void itemCollapsed(QTreeWidgetItem *); + +private: + void clone(QTreeWidgetItem *, QSimpleCanvasItem *me, QSimpleCanvasItem *them); + + QmlWatches *m_watches; + QTreeWidget *m_tree; + QSimpleCanvas *m_canvas; + QPointer m_debugCanvas; +}; + +QT_END_NAMESPACE + +#endif // QMLCANVASDEBUGGER_P_H + diff --git a/src/declarative/debugger/qmldebugger.cpp b/src/declarative/debugger/qmldebugger.cpp index 76d6b10..49ad8d9 100644 --- a/src/declarative/debugger/qmldebugger.cpp +++ b/src/declarative/debugger/qmldebugger.cpp @@ -61,10 +61,11 @@ #include #include #include +#include QmlDebugger::QmlDebugger(QWidget *parent) : QWidget(parent), m_tree(0), m_warnings(0), m_watchTable(0), m_watches(0), - m_properties(0), m_text(0), m_highlightedItem(0) + m_canvas(0), m_properties(0), m_text(0), m_highlightedItem(0) { QHBoxLayout *layout = new QHBoxLayout; setLayout(layout); @@ -110,6 +111,11 @@ QmlDebugger::QmlDebugger(QWidget *parent) tabs->addTab(m_properties, "Properties"); tabs->setCurrentWidget(m_properties); + m_canvas = new QmlCanvasDebugger(m_watches, this); + QObject::connect(m_canvas, SIGNAL(objectClicked(quint32)), + this, SLOT(highlightObject(quint32))); + tabs->addTab(m_canvas, "Canvas"); + splitter->addWidget(tabs); splitter->setStretchFactor(1, 2); @@ -331,6 +337,11 @@ bool operator<(const QPair > &lhs, return lhs.first < rhs.first; } +void QmlDebugger::setCanvas(QSimpleCanvas *c) +{ + m_canvas->setCanvas(c); +} + void QmlDebugger::setDebugObject(QObject *obj) { m_tree->clear(); diff --git a/src/declarative/debugger/qmldebugger.h b/src/declarative/debugger/qmldebugger.h index ddb846b..4641bce 100644 --- a/src/declarative/debugger/qmldebugger.h +++ b/src/declarative/debugger/qmldebugger.h @@ -61,6 +61,8 @@ class QmlPropertyView; class QmlWatches; class QmlObjectTree; class QmlContext; +class QmlCanvasDebugger; +class QSimpleCanvas; class QmlDebugger : public QWidget { Q_OBJECT @@ -68,6 +70,7 @@ public: QmlDebugger(QWidget *parent = 0); void setDebugObject(QObject *); + void setCanvas(QSimpleCanvas *); public slots: void refresh(); @@ -85,6 +88,7 @@ private: QTreeWidget *m_warnings; QTableView *m_watchTable; QmlWatches *m_watches; + QmlCanvasDebugger *m_canvas; QmlPropertyView *m_properties; QPlainTextEdit *m_text; QPointer m_object; diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index ea2719d..078916b 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -329,6 +329,7 @@ void QFxView::continueExecute() if(qmlDebugger()) { QmlDebugger *debugger = new QmlDebugger; debugger->setDebugObject(item); + debugger->setCanvas(this); debugger->show(); raise(); debugger->raise(); -- cgit v0.12 From 15de11bfcd2907e587dff41013fd39b62f0ca869 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 8 May 2009 16:26:49 +1000 Subject: Make sure qmlviewer uses raster graphcis system, or respects what was input. --- tools/qmlviewer/main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp index 379fda9..9a008d2 100644 --- a/tools/qmlviewer/main.cpp +++ b/tools/qmlviewer/main.cpp @@ -47,18 +47,24 @@ int main(int argc, char ** argv) //### default to using raster graphics backend for now int newargc = argc + 2; char **newargv; - newargv = new char * [newargc]; + bool gsSpecified = false; for (int i = 0; i < argc; ++i) { - newargv[i] = argv[i]; if (!qstrcmp(argv[i], "-graphicssystem")) { + gsSpecified = true; newargc -= 2; break; } } - char system[] = "-graphicssystem"; - newargv[argc] = system; - char raster[] = "raster"; - newargv[argc+1] = raster; + newargv = new char * [newargc]; + for (int i = 0; i < argc; ++i) { + newargv[i] = argv[i]; + } + if (!gsSpecified) { + char system[] = "-graphicssystem"; + newargv[argc] = system; + char raster[] = "raster"; + newargv[argc+1] = raster; + } QApplication app(newargc, newargv); app.setApplicationName("viewer"); -- cgit v0.12 From 80c80005c74776a930ec4a1a8fb8af5330073a71 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 May 2009 19:10:41 +1000 Subject: Add canvas image capture --- src/declarative/debugger/qmlcanvasdebugger.cpp | 94 +++++++++++++++++++++++--- src/declarative/debugger/qmlcanvasdebugger_p.h | 5 ++ 2 files changed, 90 insertions(+), 9 deletions(-) diff --git a/src/declarative/debugger/qmlcanvasdebugger.cpp b/src/declarative/debugger/qmlcanvasdebugger.cpp index 90ec742..fe57bf4 100644 --- a/src/declarative/debugger/qmlcanvasdebugger.cpp +++ b/src/declarative/debugger/qmlcanvasdebugger.cpp @@ -44,27 +44,54 @@ #include #include #include +#include #include #include #include +#include QmlCanvasDebugger::QmlCanvasDebugger(QmlWatches *w, QWidget *parent) -: QWidget(parent), m_watches(w), m_tree(0), m_canvas(0), m_debugCanvas(0) +: QWidget(parent), m_watches(w), m_tree(0), m_canvas(0), m_canvasRoot(0), m_debugCanvas(0), + m_selected(0) { QVBoxLayout *layout = new QVBoxLayout; + layout->setContentsMargins(0,0,0,0); + layout->setSpacing(0); setLayout(layout); + QHBoxLayout *hlayout = new QHBoxLayout; + hlayout->setContentsMargins(0,0,0,0); + hlayout->addStretch(2); + hlayout->setSpacing(0); + layout->addLayout(hlayout); + QSpinBox *x = new QSpinBox(this); + x->setSingleStep(50); + x->setMaximum(10000); + x->setMinimum(-10000); + QObject::connect(x, SIGNAL(valueChanged(int)), this, SLOT(setX(int))); + QSpinBox *y = new QSpinBox(this); + y->setSingleStep(50); + y->setMaximum(10000); + y->setMinimum(-10000); + QObject::connect(y, SIGNAL(valueChanged(int)), this, SLOT(setY(int))); + hlayout->addWidget(x); + hlayout->addWidget(y); QPushButton *pb = new QPushButton("Refresh", this); QObject::connect(pb, SIGNAL(clicked()), this, SLOT(refresh())); - layout->addWidget(pb); + hlayout->addWidget(pb); QSplitter *splitter = new QSplitter(this); m_tree = new QTreeWidget(this); - QObject::connect(m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(itemExpanded(QTreeWidgetItem*))); - QObject::connect(m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(itemCollapsed(QTreeWidgetItem*))); - QObject::connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*))); + QObject::connect(m_tree, SIGNAL(itemExpanded(QTreeWidgetItem*)), + this, SLOT(itemExpanded(QTreeWidgetItem*))); + QObject::connect(m_tree, SIGNAL(itemCollapsed(QTreeWidgetItem*)), + this, SLOT(itemCollapsed(QTreeWidgetItem*))); + QObject::connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), + this, SLOT(itemClicked(QTreeWidgetItem*))); m_canvas = new QSimpleCanvas(QSimpleCanvas::SimpleCanvas, this); + m_canvasRoot = new QSimpleCanvasItem; + m_canvasRoot->setParent(m_canvas->root()); splitter->addWidget(m_tree); splitter->addWidget(m_canvas); splitter->setStretchFactor(1, 2); @@ -80,17 +107,18 @@ class QmlCanvasDebuggerItem : public QTreeWidgetItem { public: QmlCanvasDebuggerItem(QTreeWidget *tree) - : QTreeWidgetItem(tree), me(0) + : QTreeWidgetItem(tree), me(0), img(0) { } QmlCanvasDebuggerItem(QTreeWidgetItem *item) - : QTreeWidgetItem(item), me(0) + : QTreeWidgetItem(item), me(0), img(0) { } QPointer them; QFxRect *me; + QFxImage *img; }; void QmlCanvasDebugger::itemExpanded(QTreeWidgetItem *i) @@ -100,11 +128,29 @@ void QmlCanvasDebugger::itemExpanded(QTreeWidgetItem *i) item->me->setOpacity(1); } +void QmlCanvasDebugger::setOpacityRecur(QTreeWidgetItem *i, qreal op) +{ + QmlCanvasDebuggerItem *item = static_cast(i); + if(item->img) + item->img->setOpacity(op); + + for(int ii = 0; ii < item->childCount(); ++ii) + setOpacityRecur(item->child(ii), op); +} + void QmlCanvasDebugger::itemClicked(QTreeWidgetItem *i) { QmlCanvasDebuggerItem *item = static_cast(i); if(item->them) emit objectClicked(m_watches->objectId(item->them)); + + if(m_selected) { + setOpacityRecur(m_selected, 0); + m_selected = 0; + } + + m_selected = item; + setOpacityRecur(m_selected, 1); } void QmlCanvasDebugger::itemCollapsed(QTreeWidgetItem *i) @@ -127,8 +173,13 @@ void QmlCanvasDebugger::clone(QTreeWidgetItem *item, QSimpleCanvasItem *me, QSim rect->setParent(me); rect->setX(child->x()); rect->setY(child->y()); + rect->setZ(child->z()); rect->setWidth(child->width()); rect->setHeight(child->height()); + rect->setTransformOrigin(child->transformOrigin()); + rect->setScale(child->scale()); + rect->setFlip(child->flip()); + rect->setTransform(child->transform()); if(child->hasActiveFocus()) rect->setColor(QColor(0, 0, 0, 10)); @@ -139,6 +190,20 @@ void QmlCanvasDebugger::clone(QTreeWidgetItem *item, QSimpleCanvasItem *me, QSim else rect->setColor(QColor(255, 0, 0, 10)); + if(child->width() > 0 && child->height() > 0) { + QPixmap pix(child->width(), child->height()); + pix.fill(QColor(0,0,0,0)); + QPainter p(&pix); + child->paintContents(p); + QFxImage *img = new QFxImage; + img->setParent(rect); + img->setWidth(child->width()); + img->setHeight(child->height()); + img->setPixmap(pix); + img->setOpacity(0); + childItem->img = img; + } + childItem->them = child; childItem->me = rect; @@ -146,11 +211,22 @@ void QmlCanvasDebugger::clone(QTreeWidgetItem *item, QSimpleCanvasItem *me, QSim } } +void QmlCanvasDebugger::setX(int x) +{ + m_canvasRoot->setX(x); +} + +void QmlCanvasDebugger::setY(int y) +{ + m_canvasRoot->setY(y); +} + void QmlCanvasDebugger::setCanvas(QSimpleCanvas *canvas) { - QList children = m_canvas->root()->children(); + QList children = m_canvasRoot->children(); qDeleteAll(children); m_tree->clear(); + m_selected = 0; m_debugCanvas = canvas; if(!m_debugCanvas) @@ -159,6 +235,6 @@ void QmlCanvasDebugger::setCanvas(QSimpleCanvas *canvas) QTreeWidgetItem *root = new QmlCanvasDebuggerItem(m_tree); root->setText(0, "Root"); root->setExpanded(true); - clone(root, m_canvas->root(), m_debugCanvas->root()); + clone(root, m_canvasRoot, m_debugCanvas->root()); } diff --git a/src/declarative/debugger/qmlcanvasdebugger_p.h b/src/declarative/debugger/qmlcanvasdebugger_p.h index 24240ee..80a2322 100644 --- a/src/declarative/debugger/qmlcanvasdebugger_p.h +++ b/src/declarative/debugger/qmlcanvasdebugger_p.h @@ -68,14 +68,19 @@ private slots: void itemClicked(QTreeWidgetItem *); void itemExpanded(QTreeWidgetItem *); void itemCollapsed(QTreeWidgetItem *); + void setX(int); + void setY(int); private: + void setOpacityRecur(QTreeWidgetItem *, qreal); void clone(QTreeWidgetItem *, QSimpleCanvasItem *me, QSimpleCanvasItem *them); QmlWatches *m_watches; QTreeWidget *m_tree; QSimpleCanvas *m_canvas; + QSimpleCanvasItem *m_canvasRoot; QPointer m_debugCanvas; + QTreeWidgetItem *m_selected; }; QT_END_NAMESPACE -- cgit v0.12 From c7b42eb426a27d3f8124f5c37f39a8b91e3e03e8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 May 2009 13:49:35 +0200 Subject: qdoc: Added qlistmodelinterface.cpp to correct some qdoc warnings. --- src/declarative/3rdparty/3rdparty.pri | 3 + src/declarative/3rdparty/qlistmodelinterface.cpp | 115 +++++++++++++++++++++++ src/declarative/3rdparty/qlistmodelinterface.h | 49 ++++------ 3 files changed, 134 insertions(+), 33 deletions(-) create mode 100644 src/declarative/3rdparty/qlistmodelinterface.cpp diff --git a/src/declarative/3rdparty/3rdparty.pri b/src/declarative/3rdparty/3rdparty.pri index 5350fcf..fc78cb2 100644 --- a/src/declarative/3rdparty/3rdparty.pri +++ b/src/declarative/3rdparty/3rdparty.pri @@ -1,2 +1,5 @@ HEADERS += \ 3rdparty/qlistmodelinterface.h\ + +SOURCES += \ + 3rdparty/qlistmodelinterface.cpp \ diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp new file mode 100644 index 0000000..5e0544e --- /dev/null +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include "qlistmodelinterface.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QListModelInterface + \brief The QListModelInterface class can be subclassed to provide C++ models to QFx Views + + This class is comprised primarily of pure virtual functions which + you must implement in a subclass. You can then use the subclass + as a model for a QFx view, such as a QFxListView. +*/ + +/*! \fn QListModelInterface::QListModelInterface(QObject *parent) + Constructs a QListModelInterface with the specified \a parent. + + /*! \fn QListModelInterface::QListModelInterface(QObjectPrivate &dd, QObject *parent) + + \internal + */ + +/*! \fn QListModelInterface::~QListModelInterface() + The destructor is virtual. + */ + +/*! \fn int QListModelInterface::count() const + Returns the number of data entries in the model. +*/ + +/*! \fn QHash_int QListModelInterface::data(int index, const QList_int &roles) const + Returns the data at the given \a index for the specifed \a roles. +*/ + +/*! \fn bool QListModelInterface::setData(int index, const QHash_int &values) + Sets the data at the given \a index. \a values is a mapping of + QVariant values to roles. +*/ + +/*! \fn bool QListModelInterface::setData(int index, const QVariant &value, int role) + This convenience function builds a QHash_int from + the specified \a role and \a value and calls the other setData() + with the QHash and the \a index. +*/ + +/*! \fn QList_int QListModelInterface::roles() const + Returns the list of roles for which the list model interface + provides data. +*/ + +/*! \fn QString QListModelInterface::toString(int role) const + Returns a string description of the specified \a role. +*/ + +/*! \enum QListModelInterface::Roles + + Values for representing roles. + + \value TextRole + + \value IconRole +*/ + +/*! + \typedef QListModelInterface::QHash_int + + Synonym for QHash. +*/ + +/*! + \typedef QListModelInterface::QList_int + + Synonym for QList. +*/ +QT_END_NAMESPACE diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h index 446b89b..e1eb21e 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ b/src/declarative/3rdparty/qlistmodelinterface.h @@ -53,16 +53,10 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -/*! - \class QListModelInterface - \brief The QListModelInterface class can be subclassed to provide C++ models to QFx Views - - This class is comprised primarily of pure virtual functions which you need to implement in a subclass. You can then use the subclass as a model for a QFx view, such as a QFxListView. -*/ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject { Q_OBJECT -public: + public: QListModelInterface(QObject *parent = 0) : QObject(parent) {} virtual ~QListModelInterface() {} @@ -72,47 +66,36 @@ public: IconRole = Qt::DecorationRole }; - /*! - Returns the number of data entries in the model. - */ virtual int count() const = 0; - /*! - Returns the data at the given \a index for the specifed \a roles. - */ - virtual QHash data(int index, const QList &roles = (QList())) const = 0; - /*! - Sets the data at the given \a index.\a values is a mapping of QVariant values to roles. - */ - virtual bool setData(int index, const QHash &values) { Q_UNUSED(index); Q_UNUSED(values); return false; } - /*! - This convinience function can be used to set the data for one specific role. It internally uses the other setData and does not need to be reimplemented. - */ + + typedef QHash QHash_int; + typedef QList QList_int; + virtual QHash_int data(int index, const QList_int &roles = QList_int) const = 0; + + virtual bool setData(int index, const QHash_int &values) + { Q_UNUSED(index); Q_UNUSED(values); return false; } + inline bool setData(int index, const QVariant &value, int role) { - QHash values; + QHash_int values; values.insert(role, value); return setData(index, values); } - /*! - Returns which roles the list provides data for. - */ - virtual QList roles() const = 0; - /*! - Returns a string description of the specified \a role. - */ + virtual QList_int roles() const = 0; virtual QString toString(int role) const = 0; //void bind(int index, int role, QObject *object, const char *propertyName, bool readOnly = true); -Q_SIGNALS: + Q_SIGNALS: void itemsInserted(int index, int count); void itemsRemoved(int index, int count); void itemsMoved(int from, int to, int count); - void itemsChanged(int index, int count, const QList &roles); + void itemsChanged(int index, int count, const QList_int &roles); -protected: - QListModelInterface(QObjectPrivate &dd, QObject *parent) : QObject(dd, parent) {} + protected: + QListModelInterface(QObjectPrivate &dd, QObject *parent) + : QObject(dd, parent) {} }; -- cgit v0.12 From 79900981848fc4ba812243db83a7456d72ddda15 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 8 May 2009 11:18:43 +0200 Subject: Add autotest for crash when compiling "Component {}" --- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 96f6f4f..efd45d3 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -156,6 +156,9 @@ private slots: //void cannotAssignBindingToSignal(); void assignObjectToSignal(); + // regression tests for crashes + void crash1(); + private: QmlEngine engine; }; @@ -439,6 +442,12 @@ void tst_qmlparser::assignObjectToSignal() emit object->basicSignal(); } +void tst_qmlparser::crash1() +{ + QmlComponent component(&engine, "Component {}"); + MyQmlObject *object = qobject_cast(component.create()); +} + QTEST_MAIN(tst_qmlparser) #include "tst_qmlparser.moc" -- cgit v0.12 From 7d67d5c24ce3e707c1bb9bc6f181765cccc4090d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 8 May 2009 14:36:51 +0200 Subject: Expose import statements in QmlDomDocument Reviewed-by: erikv Reviewed-by: Roberto Raggi --- src/declarative/canvas/qsimplecanvas.h | 12 ++++++------ src/declarative/qml/qmldom.cpp | 17 +++++++++++++++-- src/declarative/qml/qmldom.h | 3 ++- src/declarative/qml/qmldom_p.h | 3 +++ src/declarative/qml/qmlscriptparser.cpp | 15 +++++++++++++++ src/declarative/qml/qmlscriptparser_p.h | 18 +++++++++++++----- 6 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/declarative/canvas/qsimplecanvas.h b/src/declarative/canvas/qsimplecanvas.h index 20dab28..d57ada4 100644 --- a/src/declarative/canvas/qsimplecanvas.h +++ b/src/declarative/canvas/qsimplecanvas.h @@ -48,12 +48,12 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include QT_BEGIN_HEADER diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index a31be81..4e754a3 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -143,7 +143,15 @@ int QmlDomDocument::version() const } /*! - Loads a QmlDomDocument from \a data. \a data should be valid QML XML + Return the URIs listed by "import " in the qml. +*/ +QList QmlDomDocument::imports() const +{ + return d->imports; +} + +/*! + Loads a QmlDomDocument from \a data. \a data should be valid QML data. On success, true is returned. If the \a data is malformed, false is returned and QmlDomDocument::loadError() contains an error description. @@ -153,11 +161,12 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl { Q_UNUSED(engine); d->errors.clear(); + d->imports.clear(); QmlCompiledComponent component; QmlCompiler compiler; - QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url);; + QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url); if(td->status == QmlCompositeTypeData::Error) { d->errors = td->errors; @@ -179,6 +188,10 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl return false; } + for (int i = 0; i < td->data.imports().size(); ++i) { + d->imports += QUrl(td->data.imports().at(i).uri); + } + if (td->data.tree()) { td->data.tree()->dump(); d->root = td->data.tree(); diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h index f90fb08..8b503fa 100644 --- a/src/declarative/qml/qmldom.h +++ b/src/declarative/qml/qmldom.h @@ -71,7 +71,8 @@ public: QmlDomDocument &operator=(const QmlDomDocument &); int version() const; - + QList imports() const; + QList errors() const; bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl()); QByteArray save() const; diff --git a/src/declarative/qml/qmldom_p.h b/src/declarative/qml/qmldom_p.h index 4c3ca44..74edd47 100644 --- a/src/declarative/qml/qmldom_p.h +++ b/src/declarative/qml/qmldom_p.h @@ -42,6 +42,8 @@ #ifndef QMLDOM_P_H #define QMLDOM_P_H +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -58,6 +60,7 @@ public: ~QmlDomDocumentPrivate(); QList errors; + QList imports; QmlParser::Object *root; }; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 4385601..8506933 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -362,6 +362,16 @@ bool ProcessAST::visit(AST::UiImport *node) { QString fileName = node->fileName->asString(); _parser->addNamespacePath(fileName); + + AST::SourceLocation startLoc = node->importToken; + AST::SourceLocation endLoc = node->semicolonToken; + + QmlScriptParser::Import import; + import.location = location(startLoc, endLoc); + import.uri = fileName; + + _parser->_imports << import; + return false; } @@ -686,6 +696,11 @@ Object *QmlScriptParser::tree() const return root; } +QList QmlScriptParser::imports() const +{ + return _imports; +} + QList QmlScriptParser::errors() const { return _errors; diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index 4155bba..8a5466f 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -4,22 +4,28 @@ #include #include #include -#include +#include "qmlparser_p.h" + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -namespace QmlParser { - class Object; -} - class QByteArray; class QmlScriptParser { public: + class Import + { + public: + Import() {} + + QString uri; + QmlParser::LocationSpan location; + }; + QmlScriptParser(); ~QmlScriptParser(); @@ -29,6 +35,7 @@ public: QStringList types() const; QmlParser::Object *tree() const; + QList imports() const; void clear(); @@ -48,6 +55,7 @@ public: QMap _nameSpacePaths; QmlParser::Object *root; + QList _imports; QStringList _typeNames; QString _scriptFile; }; -- cgit v0.12 From 94d44efa7066961211a4d2824e093ba71483b4ed Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 May 2009 15:06:45 +0200 Subject: qdoc: Fixed missing end of comment. --- src/declarative/3rdparty/qlistmodelinterface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index 5e0544e..7e50378 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE /*! \fn QListModelInterface::QListModelInterface(QObject *parent) Constructs a QListModelInterface with the specified \a parent. +*/ /*! \fn QListModelInterface::QListModelInterface(QObjectPrivate &dd, QObject *parent) -- cgit v0.12 From 140339c9a8ba51dab7384608a610ba129e0388dd Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 May 2009 15:11:32 +0200 Subject: qdoc: Fixed default parameter. --- src/declarative/3rdparty/qlistmodelinterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h index e1eb21e..8a0cf44 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ b/src/declarative/3rdparty/qlistmodelinterface.h @@ -70,7 +70,7 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject typedef QHash QHash_int; typedef QList QList_int; - virtual QHash_int data(int index, const QList_int &roles = QList_int) const = 0; + virtual QHash_int data(int index, const QList_int &roles = QList_int()) const = 0; virtual bool setData(int index, const QHash_int &values) { Q_UNUSED(index); Q_UNUSED(values); return false; } -- cgit v0.12 From 445c06ef96158befe035a0b45c613e4931d76e82 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 8 May 2009 16:32:12 +0200 Subject: Fixed possible crash when processing Ui object definitions. --- src/declarative/qml/qmlscriptparser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 8506933..0092ec2 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -226,9 +226,12 @@ ProcessAST::defineObjectBinding_helper(int line, return 0; } - _stateStack.pushProperty(objectType, - this->location(propertyName)); - accept(initializer); + SourceLocation loc = typeLocation; + if (propertyName) + loc = location(propertyName); + + _stateStack.pushProperty(objectType, loc); + accept(initializer); _stateStack.pop(); return 0; -- cgit v0.12 From 74d43d285f611a332d239c3669b7c90e23741b25 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 11 May 2009 09:21:21 +1000 Subject: Make sure we correctly remove the PathView attached property object. If we don't, we get some nasty random crashes. --- src/declarative/fx/qfxpathview.cpp | 7 ++++++- src/declarative/fx/qfxpathview.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 77d5fa2..b7215cf 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -66,6 +66,11 @@ public: { } + ~QFxPathViewAttached() + { + QFxPathView::attachedProperties.remove(parent()); + } + QVariant value(const QByteArray &name) const { return mo->value(name); @@ -583,7 +588,7 @@ void QFxPathViewPrivate::regenerate() void QFxPathViewPrivate::updateItem(QFxItem *item, qreal percent) { - if (QObject *obj = QFxPathView::attachedProperties.value(item)) { + if (QObject *obj = QFxPathView::qmlAttachedProperties(item)) { foreach(const QString &attr, path->attributes()) static_cast(obj)->setValue(attr.toLatin1(), path->attributeAt(attr, percent)); } diff --git a/src/declarative/fx/qfxpathview.h b/src/declarative/fx/qfxpathview.h index 0e1ac6f..2ecd04e 100644 --- a/src/declarative/fx/qfxpathview.h +++ b/src/declarative/fx/qfxpathview.h @@ -122,6 +122,7 @@ protected: QFxPathView(QFxPathViewPrivate &dd, QFxItem *parent); private: + friend class QFxPathViewAttached; static QHash attachedProperties; Q_DISABLE_COPY(QFxPathView) Q_DECLARE_PRIVATE(QFxPathView) -- cgit v0.12 From a365bd8f0cc53353ec8d3335ffec2d7810cf1d2a Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 11 May 2009 09:49:01 +1000 Subject: Change QList_int typedef back to QList - broke signal connection. --- src/declarative/3rdparty/qlistmodelinterface.cpp | 19 ++++--------------- src/declarative/3rdparty/qlistmodelinterface.h | 12 +++++------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index 7e50378..e440cac 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -69,22 +69,22 @@ QT_BEGIN_NAMESPACE Returns the number of data entries in the model. */ -/*! \fn QHash_int QListModelInterface::data(int index, const QList_int &roles) const +/*! \fn QHash_int QListModelInterface::data(int index, const QList &roles) const Returns the data at the given \a index for the specifed \a roles. */ -/*! \fn bool QListModelInterface::setData(int index, const QHash_int &values) +/*! \fn bool QListModelInterface::setData(int index, const QHash &values) Sets the data at the given \a index. \a values is a mapping of QVariant values to roles. */ /*! \fn bool QListModelInterface::setData(int index, const QVariant &value, int role) - This convenience function builds a QHash_int from + This convenience function builds a QHash from the specified \a role and \a value and calls the other setData() with the QHash and the \a index. */ -/*! \fn QList_int QListModelInterface::roles() const +/*! \fn QList QListModelInterface::roles() const Returns the list of roles for which the list model interface provides data. */ @@ -102,15 +102,4 @@ QT_BEGIN_NAMESPACE \value IconRole */ -/*! - \typedef QListModelInterface::QHash_int - - Synonym for QHash. -*/ - -/*! - \typedef QListModelInterface::QList_int - - Synonym for QList. -*/ QT_END_NAMESPACE diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h index 8a0cf44..fd69edd 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ b/src/declarative/3rdparty/qlistmodelinterface.h @@ -68,21 +68,19 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject virtual int count() const = 0; - typedef QHash QHash_int; - typedef QList QList_int; - virtual QHash_int data(int index, const QList_int &roles = QList_int()) const = 0; + virtual QHash data(int index, const QList &roles = (QList())) const = 0; - virtual bool setData(int index, const QHash_int &values) + virtual bool setData(int index, const QHash &values) { Q_UNUSED(index); Q_UNUSED(values); return false; } inline bool setData(int index, const QVariant &value, int role) { - QHash_int values; + QHash values; values.insert(role, value); return setData(index, values); } - virtual QList_int roles() const = 0; + virtual QList roles() const = 0; virtual QString toString(int role) const = 0; //void bind(int index, int role, QObject *object, const char *propertyName, bool readOnly = true); @@ -91,7 +89,7 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject void itemsInserted(int index, int count); void itemsRemoved(int index, int count); void itemsMoved(int from, int to, int count); - void itemsChanged(int index, int count, const QList_int &roles); + void itemsChanged(int index, int count, const QList &roles); protected: QListModelInterface(QObjectPrivate &dd, QObject *parent) -- cgit v0.12 From de9825bf51ccb79f645c9ceeded3230c9be14175 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 11 May 2009 09:54:34 +1000 Subject: Get QListModelInterface back in line with itemviews_ng. --- src/declarative/3rdparty/qlistmodelinterface.cpp | 6 ------ src/declarative/3rdparty/qlistmodelinterface.h | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index e440cac..d327b58 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -78,12 +78,6 @@ QT_BEGIN_NAMESPACE QVariant values to roles. */ -/*! \fn bool QListModelInterface::setData(int index, const QVariant &value, int role) - This convenience function builds a QHash from - the specified \a role and \a value and calls the other setData() - with the QHash and the \a index. -*/ - /*! \fn QList QListModelInterface::roles() const Returns the list of roles for which the list model interface provides data. diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h index fd69edd..191a95b 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ b/src/declarative/3rdparty/qlistmodelinterface.h @@ -60,31 +60,14 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject QListModelInterface(QObject *parent = 0) : QObject(parent) {} virtual ~QListModelInterface() {} - // ### move these into the Qt namespace - enum Roles { - TextRole = Qt::DisplayRole, - IconRole = Qt::DecorationRole - }; - virtual int count() const = 0; - virtual QHash data(int index, const QList &roles = (QList())) const = 0; - virtual bool setData(int index, const QHash &values) { Q_UNUSED(index); Q_UNUSED(values); return false; } - inline bool setData(int index, const QVariant &value, int role) - { - QHash values; - values.insert(role, value); - return setData(index, values); - } - virtual QList roles() const = 0; virtual QString toString(int role) const = 0; - //void bind(int index, int role, QObject *object, const char *propertyName, bool readOnly = true); - Q_SIGNALS: void itemsInserted(int index, int count); void itemsRemoved(int index, int count); -- cgit v0.12 From ac19c9a30a47bfe8b374d390525b06ebdb26b4ca Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 10:21:47 +1000 Subject: Compile --- src/declarative/qml/qmlscriptparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 0092ec2..169e2ea 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -226,9 +226,9 @@ ProcessAST::defineObjectBinding_helper(int line, return 0; } - SourceLocation loc = typeLocation; + LocationSpan loc = ProcessAST::location(typeLocation, typeLocation); if (propertyName) - loc = location(propertyName); + loc = ProcessAST::location(propertyName); _stateStack.pushProperty(objectType, loc); accept(initializer); -- cgit v0.12 From b2120975bf3cae6ba9c51d79ccab8104cfc16e75 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 May 2009 10:55:55 +1000 Subject: Add simple loop detection to anchoring system. --- src/declarative/fx/qfxanchors.cpp | 192 +++++++++++++++---------- src/declarative/fx/qfxanchors_p.h | 6 +- tests/auto/declarative/anchors/anchors.pro | 5 + tests/auto/declarative/anchors/data/loop1.qml | 6 + tests/auto/declarative/anchors/data/loop2.qml | 18 +++ tests/auto/declarative/anchors/tst_anchors.cpp | 52 +++++++ 6 files changed, 206 insertions(+), 73 deletions(-) create mode 100644 tests/auto/declarative/anchors/anchors.pro create mode 100644 tests/auto/declarative/anchors/data/loop1.qml create mode 100644 tests/auto/declarative/anchors/data/loop2.qml create mode 100644 tests/auto/declarative/anchors/tst_anchors.cpp diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp index 540e1cb..f570663 100644 --- a/src/declarative/fx/qfxanchors.cpp +++ b/src/declarative/fx/qfxanchors.cpp @@ -424,23 +424,31 @@ void QFxAnchors::updateTopAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasTopAnchor) { - //Handle stretching - bool invalid = true; - int height = 0; - if (d->usedAnchors & HasBottomAnchor) { - invalid = d->calcStretch(d->top, d->bottom, d->topMargin, -d->bottomMargin, QFxAnchorLine::Top, height); - } else if (d->usedAnchors & HasVCenterAnchor) { - invalid = d->calcStretch(d->top, d->vCenter, d->topMargin, d->vCenterOffset, QFxAnchorLine::Top, height); - height *= 2; - } - if (!invalid) - d->item->setHeight(height); + if (!d->updatingVerticalAnchor) { + d->updatingVerticalAnchor = true; - //Handle top - if (d->top.item == d->item->itemParent()) { - d->item->setY(adjustedPosition(d->top.item, d->top.anchorLine) + d->topMargin); - } else if (d->top.item->itemParent() == d->item->itemParent()) { - d->item->setY(position(d->top.item, d->top.anchorLine) + d->topMargin); + //Handle stretching + bool invalid = true; + int height = 0; + if (d->usedAnchors & HasBottomAnchor) { + invalid = d->calcStretch(d->top, d->bottom, d->topMargin, -d->bottomMargin, QFxAnchorLine::Top, height); + } else if (d->usedAnchors & HasVCenterAnchor) { + invalid = d->calcStretch(d->top, d->vCenter, d->topMargin, d->vCenterOffset, QFxAnchorLine::Top, height); + height *= 2; + } + if (!invalid) + d->item->setHeight(height); + + //Handle top + if (d->top.item == d->item->itemParent()) { + d->item->setY(adjustedPosition(d->top.item, d->top.anchorLine) + d->topMargin); + } else if (d->top.item->itemParent() == d->item->itemParent()) { + d->item->setY(position(d->top.item, d->top.anchorLine) + d->topMargin); + } + + d->updatingVerticalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; } } } @@ -449,20 +457,28 @@ void QFxAnchors::updateBottomAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasBottomAnchor) { - //Handle stretching (top + bottom case is handled in updateLeftAnchor) - if (d->usedAnchors & HasVCenterAnchor) { - int height = 0; - bool invalid = d->calcStretch(d->vCenter, d->bottom, d->vCenterOffset, -d->bottomMargin, - QFxAnchorLine::Top, height); - if (!invalid) - d->item->setHeight(height*2); - } - - //Handle bottom - if (d->bottom.item == d->item->itemParent()) { - d->item->setY(adjustedPosition(d->bottom.item, d->bottom.anchorLine) - d->item->height() - d->bottomMargin); - } else if (d->bottom.item->itemParent() == d->item->itemParent()) { - d->item->setY(position(d->bottom.item, d->bottom.anchorLine) - d->item->height() - d->bottomMargin); + if (!d->updatingVerticalAnchor) { + d->updatingVerticalAnchor = true; + + //Handle stretching (top + bottom case is handled in updateLeftAnchor) + if (d->usedAnchors & HasVCenterAnchor) { + int height = 0; + bool invalid = d->calcStretch(d->vCenter, d->bottom, d->vCenterOffset, -d->bottomMargin, + QFxAnchorLine::Top, height); + if (!invalid) + d->item->setHeight(height*2); + } + + //Handle bottom + if (d->bottom.item == d->item->itemParent()) { + d->item->setY(adjustedPosition(d->bottom.item, d->bottom.anchorLine) - d->item->height() - d->bottomMargin); + } else if (d->bottom.item->itemParent() == d->item->itemParent()) { + d->item->setY(position(d->bottom.item, d->bottom.anchorLine) - d->item->height() - d->bottomMargin); + } + + d->updatingVerticalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; } } } @@ -471,14 +487,22 @@ void QFxAnchors::updateVCenterAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasVCenterAnchor) { - //(stetching handled in other update functions) + if (!d->updatingVerticalAnchor) { + d->updatingVerticalAnchor = true; - //Handle vCenter - if (d->vCenter.item == d->item->itemParent()) { - d->item->setY(adjustedPosition(d->vCenter.item, d->vCenter.anchorLine) - - d->item->height()/2 + d->vCenterOffset); - } else if (d->vCenter.item->itemParent() == d->item->itemParent()) { - d->item->setY(position(d->vCenter.item, d->vCenter.anchorLine) - d->item->height()/2 + d->vCenterOffset); + //(stetching handled in other update functions) + + //Handle vCenter + if (d->vCenter.item == d->item->itemParent()) { + d->item->setY(adjustedPosition(d->vCenter.item, d->vCenter.anchorLine) + - d->item->height()/2 + d->vCenterOffset); + } else if (d->vCenter.item->itemParent() == d->item->itemParent()) { + d->item->setY(position(d->vCenter.item, d->vCenter.anchorLine) - d->item->height()/2 + d->vCenterOffset); + } + + d->updatingVerticalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; } } } @@ -487,23 +511,31 @@ void QFxAnchors::updateLeftAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasLeftAnchor) { - //Handle stretching - bool invalid = true; - int width = 0; - if (d->usedAnchors & HasRightAnchor) { - invalid = d->calcStretch(d->left, d->right, d->leftMargin, -d->rightMargin, QFxAnchorLine::Left, width); - } else if (d->usedAnchors & HasHCenterAnchor) { - invalid = d->calcStretch(d->left, d->hCenter, d->leftMargin, d->hCenterOffset, QFxAnchorLine::Left, width); - width *= 2; - } - if (!invalid) - d->item->setWidth(width); + if (!d->updatingHorizontalAnchor) { + d->updatingHorizontalAnchor = true; - //Handle left - if (d->left.item == d->item->itemParent()) { - d->item->setX(adjustedPosition(d->left.item, d->left.anchorLine) + d->leftMargin); - } else if (d->left.item->itemParent() == d->item->itemParent()) { - d->item->setX(position(d->left.item, d->left.anchorLine) + d->leftMargin); + //Handle stretching + bool invalid = true; + int width = 0; + if (d->usedAnchors & HasRightAnchor) { + invalid = d->calcStretch(d->left, d->right, d->leftMargin, -d->rightMargin, QFxAnchorLine::Left, width); + } else if (d->usedAnchors & HasHCenterAnchor) { + invalid = d->calcStretch(d->left, d->hCenter, d->leftMargin, d->hCenterOffset, QFxAnchorLine::Left, width); + width *= 2; + } + if (!invalid) + d->item->setWidth(width); + + //Handle left + if (d->left.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->left.item, d->left.anchorLine) + d->leftMargin); + } else if (d->left.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->left.item, d->left.anchorLine) + d->leftMargin); + } + + d->updatingHorizontalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; } } } @@ -512,20 +544,28 @@ void QFxAnchors::updateRightAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasRightAnchor) { - //Handle stretching (left + right case is handled in updateLeftAnchor) - if (d->usedAnchors & HasHCenterAnchor) { - int width = 0; - bool invalid = d->calcStretch(d->hCenter, d->right, d->hCenterOffset, -d->rightMargin, - QFxAnchorLine::Left, width); - if (!invalid) - d->item->setWidth(width*2); - } - - //Handle right - if (d->right.item == d->item->itemParent()) { - d->item->setX(adjustedPosition(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); - } else if (d->right.item->itemParent() == d->item->itemParent()) { - d->item->setX(position(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); + if (!d->updatingHorizontalAnchor) { + d->updatingHorizontalAnchor = true; + + //Handle stretching (left + right case is handled in updateLeftAnchor) + if (d->usedAnchors & HasHCenterAnchor) { + int width = 0; + bool invalid = d->calcStretch(d->hCenter, d->right, d->hCenterOffset, -d->rightMargin, + QFxAnchorLine::Left, width); + if (!invalid) + d->item->setWidth(width*2); + } + + //Handle right + if (d->right.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); + } else if (d->right.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); + } + + d->updatingHorizontalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; } } } @@ -534,11 +574,19 @@ void QFxAnchors::updateHCenterAnchor() { Q_D(QFxAnchors); if (d->usedAnchors & HasHCenterAnchor) { - //Handle hCenter - if (d->hCenter.item == d->item->itemParent()) { - d->item->setX(adjustedPosition(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); - } else if (d->hCenter.item->itemParent() == d->item->itemParent()) { - d->item->setX(position(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); + if (!d->updatingHorizontalAnchor) { + d->updatingHorizontalAnchor = true; + + //Handle hCenter + if (d->hCenter.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); + } else if (d->hCenter.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); + } + + d->updatingHorizontalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; } } } diff --git a/src/declarative/fx/qfxanchors_p.h b/src/declarative/fx/qfxanchors_p.h index 3a5d1c7..76f83a8 100644 --- a/src/declarative/fx/qfxanchors_p.h +++ b/src/declarative/fx/qfxanchors_p.h @@ -64,7 +64,8 @@ class QFxAnchorsPrivate : public QObjectPrivate public: QFxAnchorsPrivate() : item(0), usedAnchors(0), fill(0), centeredIn(0), leftMargin(0), rightMargin(0), - topMargin(0), bottomMargin(0), vCenterOffset(0), hCenterOffset(0) + topMargin(0), bottomMargin(0), vCenterOffset(0), hCenterOffset(0), + updatingHorizontalAnchor(false), updatingVerticalAnchor(false) { } @@ -99,6 +100,9 @@ public: int bottomMargin; int vCenterOffset; int hCenterOffset; + + bool updatingHorizontalAnchor; + bool updatingVerticalAnchor; }; QT_END_NAMESPACE diff --git a/tests/auto/declarative/anchors/anchors.pro b/tests/auto/declarative/anchors/anchors.pro new file mode 100644 index 0000000..7b22cfb --- /dev/null +++ b/tests/auto/declarative/anchors/anchors.pro @@ -0,0 +1,5 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +SOURCES += tst_anchors.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/anchors/data/loop1.qml b/tests/auto/declarative/anchors/data/loop1.qml new file mode 100644 index 0000000..a4de1bf --- /dev/null +++ b/tests/auto/declarative/anchors/data/loop1.qml @@ -0,0 +1,6 @@ +Rect { + id: rect + width: 120; height: 200; color: "white" + Text { id: Text1; anchors.right: Text2.right; text: "Hello" } + Text { id: Text2; anchors.right: Text1.right; anchors.rightMargin: 10; text: "World" } +} diff --git a/tests/auto/declarative/anchors/data/loop2.qml b/tests/auto/declarative/anchors/data/loop2.qml new file mode 100644 index 0000000..4b2c74e --- /dev/null +++ b/tests/auto/declarative/anchors/data/loop2.qml @@ -0,0 +1,18 @@ +Rect { + id: container; + width: 600; + height: 600; + + Image { + id: Image1 + source: "http://labs.trolltech.com/blogs/wp-content/uploads/2009/03/3311388091_ac2a257feb.jpg" + anchors.right: Image2.left + } + + Image { + id: Image2 + source: "http://labs.trolltech.com/blogs/wp-content/uploads/2009/03/oslo_groupphoto.jpg" + anchors.left: Image1.right + anchors.leftMargin: 20 + } +} diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp new file mode 100644 index 0000000..7d920af --- /dev/null +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include +#include + +class tst_anchors : public QObject +{ + Q_OBJECT +public: + tst_anchors() {} + +private slots: + void loops(); +}; + +// mostly testing that we don't crash +void tst_anchors::loops() +{ + { + QFxView *view = new QFxView; + + view->setUrl(QUrl("file://" SRCDIR "/data/loop1.qml")); + + //### ignoreMessage doesn't seem to work + //QTest::ignoreMessage(QtWarningMsg, "QML QFxText (unknown location): Anchor loop detected on horizontal anchor."); + //QTest::ignoreMessage(QtWarningMsg, "QML QFxText (unknown location): Anchor loop detected on horizontal anchor."); + view->execute(); + qApp->processEvents(); + + delete view; + } + + { + QFxView *view = new QFxView; + + view->setUrl(QUrl("file://" SRCDIR "/data/loop2.qml")); + + //### ignoreMessage doesn't seem to work + //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor."); + //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor."); + view->execute(); + qApp->processEvents(); + + delete view; + } +} + +QTEST_MAIN(tst_anchors) + +#include "tst_anchors.moc" -- cgit v0.12 From f0e828c05e8263078b0eb5a45ddea24e7a0782eb Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 11 May 2009 11:29:41 +1000 Subject: Change pathview angle. --- demos/declarative/flickr/flickr.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 092aef6..fa3bc35 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -153,7 +153,7 @@ Item { } PathAttribute { name: "scale"; value: 1 } - PathAttribute { name: "angle"; value: -45 } + PathAttribute { name: "angle"; value: 45 } } } -- cgit v0.12 From 738fe5730a55279bf3c033bad7317768d81f40af Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 11:36:57 +1000 Subject: Handle QmlParserStatus's and QmlBindableValeus being deleted during component creation --- src/declarative/qml/qmlbindablevalue.cpp | 5 +++- src/declarative/qml/qmlbindablevalue_p.h | 2 ++ src/declarative/qml/qmlcompiler.cpp | 25 ++++++++++++++++---- src/declarative/qml/qmlcomponent.cpp | 40 +++++++++++++++++++++++--------- src/declarative/qml/qmlcomponent_p.h | 7 ++++-- src/declarative/qml/qmlengine.cpp | 29 +++++++++++++++++++++++ src/declarative/qml/qmlengine_p.h | 31 +++++++++++++++++++++++-- src/declarative/qml/qmlinstruction_p.h | 2 ++ src/declarative/qml/qmlparserstatus.cpp | 12 +++++++--- src/declarative/qml/qmlparserstatus.h | 7 ++++++ src/declarative/qml/qmlvme.cpp | 35 +++++++++++++++++++++------- 11 files changed, 164 insertions(+), 31 deletions(-) diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index 3950f82..9f4886a 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(scriptWarnings, QML_SCRIPT_WARNINGS); QmlBindableValuePrivate::QmlBindableValuePrivate() -: inited(false) +: inited(false), mePtr(0) { } @@ -75,6 +75,9 @@ QmlBindableValue::QmlBindableValue(const QString &str, QObject *obj, bool sse, Q QmlBindableValue::~QmlBindableValue() { + Q_D(QmlBindableValue); + if(d->mePtr) + *(d->mePtr) = 0; } void QmlBindableValue::setTarget(const QmlMetaProperty &prop) diff --git a/src/declarative/qml/qmlbindablevalue_p.h b/src/declarative/qml/qmlbindablevalue_p.h index b6de5b7..70c001b 100644 --- a/src/declarative/qml/qmlbindablevalue_p.h +++ b/src/declarative/qml/qmlbindablevalue_p.h @@ -56,6 +56,8 @@ public: bool inited; QmlMetaProperty property; + + QmlBindableValue **mePtr; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 13fc332..5dbc5c3 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -526,6 +526,8 @@ void QmlCompiler::compileTree(Object *tree) init.type = QmlInstruction::Init; init.line = 0; init.init.dataSize = 0; + init.init.bindingsSize = 0; + init.init.parserStatusSize = 0; output->bytecode << init; if (!compileObject(tree, 0)) // Compile failed @@ -698,6 +700,8 @@ bool QmlCompiler::compileComponentFromRoot(Object *obj, int ctxt) QmlInstruction init; init.type = QmlInstruction::Init; init.init.dataSize = 0; + init.init.bindingsSize = 0; + init.init.parserStatusSize = 0; init.line = obj->location.start.line; output->bytecode << init; @@ -1378,6 +1382,8 @@ int QmlCompiler::optimizeExpressions(int start, int end, int patch) QHash ids; int saveCount = 0; int newInstrs = 0; + int bindingsCount = 0; + int parserStatusCount = 0; for (int ii = start; ii <= end; ++ii) { const QmlInstruction &instr = output->bytecode.at(ii); @@ -1400,6 +1406,17 @@ int QmlCompiler::optimizeExpressions(int start, int end, int patch) ii += instr.createComponent.count - 1; continue; } + + if (instr.type == QmlInstruction::AssignBinding || + instr.type == QmlInstruction::AssignCompiledBinding || + instr.type == QmlInstruction::StoreBinding || + instr.type == QmlInstruction::StoreCompiledBinding) { + ++bindingsCount; + } else if (instr.type == QmlInstruction::TryBeginObject || + instr.type == QmlInstruction::BeginObject) { + ++parserStatusCount; + } + if (instr.type == QmlInstruction::StoreCompiledBinding) { QmlBasicScript s(output->datas.at(instr.assignBinding.value).constData()); @@ -1437,12 +1454,12 @@ int QmlCompiler::optimizeExpressions(int start, int end, int patch) ++newInstrs; } } - } - + } } - if (saveCount) - output->bytecode[patch].init.dataSize = saveCount; + output->bytecode[patch].init.dataSize = saveCount; + output->bytecode[patch].init.bindingsSize = bindingsCount; + output->bytecode[patch].init.parserStatusSize = parserStatusCount;; return newInstrs; } diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 027c2a8..da8f26d 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -171,6 +171,11 @@ QmlComponent::~QmlComponent() } if (d->cc) d->cc->release(); + + for(int ii = 0; ii < d->bindValues.count(); ++ii) + QmlEnginePrivate::clear(d->bindValues[ii]); + for(int ii = 0; ii < d->parserStatus.count(); ++ii) + QmlEnginePrivate::clear(d->parserStatus[ii]); } /*! @@ -483,10 +488,10 @@ QObject *QmlComponent::beginCreate(QmlContext *context) if (ep->rootComponent == this) { ep->rootComponent = 0; - d->bindValues = ep->currentBindValues; - d->parserStatus = ep->currentParserStatus; - ep->currentBindValues.clear(); - ep->currentParserStatus.clear(); + d->bindValues = ep->bindValues; + d->parserStatus = ep->parserStatus; + ep->bindValues.clear(); + ep->parserStatus.clear(); d->completePending = true; } } else { @@ -511,16 +516,29 @@ void QmlComponent::completeCreate() #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer bi; #endif - for (int ii = 0; ii < d->bindValues.count(); ++ii) - d->bindValues.at(ii)->init(); + for (int ii = 0; ii < d->bindValues.count(); ++ii) { + QmlEnginePrivate::SimpleList bv = + d->bindValues.at(ii); + for (int jj = 0; jj < bv.count; ++jj) { + if(bv.at(jj)) + bv.at(jj)->init(); + } + QmlEnginePrivate::clear(bv); + } } - QSet done; + for (int ii = 0; ii < d->parserStatus.count(); ++ii) { - QmlParserStatus *ps = d->parserStatus.at(ii); - if (!done.contains(ps)) { - done.insert(ps); - ps->componentComplete(); + QmlEnginePrivate::SimpleList ps = + d->parserStatus.at(ii); + + for (int jj = 0; jj < ps.count; ++jj) { + QmlParserStatus *status = ps.at(jj); + if (status && status->d) { + status->d = 0; + status->componentComplete(); + } } + QmlEnginePrivate::clear(ps); } d->bindValues.clear(); diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qmlcomponent_p.h index 6a5345e..4de47c6 100644 --- a/src/declarative/qml/qmlcomponent_p.h +++ b/src/declarative/qml/qmlcomponent_p.h @@ -46,6 +46,7 @@ #include #include #include "private/qobject_p.h" +#include "private/qmlengine_p.h" #include "private/qmlcompositetypemanager_p.h" #include #include "qmlcomponent.h" @@ -75,8 +76,10 @@ public: int start; int count; QmlCompiledComponent *cc; - QList bindValues; - QList parserStatus; + + QList > bindValues; + QList > parserStatus; + bool completePending; QmlEngine *engine; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 50c0981..f0ec334 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -70,6 +70,7 @@ #include #include #include "private/qmlmetaproperty_p.h" +#include QT_BEGIN_NAMESPACE @@ -160,6 +161,34 @@ QmlEnginePrivate::~QmlEnginePrivate() objectClass = 0; delete networkAccessManager; networkAccessManager = 0; + + for(int ii = 0; ii < bindValues.count(); ++ii) + clear(bindValues[ii]); + for(int ii = 0; ii < parserStatus.count(); ++ii) + clear(parserStatus[ii]); +} + +void QmlEnginePrivate::clear(SimpleList &bvs) +{ + for (int ii = 0; ii < bvs.count; ++ii) { + QmlBindableValue *bv = bvs.at(ii); + if(bv) { + QmlBindableValuePrivate *p = + static_cast(QObjectPrivate::get(bv)); + p->mePtr = 0; + } + } + bvs.clear(); +} + +void QmlEnginePrivate::clear(SimpleList &pss) +{ + for (int ii = 0; ii < pss.count; ++ii) { + QmlParserStatus *ps = pss.at(ii); + if(ps) + ps->d = 0; + } + pss.clear(); } void QmlEnginePrivate::init() diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 63df0ba..9402fa9 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -107,8 +107,35 @@ public: QScriptEngine scriptEngine; - QList currentBindValues; - QList currentParserStatus; + template + struct SimpleList { + SimpleList() + : count(0), values(0) {} + SimpleList(int r) + : count(0), values(new T*[r]) {} + + int count; + T **values; + + void append(T *v) { + values[count++] = v; + } + + T *at(int idx) const { + return values[idx]; + } + + void clear() { + delete [] values; + } + }; + + static void clear(SimpleList &); + static void clear(SimpleList &); + + QList > bindValues; + QList > parserStatus; + QmlComponent *rootComponent; mutable QNetworkAccessManager *networkAccessManager; diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index 02e084d..86bddf8 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -173,6 +173,8 @@ public: union { struct { int dataSize; + int bindingsSize; + int parserStatusSize; } init; struct { int type; diff --git a/src/declarative/qml/qmlparserstatus.cpp b/src/declarative/qml/qmlparserstatus.cpp index 71b7adf..fceac05 100644 --- a/src/declarative/qml/qmlparserstatus.cpp +++ b/src/declarative/qml/qmlparserstatus.cpp @@ -48,11 +48,17 @@ QT_BEGIN_NAMESPACE \brief The QmlParserStatus class provides updates on the parser state. */ -/*! - Destroys the parser status instance. -*/ +/*! \internal */ +QmlParserStatus::QmlParserStatus() +: d(0) +{ +} + +/*! \internal */ QmlParserStatus::~QmlParserStatus() { + if(d) + (*d) = 0; } /*! diff --git a/src/declarative/qml/qmlparserstatus.h b/src/declarative/qml/qmlparserstatus.h index bb3691c..0e58229 100644 --- a/src/declarative/qml/qmlparserstatus.h +++ b/src/declarative/qml/qmlparserstatus.h @@ -53,11 +53,18 @@ QT_MODULE(Declarative) class Q_DECLARATIVE_EXPORT QmlParserStatus { public: + QmlParserStatus(); virtual ~QmlParserStatus(); virtual void classBegin(); virtual void classComplete(); virtual void componentComplete(); + +private: + friend class QmlVME; + friend class QmlComponent; + friend class QmlEnginePrivate; + QmlParserStatus **d; }; Q_DECLARE_INTERFACE(QmlParserStatus, "com.trolltech.qml.QmlParserStatus"); diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index ca4f9c9..e42b2fc 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -62,6 +62,8 @@ #include #include "private/qmlvmemetaobject_p.h" #include +#include +#include QT_BEGIN_NAMESPACE Q_DECLARE_PERFORMANCE_LOG(QFxCompiler) { @@ -219,9 +221,8 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer cr; #endif - - QList parserStatuses; - QList bindableValues; + QmlEnginePrivate::SimpleList bindValues; + QmlEnginePrivate::SimpleList parserStatus; QStack stack; QStack qliststack; @@ -252,6 +253,11 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in ::memset(savedObjects, 0, sizeof(QObject *)*instr.init.dataSize); } + + if (instr.init.bindingsSize) + bindValues = QmlEnginePrivate::SimpleList(instr.init.bindingsSize); + if (instr.init.parserStatusSize) + parserStatus = QmlEnginePrivate::SimpleList(instr.init.parserStatusSize); } break; @@ -523,8 +529,10 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in #endif QObject *target = stack.top(); QmlParserStatus *status = reinterpret_cast(reinterpret_cast(target) + instr.begin.castValue); + parserStatus.append(status); + status->d = &parserStatus.values[parserStatus.count - 1]; + status->classBegin(); - parserStatuses << status; } break; @@ -634,10 +642,13 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in VME_EXCEPTION("Cannot assign a binding to read-only property" << mp.name()); QmlBindableValue *bind = new QmlBindableValue((void *)datas.at(instr.assignBinding.value).constData(), comp, context, 0); + bindValues.append(bind); + QmlBindableValuePrivate *p = + static_cast(QObjectPrivate::get(bind)); + p->mePtr = &bindValues.values[bindValues.count - 1]; QFx_setParent_noEvent(bind, target); bind->setTarget(mp); - bindableValues << bind; } break; @@ -656,10 +667,13 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in VME_EXCEPTION("Cannot assign a binding to read-only property" << mp.name()); QmlBindableValue *bind = new QmlBindableValue(primitives.at(instr.assignBinding.value), context, false); + bindValues.append(bind); + QmlBindableValuePrivate *p = + static_cast(QObjectPrivate::get(bind)); + p->mePtr = &bindValues.values[bindValues.count - 1]; QFx_setParent_noEvent(bind, target); bind->setTarget(mp); - bindableValues << bind; } break; @@ -1045,12 +1059,17 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in if (!stack.isEmpty()) { delete stack.at(0); } + + QmlEnginePrivate::clear(bindValues); + QmlEnginePrivate::clear(parserStatus); return 0; } QmlEnginePrivate *ep = ctxt->engine()->d_func(); - ep->currentBindValues << bindableValues; - ep->currentParserStatus << parserStatuses; + if (bindValues.count) + ep->bindValues << bindValues; + if (parserStatus.count) + ep->parserStatus << parserStatus; comp->dumpPost(); -- cgit v0.12 From 2c0907297938e1c948774b0e02b9ee6a26c3984b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 11 May 2009 11:43:56 +1000 Subject: Lower case role names are needed. --- src/corelib/kernel/qabstractitemmodel.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index a23c137..00a3306 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -471,12 +471,12 @@ const QHash &QAbstractItemModelPrivate::defaultRoleNames() { static QHash roleNames; if (roleNames.isEmpty()) { - roleNames[Qt::DisplayRole] = "Display"; - roleNames[Qt::DecorationRole] = "Decoration"; - roleNames[Qt::EditRole] = "Edit"; - roleNames[Qt::ToolTipRole] = "ToolTip"; - roleNames[Qt::StatusTipRole] = "StatusTip"; - roleNames[Qt::WhatsThisRole] = "WhatsThis"; + roleNames[Qt::DisplayRole] = "display"; + roleNames[Qt::DecorationRole] = "decoration"; + roleNames[Qt::EditRole] = "edit"; + roleNames[Qt::ToolTipRole] = "toolTip"; + roleNames[Qt::StatusTipRole] = "statusTip"; + roleNames[Qt::WhatsThisRole] = "whatsThis"; } return roleNames; @@ -1859,6 +1859,7 @@ void QAbstractItemModel::setRoleNames(const QHash &roleNames) const QHash &QAbstractItemModel::roleNames() const { Q_D(const QAbstractItemModel); + qDebug() << "roles" << d->roleNames; return d->roleNames; } -- cgit v0.12 From 5c69031b23f349d199ed43e484a608a2b691bb95 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 11:56:34 +1000 Subject: When a QmlContext is destroyed, associated objects must be disassociated --- src/declarative/qml/qmlcontext.cpp | 12 ++++++++++++ src/declarative/qml/qmlcontext.h | 1 + src/declarative/qml/qmlcontext_p.h | 1 + src/declarative/qml/qmldeclarativedata_p.h | 1 + src/declarative/qml/qmlengine.cpp | 14 ++++++++++---- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index dfcf413..16399bc 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -231,6 +231,18 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent) */ QmlContext::~QmlContext() { + Q_D(QmlContext); + for(int ii = 0; ii < d->contextObjects.count(); ++ii) { + QObjectPrivate *p = QObjectPrivate::get(d->contextObjects.at(ii)); + QmlSimpleDeclarativeData *data = + static_cast(p->declarativeData); + if(data && (data->flags & QmlSimpleDeclarativeData::Extended)) { + data->context = 0; + } else { + p->declarativeData = 0; + } + } + d->contextObjects.clear(); } diff --git a/src/declarative/qml/qmlcontext.h b/src/declarative/qml/qmlcontext.h index 39d565a..935c7ca 100644 --- a/src/declarative/qml/qmlcontext.h +++ b/src/declarative/qml/qmlcontext.h @@ -95,6 +95,7 @@ private: friend class QmlComponent; friend class QmlScriptPrivate; friend class QmlBoundSignalProxy; + friend class QmlSimpleDeclarativeData; QmlContext(QmlEngine *); }; diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index d7c6d29..9faa7b7 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -88,6 +88,7 @@ public: void addDefaultObject(QObject *, Priority); QmlSimpleDeclarativeData contextData; + QObjectList contextObjects; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmldeclarativedata_p.h b/src/declarative/qml/qmldeclarativedata_p.h index a934442..fb7a015 100644 --- a/src/declarative/qml/qmldeclarativedata_p.h +++ b/src/declarative/qml/qmldeclarativedata_p.h @@ -51,6 +51,7 @@ class QmlSimpleDeclarativeData : public QDeclarativeData public: QmlSimpleDeclarativeData() : flags(0), context(0) {} + virtual void destroyed(QObject *); enum Flag { Extended = 0x00000001 }; quint32 flags; QmlContext *context; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index f0ec334..fc209c6 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -659,11 +659,10 @@ void QmlEngine::setContextForObject(QObject *object, QmlContext *context) if (!data) { priv->declarativeData = &context->d_func()->contextData; } else { - // ### - Don't have to use extended data here - QmlExtendedDeclarativeData *data = new QmlExtendedDeclarativeData; data->context = context; - priv->declarativeData = data; } + + context->d_func()->contextObjects.append(object); } QmlContext *qmlContext(const QObject *obj) @@ -713,8 +712,15 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object) return rv; } -void QmlExtendedDeclarativeData::destroyed(QObject *) +void QmlSimpleDeclarativeData::destroyed(QObject *object) +{ + if (context) + context->d_func()->contextObjects.removeAll(object); +} + +void QmlExtendedDeclarativeData::destroyed(QObject *object) { + QmlSimpleDeclarativeData::destroyed(object); delete this; } -- cgit v0.12 From b9f263eb1e5871ed724452e7454b8414e554ead6 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 12:13:04 +1000 Subject: Clean up QmlContext's and QmlExpression's when a context gets deleted --- src/declarative/qml/qmlcontext.cpp | 34 +++++++++++++++++++++++++++++++++- src/declarative/qml/qmlcontext_p.h | 5 +++++ src/declarative/qml/qmlengine.cpp | 12 ++++++++++-- src/declarative/qml/qmlexpression.h | 1 + 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 16399bc..df5f90e 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -86,6 +86,10 @@ void QmlContextPrivate::destroyed(QObject *obj) void QmlContextPrivate::init() { Q_Q(QmlContext); + + if (parent) + parent->d_func()->childContexts.insert(q); + //set scope chain QScriptEngine *scriptEngine = engine->scriptEngine(); QScriptValue scopeObj = @@ -232,7 +236,24 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent) QmlContext::~QmlContext() { Q_D(QmlContext); - for(int ii = 0; ii < d->contextObjects.count(); ++ii) { + if (d->parent) + d->parent->d_func()->childContexts.remove(this); + + for (QSet::ConstIterator iter = d->childContexts.begin(); + iter != d->childContexts.end(); + ++iter) { + (*iter)->d_func()->invalidateEngines(); + (*iter)->d_func()->parent = 0; + } + + for (QSet::ConstIterator iter = + d->childExpressions.begin(); + iter != d->childExpressions.end(); + ++iter) { + (*iter)->d->ctxt = 0; + } + + for (int ii = 0; ii < d->contextObjects.count(); ++ii) { QObjectPrivate *p = QObjectPrivate::get(d->contextObjects.at(ii)); QmlSimpleDeclarativeData *data = static_cast(p->declarativeData); @@ -245,6 +266,17 @@ QmlContext::~QmlContext() d->contextObjects.clear(); } +void QmlContextPrivate::invalidateEngines() +{ + if (!engine) + return; + engine = 0; + for (QSet::ConstIterator iter = childContexts.begin(); + iter != childContexts.end(); + ++iter) { + (*iter)->d_func()->invalidateEngines(); + } +} /*! Return the context's QmlEngine, or 0 if the context has no QmlEngine or the diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index 9faa7b7..c265474 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -47,6 +47,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE class QmlContext; @@ -87,6 +88,10 @@ public: }; void addDefaultObject(QObject *, Priority); + void invalidateEngines(); + QSet childContexts; + QSet childExpressions; + QmlSimpleDeclarativeData contextData; QObjectList contextObjects; }; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index fc209c6..c39a0d5 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -805,6 +805,8 @@ QmlExpression::QmlExpression(QmlContext *ctxt, void *expr, d->ctxt = ctxt; if(ctxt && ctxt->engine()) d->id = ctxt->engine()->d_func()->getUniqueId(); + if(ctxt) + ctxt->d_func()->childExpressions.insert(this); d->me = me; } @@ -816,6 +818,8 @@ QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expr, d->ctxt = ctxt; if(ctxt && ctxt->engine()) d->id = ctxt->engine()->d_func()->getUniqueId(); + if(ctxt) + ctxt->d_func()->childExpressions.insert(this); d->me = me; } @@ -833,6 +837,8 @@ QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expression, d->ctxt = ctxt; if(ctxt && ctxt->engine()) d->id = ctxt->engine()->d_func()->getUniqueId(); + if(ctxt) + ctxt->d_func()->childExpressions.insert(this); d->me = scope; } @@ -841,6 +847,8 @@ QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expression, */ QmlExpression::~QmlExpression() { + if (d->ctxt) + d->ctxt->d_func()->childExpressions.remove(this); delete d; d = 0; } @@ -850,7 +858,7 @@ QmlExpression::~QmlExpression() */ QmlEngine *QmlExpression::engine() const { - return d->ctxt->engine(); + return d->ctxt?d->ctxt->engine():0; } /*! @@ -927,7 +935,7 @@ void BindExpressionProxy::changed() QVariant QmlExpression::value() { QVariant rv; - if (!d->ctxt || (!d->sse.isValid() && d->expression.isEmpty())) + if (!d->ctxt || !engine() || (!d->sse.isValid() && d->expression.isEmpty())) return rv; #ifdef Q_ENABLE_PERFORMANCE_LOG diff --git a/src/declarative/qml/qmlexpression.h b/src/declarative/qml/qmlexpression.h index bb6980a..2c6b1ad 100644 --- a/src/declarative/qml/qmlexpression.h +++ b/src/declarative/qml/qmlexpression.h @@ -87,6 +87,7 @@ protected: private: friend class BindExpressionProxy; friend class QmlDebugger; + friend class QmlContext; QmlExpressionPrivate *d; }; -- cgit v0.12 From 9edfcd1ecd905ca27fbe9f241e37ab5fb204f89a Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 13:10:28 +1000 Subject: Update repaint region when removing items --- src/declarative/canvas/qsimplecanvasitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp index ba33a41..90ee688 100644 --- a/src/declarative/canvas/qsimplecanvasitem.cpp +++ b/src/declarative/canvas/qsimplecanvasitem.cpp @@ -1332,6 +1332,7 @@ QSimpleCanvasItem::~QSimpleCanvasItem() parent()->remChild(this); delete d->graphicsItem; } else { + update(); setOptions(MouseFilter, false); if (d->canvas){ -- cgit v0.12 From 8bb9edaeda5e14df3402c5990a0630a664048ac9 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 11 May 2009 13:15:05 +1000 Subject: Compile --- src/declarative/qml/qmlcontext_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index c265474..99dc669 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE class QmlContext; +class QmlExpression; class QmlEngine; class QmlCompiledComponent; -- cgit v0.12 From 865c022c2df25496055de897f37f8206cb4fc730 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 11 May 2009 13:21:05 +1000 Subject: d-pointerize QmlOpenMetaObject --- src/declarative/fx/qfxvisualitemmodel.cpp | 1 + src/declarative/qml/qmlcontext_p.h | 1 + src/declarative/util/qmlopenmetaobject.cpp | 120 +++++++++++++++++------------ src/declarative/util/qmlopenmetaobject.h | 17 ++-- 4 files changed, 78 insertions(+), 61 deletions(-) diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index 9428281..61f08de 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -47,6 +47,7 @@ #include "qhash.h" #include "qlist.h" #include "private/qobject_p.h" +#include "private/qmetaobjectbuilder_p.h" #include "qmlopenmetaobject.h" #include "qmllistaccessor.h" #include "qfxvisualitemmodel.h" diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index c265474..97a816c 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE class QmlContext; class QmlEngine; +class QmlExpression; class QmlCompiledComponent; class QmlContextPrivate : public QObjectPrivate diff --git a/src/declarative/util/qmlopenmetaobject.cpp b/src/declarative/util/qmlopenmetaobject.cpp index fc20fa9..d0dd817 100644 --- a/src/declarative/util/qmlopenmetaobject.cpp +++ b/src/declarative/util/qmlopenmetaobject.cpp @@ -40,102 +40,124 @@ ****************************************************************************/ #include "qmlopenmetaobject.h" +#include "private/qmetaobjectbuilder_p.h" #include QT_BEGIN_NAMESPACE + +class QmlOpenMetaObjectPrivate +{ +public: + QmlOpenMetaObjectPrivate() : parent(0), mem(0) {} + + bool autoCreate; + QAbstractDynamicMetaObject *parent; + int propertyOffset; + int signalOffset; + QList data; + QHash names; + QMetaObjectBuilder mob; + QMetaObject *mem; + QObject *object; +}; + QmlOpenMetaObject::QmlOpenMetaObject(QObject *obj, bool automatic) -: autoCreate(automatic), parent(0), mem(0), _object(obj) +: d(new QmlOpenMetaObjectPrivate) { - mob.setSuperClass(obj->metaObject()); - mob.setClassName(obj->metaObject()->className()); - mob.setFlags(QMetaObjectBuilder::DynamicMetaObject); + d->autoCreate = automatic; + d->object = obj; + + d->mob.setSuperClass(obj->metaObject()); + d->mob.setClassName(obj->metaObject()->className()); + d->mob.setFlags(QMetaObjectBuilder::DynamicMetaObject); QObjectPrivate *op = QObjectPrivate::get(obj); if (op->metaObject) - mob.setSuperClass(op->metaObject); + d->mob.setSuperClass(op->metaObject); - mem = mob.toMetaObject(); - *static_cast(this) = *mem; + d->mem = d->mob.toMetaObject(); + *static_cast(this) = *d->mem; op->metaObject = this; - _propertyOffset = propertyOffset(); - _signalOffset = methodOffset(); + d->propertyOffset = propertyOffset(); + d->signalOffset = methodOffset(); } QmlOpenMetaObject::~QmlOpenMetaObject() { - if (parent) - delete parent; - qFree(mem); + if (d->parent) + delete d->parent; + qFree(d->mem); + delete d; } int QmlOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a) { if (( c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty) - && id >= _propertyOffset) { - int propId = id - _propertyOffset; + && id >= d->propertyOffset) { + int propId = id - d->propertyOffset; if (c == QMetaObject::ReadProperty) { propertyRead(propId); - *reinterpret_cast(a[0]) = data[propId]; + *reinterpret_cast(a[0]) = d->data[propId]; } else if (c == QMetaObject::WriteProperty) { - if (data[propId] != *reinterpret_cast(a[0])) { + if (d->data[propId] != *reinterpret_cast(a[0])) { propertyWrite(propId); - data[propId] = *reinterpret_cast(a[0]); - activate(_object, _signalOffset + propId, 0); + d->data[propId] = *reinterpret_cast(a[0]); + activate(d->object, d->signalOffset + propId, 0); } } return -1; } else { - if (parent) - return parent->metaCall(c, id, a); + if (d->parent) + return d->parent->metaCall(c, id, a); else - return _object->qt_metacall(c, id, a); + return d->object->qt_metacall(c, id, a); } } QVariant QmlOpenMetaObject::value(int id) const { - Q_ASSERT(id >= 0 && id < data.count()); - return data.at(id); + Q_ASSERT(id >= 0 && id < d->data.count()); + return d->data.at(id); } void QmlOpenMetaObject::setValue(int id, const QVariant &value) { - Q_ASSERT(id >= 0 && id < data.count()); - data[id] = value; - activate(_object, id + _signalOffset, 0); + Q_ASSERT(id >= 0 && id < d->data.count()); + d->data[id] = value; + activate(d->object, id + d->signalOffset, 0); } QVariant QmlOpenMetaObject::value(const QByteArray &name) const { - QHash::ConstIterator iter = names.find(name); - if (iter == names.end()) + QHash::ConstIterator iter = d->names.find(name); + if (iter == d->names.end()) return QVariant(); - return data.at(*iter); + return d->data.at(*iter); } void QmlOpenMetaObject::setValue(const QByteArray &name, const QVariant &val) { - QHash::ConstIterator iter = names.find(name); + QHash::ConstIterator iter = d->names.find(name); int id = -1; - if (iter == names.end()) { - id = doCreateProperty(name.constData()) - _propertyOffset; + if (iter == d->names.end()) { + id = doCreateProperty(name.constData()) - d->propertyOffset; } else { id = *iter; } - if (data[id] == val) + if (d->data[id] == val) return; - data[id] = val; - activate(_object, id + _signalOffset, 0); + d->data[id] = val; + activate(d->object, id + d->signalOffset, 0); } int QmlOpenMetaObject::createProperty(const char *name, const char *) { - if (autoCreate) + if (d->autoCreate) return doCreateProperty(name); else return -1; @@ -143,17 +165,17 @@ int QmlOpenMetaObject::createProperty(const char *name, const char *) int QmlOpenMetaObject::doCreateProperty(const char *name) { - int id = mob.propertyCount(); - mob.addSignal("__" + QByteArray::number(id) + "()"); - QMetaPropertyBuilder build = mob.addProperty(name, "QVariant", id); + int id = d->mob.propertyCount(); + d->mob.addSignal("__" + QByteArray::number(id) + "()"); + QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id); build.setDynamic(true); - data << propertyCreated(id, build); - qFree(mem); - mem = mob.toMetaObject(); - *static_cast(this) = *mem; - names.insert(name, id); + d->data << propertyCreated(id, build); + qFree(d->mem); + d->mem = d->mob.toMetaObject(); + *static_cast(this) = *d->mem; + d->names.insert(name, id); - return _propertyOffset + id; + return d->propertyOffset + id; } void QmlOpenMetaObject::propertyRead(int) @@ -171,19 +193,19 @@ QVariant QmlOpenMetaObject::propertyCreated(int, QMetaPropertyBuilder &) int QmlOpenMetaObject::count() const { - return data.count(); + return d->data.count(); } QByteArray QmlOpenMetaObject::name(int idx) const { - Q_ASSERT(idx >= 0 && idx < data.count()); + Q_ASSERT(idx >= 0 && idx < d->data.count()); - return mob.property(idx).name(); + return d->mob.property(idx).name(); } QObject *QmlOpenMetaObject::object() const { - return _object; + return d->object; } QT_END_NAMESPACE diff --git a/src/declarative/util/qmlopenmetaobject.h b/src/declarative/util/qmlopenmetaobject.h index 17cecd87..f842f96 100644 --- a/src/declarative/util/qmlopenmetaobject.h +++ b/src/declarative/util/qmlopenmetaobject.h @@ -43,16 +43,16 @@ #define QMLOPENMETAOBJECT_H #include -#include "private/qmetaobjectbuilder_p.h" -#include +#include #include - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QmlOpenMetaObjectPrivate; +class QMetaPropertyBuilder; class Q_DECLARATIVE_EXPORT QmlOpenMetaObject : public QAbstractDynamicMetaObject { public: @@ -78,15 +78,8 @@ protected: private: int doCreateProperty(const char *); - bool autoCreate; - QAbstractDynamicMetaObject *parent; - int _propertyOffset; - int _signalOffset; - QList data; - QHash names; - QMetaObjectBuilder mob; - QMetaObject *mem; - QObject *_object; + + QmlOpenMetaObjectPrivate *d; }; -- cgit v0.12 From 62ca28e8bfd469a227f7099eb0c2e76b0b2cb2e8 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 May 2009 13:33:09 +1000 Subject: Detect binding loops. Don't crash when a looping binding has been established. Instead, print a warning and stop looping. --- src/declarative/qml/qmlbindablevalue.cpp | 185 +++++++++++---------- src/declarative/qml/qmlbindablevalue_p.h | 1 + .../qmlbindengine/tst_qmlbindengine.cpp | 39 ++++- 3 files changed, 135 insertions(+), 90 deletions(-) diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index 9f4886a..d5157b6 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -43,16 +43,17 @@ #include "qmlbindablevalue.h" #include "qmlbindablevalue_p.h" #include +#include #include #include #include - QT_BEGIN_NAMESPACE + DEFINE_BOOL_CONFIG_OPTION(scriptWarnings, QML_SCRIPT_WARNINGS); QmlBindableValuePrivate::QmlBindableValuePrivate() -: inited(false), mePtr(0) +: inited(false), updating(false), mePtr(0) { } @@ -121,102 +122,110 @@ void QmlBindableValue::update() if (!d->inited) return; - if (d->property.propertyCategory() == QmlMetaProperty::List) { - QVariant value = this->value(); - int listType = QmlMetaType::listType(d->property.propertyType()); - - if (value.userType() == qMetaTypeId >()) { - const QList &list = - qvariant_cast >(value); - QVariant listVar = d->property.read(); - QmlMetaType::clear(listVar); - for (int ii = 0; ii < list.count(); ++ii) { - QVariant v = QmlMetaType::fromObject(list.at(ii), listType); - QmlMetaType::append(listVar, v); - } + if (!d->updating) { + d->updating = true; + + if (d->property.propertyCategory() == QmlMetaProperty::List) { + QVariant value = this->value(); + int listType = QmlMetaType::listType(d->property.propertyType()); + + if (value.userType() == qMetaTypeId >()) { + const QList &list = + qvariant_cast >(value); + QVariant listVar = d->property.read(); + QmlMetaType::clear(listVar); + for (int ii = 0; ii < list.count(); ++ii) { + QVariant v = QmlMetaType::fromObject(list.at(ii), listType); + QmlMetaType::append(listVar, v); + } - } else if (value.type() == uint(listType) || - value.userType() == listType) { - QVariant listVar = d->property.read(); - QmlMetaType::clear(listVar); - QmlMetaType::append(listVar, value); - } - } else if (d->property.propertyCategory() == QmlMetaProperty::QmlList) { - // XXX - optimize! - QVariant value = this->value(); - QVariant list = d->property.read(); - QmlPrivate::ListInterface *li = - *(QmlPrivate::ListInterface **)list.constData(); - - int type = li->type(); - - if (QObject *obj = QmlMetaType::toQObject(value)) { - const QMetaObject *mo = - QmlMetaType::rawMetaObjectForType(type); - - const QMetaObject *objMo = obj->metaObject(); - bool found = false; - while(!found && objMo) { - if (objMo == mo) - found = true; - else - objMo = objMo->superClass(); + } else if (value.type() == uint(listType) || + value.userType() == listType) { + QVariant listVar = d->property.read(); + QmlMetaType::clear(listVar); + QmlMetaType::append(listVar, value); } + } else if (d->property.propertyCategory() == QmlMetaProperty::QmlList) { + // XXX - optimize! + QVariant value = this->value(); + QVariant list = d->property.read(); + QmlPrivate::ListInterface *li = + *(QmlPrivate::ListInterface **)list.constData(); + + int type = li->type(); + + if (QObject *obj = QmlMetaType::toQObject(value)) { + const QMetaObject *mo = + QmlMetaType::rawMetaObjectForType(type); + + const QMetaObject *objMo = obj->metaObject(); + bool found = false; + while(!found && objMo) { + if (objMo == mo) + found = true; + else + objMo = objMo->superClass(); + } - if (!found) { - qWarning() << "Unable to assign object to list"; - return; - } + if (!found) { + qWarning() << "Unable to assign object to list"; + return; + } - // NOTE: This assumes a cast to QObject does not alter - // the object pointer - void *d = (void *)&obj; - li->append(d); - } - } else if (d->property.propertyCategory() == QmlMetaProperty::Bindable) { - - // NOTE: We assume that only core properties can have - // propertyType == Bindable - int idx = d->property.coreIndex(); - Q_ASSERT(idx != -1); - - void *a[1]; - QmlBindableValue *t = this; - a[0] = (void *)&t; - d->property.object()->qt_metacall(QMetaObject::WriteProperty, - idx, a); - - } else if (d->property.propertyCategory() == QmlMetaProperty::Object) { - - QVariant value = this->value(); - if ((int)value.type() != qMetaTypeId()) { - if (scriptWarnings()) { - if (!value.isValid()) { - qWarning() << "QmlBindableValue: Unable to assign invalid value to object property"; - } else { - qWarning() << "QmlBindableValue: Unable to assign non-object to object property"; + // NOTE: This assumes a cast to QObject does not alter + // the object pointer + void *d = (void *)&obj; + li->append(d); + } + } else if (d->property.propertyCategory() == QmlMetaProperty::Bindable) { + + // NOTE: We assume that only core properties can have + // propertyType == Bindable + int idx = d->property.coreIndex(); + Q_ASSERT(idx != -1); + + void *a[1]; + QmlBindableValue *t = this; + a[0] = (void *)&t; + d->property.object()->qt_metacall(QMetaObject::WriteProperty, + idx, a); + + } else if (d->property.propertyCategory() == QmlMetaProperty::Object) { + + QVariant value = this->value(); + if ((int)value.type() != qMetaTypeId()) { + if (scriptWarnings()) { + if (!value.isValid()) { + qWarning() << "QmlBindableValue: Unable to assign invalid value to object property"; + } else { + qWarning() << "QmlBindableValue: Unable to assign non-object to object property"; + } } + return; } - return; - } - // NOTE: This assumes a cast to QObject does not alter the - // object pointer - QObject *obj = *(QObject **)value.data(); + // NOTE: This assumes a cast to QObject does not alter the + // object pointer + QObject *obj = *(QObject **)value.data(); + + // NOTE: We assume that only core properties can have + // propertyType == Object + int idx = d->property.coreIndex(); + Q_ASSERT(idx != -1); - // NOTE: We assume that only core properties can have - // propertyType == Object - int idx = d->property.coreIndex(); - Q_ASSERT(idx != -1); + void *a[1]; + a[0] = (void *)&obj; + d->property.object()->qt_metacall(QMetaObject::WriteProperty, + idx, a); - void *a[1]; - a[0] = (void *)&obj; - d->property.object()->qt_metacall(QMetaObject::WriteProperty, - idx, a); + } else if (d->property.propertyCategory() == QmlMetaProperty::Normal) { + QVariant value = this->value(); + d->property.write(value); + } - } else if (d->property.propertyCategory() == QmlMetaProperty::Normal) { - QVariant value = this->value(); - d->property.write(value); + d->updating = false; + } else { + qmlInfo(d->property.object()) << "Binding loop detected for property" << d->property.name(); } } diff --git a/src/declarative/qml/qmlbindablevalue_p.h b/src/declarative/qml/qmlbindablevalue_p.h index 70c001b..d9af0ef 100644 --- a/src/declarative/qml/qmlbindablevalue_p.h +++ b/src/declarative/qml/qmlbindablevalue_p.h @@ -55,6 +55,7 @@ public: QmlBindableValuePrivate(); bool inited; + bool updating; QmlMetaProperty property; QmlBindableValue **mePtr; diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index 0875690..ca840f4 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -7,7 +7,7 @@ class MyQmlObject : public QObject Q_OBJECT Q_PROPERTY(bool trueProperty READ trueProperty) Q_PROPERTY(bool falseProperty READ falseProperty) - Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty) + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged) public: MyQmlObject(): m_methodCalled(false), m_methodIntCalled(false) {} @@ -15,7 +15,13 @@ public: bool falseProperty() const { return false; } QString stringProperty() const { return m_string; } - void setStringProperty(const QString &s) { m_string = s; } + void setStringProperty(const QString &s) + { + if (s == m_string) + return; + m_string = s; + emit stringChanged(); + } bool methodCalled() const { return m_methodCalled; } bool methodIntCalled() const { return m_methodIntCalled; } @@ -24,6 +30,7 @@ public: signals: void basicSignal(); void argumentSignal(int a, QString b, qreal c); + void stringChanged(); public slots: void method() { m_methodCalled = true; } @@ -41,6 +48,22 @@ private: QML_DECLARE_TYPE(MyQmlObject); QML_DEFINE_TYPE(MyQmlObject,MyQmlObject); +class MyQmlContainer : public QObject +{ + Q_OBJECT + Q_PROPERTY(QList* children READ children) +public: + MyQmlContainer() {} + + QList *children() { return &m_children; } + +private: + QList m_children; +}; + +QML_DECLARE_TYPE(MyQmlContainer); +QML_DEFINE_TYPE(MyQmlContainer,MyQmlContainer); + class tst_qmlbindengine : public QObject { Q_OBJECT @@ -51,6 +74,7 @@ private slots: void boolPropertiesEvaluateAsBool(); void methods(); void signalAssignment(); + void bindingLoop(); private: QmlEngine engine; @@ -117,6 +141,17 @@ void tst_qmlbindengine::methods() QCOMPARE(object->methodIntCalled(), true); } } +#include +void tst_qmlbindengine::bindingLoop() +{ + QmlComponent component(&engine, "MyQmlContainer { children : [ "\ + "MyQmlObject { id: Object1; stringProperty: \"hello\" + Object2.stringProperty }, "\ + "MyQmlObject { id: Object2; stringProperty: \"hello\" + Object1.stringProperty } ] }"); + //### ignoreMessage doesn't seem to work here + //QTest::ignoreMessage(QtWarningMsg, "QML MyQmlObject (unknown location): Binding loop detected for property \"stringProperty\""); + QObject *object = component.create(); + QVERIFY(object != 0); +} QTEST_MAIN(tst_qmlbindengine) -- cgit v0.12 From 7e71c79bd6dcc1c8608ebb0570b455372f5f7eaf Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 11 May 2009 13:34:46 +1000 Subject: Fix MouseRegion.enabled All Qt events are accepted by default. Must be specifically ignored. Normally, this is done by calling base class in the "ignore" case. --- src/declarative/canvas/qsimplecanvasitem.cpp | 33 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp index ba33a41..c8c949a 100644 --- a/src/declarative/canvas/qsimplecanvasitem.cpp +++ b/src/declarative/canvas/qsimplecanvasitem.cpp @@ -104,48 +104,58 @@ bool QSimpleCanvasItem::mouseFilter(QGraphicsSceneMouseEvent *) return false; } -void QSimpleCanvasItem::mousePressEvent(QGraphicsSceneMouseEvent *) +void QSimpleCanvasItem::mousePressEvent(QGraphicsSceneMouseEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) +void QSimpleCanvasItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) +void QSimpleCanvasItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::mouseMoveEvent(QGraphicsSceneMouseEvent *) +void QSimpleCanvasItem::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::hoverEnterEvent(QGraphicsSceneHoverEvent *) +void QSimpleCanvasItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) +void QSimpleCanvasItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) { + e->ignore(); } void QSimpleCanvasItem::mouseUngrabEvent() { } -void QSimpleCanvasItem::keyPressEvent(QKeyEvent *) +void QSimpleCanvasItem::keyPressEvent(QKeyEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::keyReleaseEvent(QKeyEvent *) +void QSimpleCanvasItem::keyReleaseEvent(QKeyEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::focusOutEvent(QFocusEvent *) +void QSimpleCanvasItem::focusOutEvent(QFocusEvent *e) { + e->ignore(); } -void QSimpleCanvasItem::focusInEvent(QFocusEvent *) +void QSimpleCanvasItem::focusInEvent(QFocusEvent *e) { + e->ignore(); } void QSimpleCanvasItem::activePanelInEvent() @@ -156,8 +166,9 @@ void QSimpleCanvasItem::activePanelOutEvent() { } -void QSimpleCanvasItem::inputMethodEvent(QInputMethodEvent *) +void QSimpleCanvasItem::inputMethodEvent(QInputMethodEvent *e) { + e->ignore(); } QVariant QSimpleCanvasItem::inputMethodQuery(Qt::InputMethodQuery) const -- cgit v0.12 From 0d8c3504eb13ab45955cb80d7fa8062e2bf1a1a5 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 May 2009 13:34:55 +1000 Subject: Apply a states binding changes even if there is no transition. --- src/declarative/util/qmlstate.cpp | 17 +++++++++++------ src/declarative/util/qmlstate_p.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index cd33f5e..194cc1b 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -247,17 +247,20 @@ static void dump(const QmlStateOperation::ActionList &list) } #endif -void QmlStatePrivate::complete() +void QmlStatePrivate::applyBindings() { - Q_Q(QmlState); - //apply bindings (now that all transitions are complete) - ////////////////////////////////////////////////////////// foreach(const Action &action, bindingsList) { if (action.bv && !action.toBinding.isEmpty()) { action.bv->setExpression(action.toBinding); } } - ////////////////////////////////////////////////////////// +} + +void QmlStatePrivate::complete() +{ + Q_Q(QmlState); + //apply bindings (now that all transitions are complete) + applyBindings(); for (int ii = 0; ii < reverting.count(); ++ii) { for (int jj = 0; jj < revertList.count(); ++jj) { @@ -369,7 +372,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever a.toValue = d->revertList.at(ii).value; a.toBinding = d->revertList.at(ii).binding; if (!a.toBinding.isEmpty()) { - a.fromBinding = d->revertList.at(ii).bv->expression(); //### relies on clearExpression not clearing string + a.fromBinding = d->revertList.at(ii).bv->expression(); a.bv = d->revertList.at(ii).bv; } applyList << a; @@ -456,6 +459,8 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever else action.property.write(action.toValue); } + if (!trans) + d->applyBindings(); //### merge into above foreach? } QML_DEFINE_TYPE(QmlStateOperation,StateOperation); diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h index 20d1c1a..28e1781 100644 --- a/src/declarative/util/qmlstate_p.h +++ b/src/declarative/util/qmlstate_p.h @@ -69,6 +69,7 @@ public: QmlStateGroup *group; QmlStateOperation::ActionList generateActionList(QmlStateGroup *) const; + void applyBindings(); void complete(); }; -- cgit v0.12 From 56010993aaa90f39379f38f51b7975d8a72f56f4 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 May 2009 13:40:48 +1000 Subject: Remove debug. --- src/declarative/fx/qfxtextedit.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 3bc9696..42f5743 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -821,7 +821,6 @@ void QFxTextEditPrivate::updateDefaultTextOption() QTextOption::WrapMode oldWrapMode = opt.wrapMode(); -qDebug() << "wrap mode is" << opt.wrapMode(); if (wrap) opt.setWrapMode(QTextOption::WordWrap); else @@ -829,7 +828,6 @@ qDebug() << "wrap mode is" << opt.wrapMode(); if (oldWrapMode == opt.wrapMode() && oldAlignment == opt.alignment()) return; -qDebug() << "wrap mode set to" << opt.wrapMode(); document->setDefaultTextOption(opt); } -- cgit v0.12 From 554999e97a350b3c04123a6ef03d21a841ab73ad Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 13:58:38 +1000 Subject: Fix crash Component {} would crash the compiler. --- src/declarative/qml/qmlcompiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 5dbc5c3..a40b7c8 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -665,6 +665,9 @@ bool QmlCompiler::compileComponent(Object *obj, int ctxt) if (obj->defaultProperty && obj->defaultProperty->values.count()) root = obj->defaultProperty->values.first()->object; + if (!root) + COMPILE_EXCEPTION("Cannot create empty component specification"); + COMPILE_CHECK(compileComponentFromRoot(root, ctxt)); if (idProp && idProp->values.count()) { -- cgit v0.12 From c0f26c449d0d20915b65af6172ede1dc5659ba01 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 15:15:16 +1000 Subject: Add context property test --- .../qmlbindengine/tst_qmlbindengine.cpp | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index ca840f4..c63caf4 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include class MyQmlObject : public QObject { @@ -75,6 +77,7 @@ private slots: void methods(); void signalAssignment(); void bindingLoop(); + void contextPropertiesTriggerReeval(); private: QmlEngine engine; @@ -141,7 +144,7 @@ void tst_qmlbindengine::methods() QCOMPARE(object->methodIntCalled(), true); } } -#include + void tst_qmlbindengine::bindingLoop() { QmlComponent component(&engine, "MyQmlContainer { children : [ "\ @@ -153,6 +156,31 @@ void tst_qmlbindengine::bindingLoop() QVERIFY(object != 0); } +class MyExpression : public QmlExpression +{ +public: + MyExpression(QmlContext *ctxt, const QString &expr) + : QmlExpression(ctxt, expr, 0), changed(false) + { + } + + bool changed; +}; + +void tst_qmlbindengine::contextPropertiesTriggerReeval() +{ + QmlContext context(engine.rootContext()); + context.setContextProperty("testProp", QVariant(1)); + + MyExpression expr(&context, "testProp + 1"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant(2)); + + context.setContextProperty("testProp", QVariant(2)); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant(3)); +} + QTEST_MAIN(tst_qmlbindengine) #include "tst_qmlbindengine.moc" -- cgit v0.12 From 04599cd17221b269028cab81054525a7f0a0e394 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 11 May 2009 15:30:14 +1000 Subject: Fix webbrowser demo --- demos/declarative/webbrowser/content/RectSoftShadow.qml | 2 +- demos/declarative/webbrowser/content/pics/footer.sci | 6 ++++++ demos/declarative/webbrowser/webbrowser.qml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 demos/declarative/webbrowser/content/pics/footer.sci diff --git a/demos/declarative/webbrowser/content/RectSoftShadow.qml b/demos/declarative/webbrowser/content/RectSoftShadow.qml index 5817f00..1734433 100644 --- a/demos/declarative/webbrowser/content/RectSoftShadow.qml +++ b/demos/declarative/webbrowser/content/RectSoftShadow.qml @@ -24,7 +24,7 @@ Item { source: "pics/softshadow-bottom.png" x: 0 y: parent.height - width: webview.width*webview.scale + width: WebView.width*WebView.scale height: 16 } } diff --git a/demos/declarative/webbrowser/content/pics/footer.sci b/demos/declarative/webbrowser/content/pics/footer.sci new file mode 100644 index 0000000..be1d086 --- /dev/null +++ b/demos/declarative/webbrowser/content/pics/footer.sci @@ -0,0 +1,6 @@ +gridLeft: 5 +gridTop: 0 +gridBottom: 0 +gridRight: 5 +imageFile: footer.png + diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index c754543..4b03b63 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -73,7 +73,7 @@ Item { color: "white" styleColor: "black" - style: Raised + style: "Raised" font.family: "Helvetica" font.size: 10 @@ -85,7 +85,7 @@ Item { anchors.rightMargin: 4 anchors.top: Header.top anchors.topMargin: 4 - hAlign: AlignHCenter + hAlign: "AlignHCenter" } Item { width: parent.width -- cgit v0.12 From 692931ae2fec4fa8fc4ebcbcff20c952d6319536 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 May 2009 15:53:34 +1000 Subject: Add support for removing anchors. This makes it possible to remove an anchor that was previously set. Trying to set a new anchor after one was removed isn't working yet. --- src/declarative/fx/qfxanchors.cpp | 344 ++++++++++++++++--------- src/declarative/fx/qfxanchors.h | 30 ++- src/declarative/fx/qfxanchors_p.h | 4 +- tests/auto/declarative/anchors/tst_anchors.cpp | 2 +- 4 files changed, 238 insertions(+), 142 deletions(-) diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp index f570663..53d0187 100644 --- a/src/declarative/fx/qfxanchors.cpp +++ b/src/declarative/fx/qfxanchors.cpp @@ -43,9 +43,10 @@ #include "qfxitem.h" #include #include - +#include QT_BEGIN_NAMESPACE + QML_DEFINE_TYPE(QFxAnchors,Anchors); //TODO: should we cache relationships, so we don't have to check each time (parent-child or sibling)? @@ -227,7 +228,7 @@ void QFxAnchors::setCenteredIn(QFxItem* c) setVerticalCenter(c->verticalCenter()); } -void QFxAnchorsPrivate::connectVHelper(const QFxAnchorLine &edge, const char *slotString) +void QFxAnchorsPrivate::connectVHelper(const QFxAnchorLine &edge) { //### should we do disconnects first? (will it be called more than once?) Q_Q(QFxAnchors); @@ -235,7 +236,7 @@ void QFxAnchorsPrivate::connectVHelper(const QFxAnchorLine &edge, const char *sl switch(edge.anchorLine) { case QFxAnchorLine::Bottom: case QFxAnchorLine::VCenter: - QObject::connect(edge.item, SIGNAL(heightChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(heightChanged()), q, SLOT(updateVerticalAnchors())); break; case QFxAnchorLine::Top: //no connection needed default: @@ -244,13 +245,13 @@ void QFxAnchorsPrivate::connectVHelper(const QFxAnchorLine &edge, const char *sl } else if (edge.item->itemParent() == item->itemParent()) { //siblings switch(edge.anchorLine) { case QFxAnchorLine::Top: - QObject::connect(edge.item, SIGNAL(topChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(topChanged()), q, SLOT(updateVerticalAnchors())); break; case QFxAnchorLine::Bottom: - QObject::connect(edge.item, SIGNAL(bottomChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(bottomChanged()), q, SLOT(updateVerticalAnchors())); break; case QFxAnchorLine::VCenter: - QObject::connect(edge.item, SIGNAL(vcenterChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(vcenterChanged()), q, SLOT(updateVerticalAnchors())); break; default: break; @@ -267,49 +268,44 @@ void QFxAnchors::connectVAnchors() return; if (d->usedAnchors & HasTopAnchor) { - const char *slotStr = SLOT(updateTopAnchor()); - //Handle stretching connections (if we have multiple horizontal anchors) QFxAnchorLine *edge = 0; if (d->usedAnchors & HasBottomAnchor) { edge = &d->bottom; - connect(this, SIGNAL(bottomMarginChanged()), this, slotStr); + connect(this, SIGNAL(bottomMarginChanged()), this, SLOT(updateVerticalAnchors())); } else if (d->usedAnchors & HasVCenterAnchor) { edge = &d->vCenter; - connect(this, SIGNAL(verticalCenterOffsetChanged()), this, slotStr); + connect(this, SIGNAL(verticalCenterOffsetChanged()), this, SLOT(updateVerticalAnchors())); } if (edge) { //we need to stretch - d->connectVHelper(*edge, slotStr); + d->connectVHelper(*edge); } //Handle top - d->connectVHelper(d->top, slotStr); - connect(this, SIGNAL(topMarginChanged()), this, slotStr); - updateTopAnchor(); + d->connectVHelper(d->top); + connect(this, SIGNAL(topMarginChanged()), this, SLOT(updateVerticalAnchors())); + updateVerticalAnchors(); } else if (d->usedAnchors & HasBottomAnchor) { - const char *slotStr = SLOT(updateBottomAnchor()); - //Handle stretching connections (if we have multiple horizontal anchors) if (d->usedAnchors & HasVCenterAnchor) { - d->connectVHelper(d->vCenter, slotStr); - connect(this, SIGNAL(verticalCenterOffsetChanged()), this, slotStr); + d->connectVHelper(d->vCenter); + connect(this, SIGNAL(verticalCenterOffsetChanged()), this, SLOT(updateVerticalAnchors())); } //Handle bottom - d->connectVHelper(d->bottom, slotStr); - connect(this, SIGNAL(bottomMarginChanged()), this, slotStr); - updateBottomAnchor(); + d->connectVHelper(d->bottom); + connect(this, SIGNAL(bottomMarginChanged()), this, SLOT(updateVerticalAnchors())); + updateVerticalAnchors(); } else if (d->usedAnchors & HasVCenterAnchor) { //Handle vCenter - const char *slotStr = SLOT(updateVCenterAnchor()); - d->connectVHelper(d->vCenter, slotStr); - connect(this, SIGNAL(verticalCenterOffsetChanged()), this, slotStr); - updateVCenterAnchor(); + d->connectVHelper(d->vCenter); + connect(this, SIGNAL(verticalCenterOffsetChanged()), this, SLOT(updateVerticalAnchors())); + updateVerticalAnchors(); } } -void QFxAnchorsPrivate::connectHHelper(const QFxAnchorLine &edge, const char *slotString) +void QFxAnchorsPrivate::connectHHelper(const QFxAnchorLine &edge) { //### should we do disconnects first? (will it be called more than once?) Q_Q(QFxAnchors); @@ -317,7 +313,7 @@ void QFxAnchorsPrivate::connectHHelper(const QFxAnchorLine &edge, const char *sl switch(edge.anchorLine) { case QFxAnchorLine::Right: case QFxAnchorLine::HCenter: - QObject::connect(edge.item, SIGNAL(widthChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(widthChanged()), q, SLOT(updateHorizontalAnchors())); break; case QFxAnchorLine::Left: //no connection needed default: @@ -326,13 +322,13 @@ void QFxAnchorsPrivate::connectHHelper(const QFxAnchorLine &edge, const char *sl } else if (edge.item->itemParent() == item->itemParent()) { //siblings switch(edge.anchorLine) { case QFxAnchorLine::Left: - QObject::connect(edge.item, SIGNAL(leftChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(leftChanged()), q, SLOT(updateHorizontalAnchors())); break; case QFxAnchorLine::Right: - QObject::connect(edge.item, SIGNAL(rightChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(rightChanged()), q, SLOT(updateHorizontalAnchors())); break; case QFxAnchorLine::HCenter: - QObject::connect(edge.item, SIGNAL(hcenterChanged()), q, slotString); + QObject::connect(edge.item, SIGNAL(hcenterChanged()), q, SLOT(updateHorizontalAnchors())); break; default: break; @@ -349,45 +345,40 @@ void QFxAnchors::connectHAnchors() return; if (d->usedAnchors & HasLeftAnchor) { - const char *slotStr = SLOT(updateLeftAnchor()); - //Handle stretching connections (if we have multiple horizontal anchors) QFxAnchorLine *edge = 0; if (d->usedAnchors & HasRightAnchor) { edge = &d->right; - connect(this, SIGNAL(rightMarginChanged()), this, slotStr); + connect(this, SIGNAL(rightMarginChanged()), this, SLOT(updateHorizontalAnchors())); } else if (d->usedAnchors & HasHCenterAnchor) { edge = &d->hCenter; - connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, slotStr); + connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, SLOT(updateHorizontalAnchors())); } if (edge) { //we need to stretch - d->connectHHelper(*edge, slotStr); + d->connectHHelper(*edge); } //Handle left - d->connectHHelper(d->left, slotStr); - connect(this, SIGNAL(leftMarginChanged()), this, slotStr); - updateLeftAnchor(); + d->connectHHelper(d->left); + connect(this, SIGNAL(leftMarginChanged()), this, SLOT(updateHorizontalAnchors())); + updateHorizontalAnchors(); } else if (d->usedAnchors & HasRightAnchor) { - const char *slotStr = SLOT(updateRightAnchor()); - //Handle stretching connections (if we have multiple horizontal anchors) if (d->usedAnchors & HasHCenterAnchor) { - d->connectHHelper(d->hCenter, slotStr); - connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, slotStr); + d->connectHHelper(d->hCenter); + connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, SLOT(updateHorizontalAnchors())); } //Handle right - d->connectHHelper(d->right, slotStr); - connect(this, SIGNAL(rightMarginChanged()), this, slotStr); - updateRightAnchor(); + d->connectHHelper(d->right); + connect(this, SIGNAL(rightMarginChanged()), this, SLOT(updateHorizontalAnchors())); + updateHorizontalAnchors(); } else if (d->usedAnchors & HasHCenterAnchor) { //Handle hCenter - const char *slotStr = SLOT(updateHCenterAnchor()); - d->connectHHelper(d->hCenter, slotStr); - connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, slotStr); - updateHCenterAnchor(); + d->connectHHelper(d->hCenter); + connect(this, SIGNAL(horizontalCenterOffsetChanged()), this, SLOT(updateHorizontalAnchors())); + updateHorizontalAnchors(); } } @@ -420,13 +411,12 @@ bool QFxAnchorsPrivate::calcStretch(const QFxAnchorLine &edge1, return invalid; } -void QFxAnchors::updateTopAnchor() +void QFxAnchors::updateVerticalAnchors() { Q_D(QFxAnchors); - if (d->usedAnchors & HasTopAnchor) { - if (!d->updatingVerticalAnchor) { - d->updatingVerticalAnchor = true; - + if (!d->updatingVerticalAnchor) { + d->updatingVerticalAnchor = true; + if (d->usedAnchors & HasTopAnchor) { //Handle stretching bool invalid = true; int height = 0; @@ -445,22 +435,8 @@ void QFxAnchors::updateTopAnchor() } else if (d->top.item->itemParent() == d->item->itemParent()) { d->item->setY(position(d->top.item, d->top.anchorLine) + d->topMargin); } - - d->updatingVerticalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; - } - } -} - -void QFxAnchors::updateBottomAnchor() -{ - Q_D(QFxAnchors); - if (d->usedAnchors & HasBottomAnchor) { - if (!d->updatingVerticalAnchor) { - d->updatingVerticalAnchor = true; - - //Handle stretching (top + bottom case is handled in updateLeftAnchor) + } else if (d->usedAnchors & HasBottomAnchor) { + //Handle stretching (top + bottom case is handled above) if (d->usedAnchors & HasVCenterAnchor) { int height = 0; bool invalid = d->calcStretch(d->vCenter, d->bottom, d->vCenterOffset, -d->bottomMargin, @@ -476,21 +452,9 @@ void QFxAnchors::updateBottomAnchor() d->item->setY(position(d->bottom.item, d->bottom.anchorLine) - d->item->height() - d->bottomMargin); } - d->updatingVerticalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; - } - } -} -void QFxAnchors::updateVCenterAnchor() -{ - Q_D(QFxAnchors); - if (d->usedAnchors & HasVCenterAnchor) { - if (!d->updatingVerticalAnchor) { - d->updatingVerticalAnchor = true; - - //(stetching handled in other update functions) + } else if (d->usedAnchors & HasVCenterAnchor) { + //(stetching handled above) //Handle vCenter if (d->vCenter.item == d->item->itemParent()) { @@ -499,21 +463,70 @@ void QFxAnchors::updateVCenterAnchor() } else if (d->vCenter.item->itemParent() == d->item->itemParent()) { d->item->setY(position(d->vCenter.item, d->vCenter.anchorLine) - d->item->height()/2 + d->vCenterOffset); } - - d->updatingVerticalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; } + d->updatingVerticalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on vertical anchor."; } } -void QFxAnchors::updateLeftAnchor() +void QFxAnchors::updateHorizontalAnchors() { Q_D(QFxAnchors); - if (d->usedAnchors & HasLeftAnchor) { - if (!d->updatingHorizontalAnchor) { - d->updatingHorizontalAnchor = true; + if (!d->updatingHorizontalAnchor) { + d->updatingHorizontalAnchor = true; + //alternate implementation (needs performance testing) + /*switch(d->usedAnchors & QFxAnchors::Horizontal_Mask) { + case 0x03: //(HasLeftAnchor | HasRightAnchor) + { + int width = 0; + if (!d->calcStretch(d->left, d->right, d->leftMargin, -d->rightMargin, QFxAnchorLine::Left, width)) + d->item->setWidth(width); + //fall though + } + case 0x11: //(HasLeftAnchor | HasHCenterAnchor) + { + if (d->usedAnchors & HasHCenterAnchor) { + int width = 0; + if (!d->calcStretch(d->left, d->hCenter, d->leftMargin, d->hCenterOffset, QFxAnchorLine::Left, width)) + d->item->setWidth(width*2); + } + //fall though + } + case HasLeftAnchor: + if (d->left.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->left.item, d->left.anchorLine) + d->leftMargin); + } else if (d->left.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->left.item, d->left.anchorLine) + d->leftMargin); + } + break; + case 0x12: //(HasRightAnchor | HasHCenterAnchor) + { + int width = 0; + if (!d->calcStretch(d->hCenter, d->right, d->hCenterOffset, -d->rightMargin, QFxAnchorLine::Left, width)) + d->item->setWidth(width*2); + //fall though + } + case HasRightAnchor: + if (d->right.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); + } else if (d->right.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); + } + break; + case HasHCenterAnchor: + if (d->hCenter.item == d->item->itemParent()) { + d->item->setX(adjustedPosition(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); + } else if (d->hCenter.item->itemParent() == d->item->itemParent()) { + d->item->setX(position(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); + } + break; + default: + break; + }*/ + + if (d->usedAnchors & HasLeftAnchor) { //Handle stretching bool invalid = true; int width = 0; @@ -532,21 +545,7 @@ void QFxAnchors::updateLeftAnchor() } else if (d->left.item->itemParent() == d->item->itemParent()) { d->item->setX(position(d->left.item, d->left.anchorLine) + d->leftMargin); } - - d->updatingHorizontalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; - } - } -} - -void QFxAnchors::updateRightAnchor() -{ - Q_D(QFxAnchors); - if (d->usedAnchors & HasRightAnchor) { - if (!d->updatingHorizontalAnchor) { - d->updatingHorizontalAnchor = true; - + } else if (d->usedAnchors & HasRightAnchor) { //Handle stretching (left + right case is handled in updateLeftAnchor) if (d->usedAnchors & HasHCenterAnchor) { int width = 0; @@ -562,32 +561,18 @@ void QFxAnchors::updateRightAnchor() } else if (d->right.item->itemParent() == d->item->itemParent()) { d->item->setX(position(d->right.item, d->right.anchorLine) - d->item->width() - d->rightMargin); } - - d->updatingHorizontalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; - } - } -} - -void QFxAnchors::updateHCenterAnchor() -{ - Q_D(QFxAnchors); - if (d->usedAnchors & HasHCenterAnchor) { - if (!d->updatingHorizontalAnchor) { - d->updatingHorizontalAnchor = true; - + } else if (d->usedAnchors & HasHCenterAnchor) { //Handle hCenter if (d->hCenter.item == d->item->itemParent()) { d->item->setX(adjustedPosition(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); } else if (d->hCenter.item->itemParent() == d->item->itemParent()) { d->item->setX(position(d->hCenter.item, d->hCenter.anchorLine) - d->item->width()/2 + d->hCenterOffset); } - - d->updatingHorizontalAnchor = false; - } else { - qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; } + + d->updatingHorizontalAnchor = false; + } else { + qmlInfo(d->item) << "Anchor loop detected on horizontal anchor."; } } @@ -610,6 +595,24 @@ void QFxAnchors::setTop(const QFxAnchorLine &edge) d->top = edge; } +void QFxAnchors::resetTop() +{ + Q_D(QFxAnchors); + + //update flags + d->usedAnchors &= ~HasTopAnchor; + + //clear binding + QmlMetaProperty prop(this, "top"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(topMarginChanged()), this, SLOT(updateVerticalAnchors())); + disconnect(d->top.item, 0, this, 0); + + updateVerticalAnchors(); +} + QFxAnchorLine QFxAnchors::bottom() const { Q_D(const QFxAnchors); @@ -627,7 +630,24 @@ void QFxAnchors::setBottom(const QFxAnchorLine &edge) d->checkVValid(); d->bottom = edge; +} + +void QFxAnchors::resetBottom() +{ + Q_D(QFxAnchors); + + //update flags + d->usedAnchors &= ~HasBottomAnchor; + + //clear binding + QmlMetaProperty prop(this, "bottom"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(bottomMarginChanged()), this, SLOT(updateVerticalAnchors())); + disconnect(d->bottom.item, 0, this, 0); + updateVerticalAnchors(); } QFxAnchorLine QFxAnchors::verticalCenter() const @@ -649,6 +669,24 @@ void QFxAnchors::setVerticalCenter(const QFxAnchorLine &edge) d->vCenter = edge; } +void QFxAnchors::resetVerticalCenter() +{ + Q_D(QFxAnchors); + + //update flags + d->usedAnchors &= ~HasVCenterAnchor; + + //clear binding + QmlMetaProperty prop(this, "verticalCenter"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(verticalCenterOffsetChanged()), this, SLOT(updateVerticalAnchors())); + disconnect(d->vCenter.item, 0, this, 0); + + updateVerticalAnchors(); +} + QFxAnchorLine QFxAnchors::left() const { Q_D(const QFxAnchors); @@ -668,6 +706,24 @@ void QFxAnchors::setLeft(const QFxAnchorLine &edge) d->left = edge; } +void QFxAnchors::resetLeft() +{ + Q_D(QFxAnchors); + + //update flags + d->usedAnchors &= ~HasLeftAnchor; + + //clear binding + QmlMetaProperty prop(this, "left"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(leftMarginChanged()), this, SLOT(updateHorizontalAnchors())); + disconnect(d->left.item, 0, this, 0); + + updateHorizontalAnchors(); +} + QFxAnchorLine QFxAnchors::right() const { Q_D(const QFxAnchors); @@ -685,7 +741,24 @@ void QFxAnchors::setRight(const QFxAnchorLine &edge) d->checkHValid(); d->right = edge; +} + +void QFxAnchors::resetRight() +{ + Q_D(QFxAnchors); + //update flags + d->usedAnchors &= ~HasRightAnchor; + + //clear binding + QmlMetaProperty prop(this, "right"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(rightMarginChanged()), this, SLOT(updateHorizontalAnchors())); + disconnect(d->right.item, 0, this, 0); + + updateHorizontalAnchors(); } QFxAnchorLine QFxAnchors::horizontalCenter() const @@ -707,6 +780,24 @@ void QFxAnchors::setHorizontalCenter(const QFxAnchorLine &edge) d->hCenter = edge; } +void QFxAnchors::resetHorizontalCenter() +{ + Q_D(QFxAnchors); + + //update flags + d->usedAnchors &= ~HasHCenterAnchor; + + //clear binding + QmlMetaProperty prop(this, "horizontalCenter"); + prop.binding()->clearExpression(); + + //disconnect signal/slot connections as needed + disconnect(this, SIGNAL(horizontalCenterOffsetChanged()), this, SLOT(updateHorizontalAnchors())); + disconnect(d->hCenter.item, 0, this, 0); + + updateHorizontalAnchors(); +} + int QFxAnchors::leftMargin() const { Q_D(const QFxAnchors); @@ -902,4 +993,5 @@ bool QFxAnchorsPrivate::checkVAnchorValid(QFxAnchorLine anchor) const return true; } + QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxanchors.h b/src/declarative/fx/qfxanchors.h index 3a250b9..5a8cc1a 100644 --- a/src/declarative/fx/qfxanchors.h +++ b/src/declarative/fx/qfxanchors.h @@ -84,12 +84,12 @@ class Q_DECLARATIVE_EXPORT QFxAnchors : public QObject { Q_OBJECT - Q_PROPERTY(QFxAnchorLine left READ left WRITE setLeft); - Q_PROPERTY(QFxAnchorLine right READ right WRITE setRight); - Q_PROPERTY(QFxAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter); - Q_PROPERTY(QFxAnchorLine top READ top WRITE setTop); - Q_PROPERTY(QFxAnchorLine bottom READ bottom WRITE setBottom); - Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter); + Q_PROPERTY(QFxAnchorLine left READ left WRITE setLeft RESET resetLeft); + Q_PROPERTY(QFxAnchorLine right READ right WRITE setRight RESET resetRight); + Q_PROPERTY(QFxAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter); + Q_PROPERTY(QFxAnchorLine top READ top WRITE setTop RESET resetTop); + Q_PROPERTY(QFxAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom); + Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter); Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged); Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged); Q_PROPERTY(int horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()); @@ -109,27 +109,35 @@ public: HasBottomAnchor = 0x08, HasHCenterAnchor = 0x10, HasVCenterAnchor = 0x20, - HasBaselineAnchor = 0x40 + HasBaselineAnchor = 0x40, + Horizontal_Mask = HasLeftAnchor | HasRightAnchor | HasHCenterAnchor, + Vertical_Mask = HasTopAnchor | HasBottomAnchor | HasVCenterAnchor | HasBaselineAnchor }; Q_DECLARE_FLAGS(UsedAnchors, UsedAnchor); QFxAnchorLine left() const; void setLeft(const QFxAnchorLine &edge); + Q_INVOKABLE void resetLeft(); //### temporarily invokable for testing QFxAnchorLine right() const; void setRight(const QFxAnchorLine &edge); + void resetRight(); QFxAnchorLine horizontalCenter() const; void setHorizontalCenter(const QFxAnchorLine &edge); + void resetHorizontalCenter(); QFxAnchorLine top() const; void setTop(const QFxAnchorLine &edge); + void resetTop(); QFxAnchorLine bottom() const; void setBottom(const QFxAnchorLine &edge); + void resetBottom(); QFxAnchorLine verticalCenter() const; void setVerticalCenter(const QFxAnchorLine &edge); + void resetVerticalCenter(); int leftMargin() const; void setLeftMargin(int); @@ -172,12 +180,8 @@ Q_SIGNALS: private Q_SLOTS: void fillChanged(); - void updateLeftAnchor(); - void updateRightAnchor(); - void updateHCenterAnchor(); - void updateTopAnchor(); - void updateBottomAnchor(); - void updateVCenterAnchor(); + void updateHorizontalAnchors(); + void updateVerticalAnchors(); private: //### should item be a friend? (and make some of the public methods private or protected) diff --git a/src/declarative/fx/qfxanchors_p.h b/src/declarative/fx/qfxanchors_p.h index 76f83a8..82c2086 100644 --- a/src/declarative/fx/qfxanchors_p.h +++ b/src/declarative/fx/qfxanchors_p.h @@ -77,8 +77,8 @@ public: bool checkVValid() const; bool checkHAnchorValid(QFxAnchorLine anchor) const; bool checkVAnchorValid(QFxAnchorLine anchor) const; - void connectHHelper(const QFxAnchorLine &anchorLine, const char *slotString); - void connectVHelper(const QFxAnchorLine &anchorLine, const char *slotString); + void connectHHelper(const QFxAnchorLine &anchorLine); + void connectVHelper(const QFxAnchorLine &anchorLine); bool calcStretch(const QFxAnchorLine &edge1, const QFxAnchorLine &edge2, int offset1, int offset2, QFxAnchorLine::AnchorLine line, int &stretch); QFxItem *item; diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 7d920af..683a7b9 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -37,7 +37,7 @@ void tst_anchors::loops() view->setUrl(QUrl("file://" SRCDIR "/data/loop2.qml")); - //### ignoreMessage doesn't seem to work + //### ignoreMessage doesn't seem to work here //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor."); //QTest::ignoreMessage(QtWarningMsg, "QML QFxImage (unknown location): Anchor loop detected on horizontal anchor."); view->execute(); -- cgit v0.12 From 7f22443b3cb6cd56a906dbb6edb0c2f7a1314887 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 11 May 2009 15:56:42 +1000 Subject: Fix double-click AND flicking. Re-do of dae02071a9e985b3ea847f08af6849ff2daad3c3 --- src/declarative/canvas/qsimplecanvas_graphicsview.cpp | 1 + src/gui/graphicsview/qgraphicsscene.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp index 5c6f2f5..dd4012b 100644 --- a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp +++ b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp @@ -110,6 +110,7 @@ void QSimpleGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) p = p->parent(); } owner->mouseReleaseEvent(event); + ungrabMouse(); } void QSimpleGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 69e08d1..bc5c091 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1329,7 +1329,9 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // check if the item we are sending to are disabled (before we send the event) bool disabled = !item->isEnabled(); bool isWindow = item->isWindow(); - if (mouseEvent->type() == QEvent::GraphicsSceneMouseDoubleClick && item != lastMouseGrabberItem) { + if (mouseEvent->type() == QEvent::GraphicsSceneMouseDoubleClick + && item != lastMouseGrabberItem && lastMouseGrabberItem) + { // If this item is different from the item that received the last // mouse event, and mouseEvent is a doubleclick event, then the // event is converted to a press. Known limitation: -- cgit v0.12 From 3f85913faf5694e4a0ebd612921e4eeeb4fc9e25 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 15:15:16 +1000 Subject: Reevaluate expressions when context properties change --- src/declarative/qml/qmlcontext.cpp | 64 +++++++++++++--- src/declarative/qml/qmlcontext_p.h | 6 +- src/declarative/qml/qmlengine.cpp | 89 +++++++++++++--------- src/declarative/qml/qmlengine_p.h | 13 +++- src/declarative/qml/script/qmlbasicscript.cpp | 19 +---- src/declarative/qml/script/qmlbasicscript_p.h | 8 +- .../qmlbindengine/tst_qmlbindengine.cpp | 72 ++++++++++++++++- 7 files changed, 200 insertions(+), 71 deletions(-) diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index df5f90e..91bf1c0 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -53,7 +54,8 @@ QT_BEGIN_NAMESPACE QmlContextPrivate::QmlContextPrivate() - : parent(0), engine(0), highPriorityCount(0), startLine(-1), endLine(-1) +: parent(0), engine(0), notifyIndex(-1), highPriorityCount(0), + startLine(-1), endLine(-1) { } @@ -65,21 +67,26 @@ void QmlContextPrivate::dump() void QmlContextPrivate::dump(int depth) { QByteArray ba(depth * 4, ' '); - qWarning() << ba << properties.keys(); - qWarning() << ba << variantProperties.keys(); if (parent) parent->d_func()->dump(depth + 1); } void QmlContextPrivate::destroyed(QObject *obj) { + Q_Q(QmlContext); + defaultObjects.removeAll(obj); - for (QHash::Iterator iter = properties.begin(); - iter != properties.end(); ) { - if (*iter == obj) - iter = properties.erase(iter); - else - ++iter; + + QVariant variantObject = QVariant::fromValue(obj); + QVarLengthArray notifies; + for (int ii = 0; ii < propertyValues.count(); ++ii) { + if (propertyValues.at(ii) == variantObject) { + propertyValues[ii] = QVariant(); + notifies.append(ii); + } + } + for (int ii = 0; ii < notifies.count(); ++ii) { + QMetaObject::activate(q, notifies[ii] + notifyIndex, 0); } } @@ -314,7 +321,22 @@ void QmlContext::addDefaultObject(QObject *object) void QmlContext::setContextProperty(const QString &name, const QVariant &value) { Q_D(QmlContext); - d->variantProperties.insert(name, value); + if (d->notifyIndex == -1) + d->notifyIndex = this->metaObject()->methodCount(); + + if (QmlMetaType::isObject(value.userType())) { + QObject *o = QmlMetaType::toQObject(value); + setContextProperty(name, o); + } else { + QHash::ConstIterator iter = d->propertyNames.find(name); + if(iter == d->propertyNames.end()) { + d->propertyNames.insert(name, d->propertyValues.count()); + d->propertyValues.append(value); + } else { + d->propertyValues[*iter] = value; + QMetaObject::activate(this, *iter + d->notifyIndex, 0); + } + } } /*! @@ -325,8 +347,26 @@ void QmlContext::setContextProperty(const QString &name, const QVariant &value) void QmlContext::setContextProperty(const QString &name, QObject *value) { Q_D(QmlContext); - d->properties.insert(name, value); - QObject::connect(value, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*))); + if (d->notifyIndex == -1) + d->notifyIndex = this->metaObject()->methodCount(); + + QObject::connect(value, SIGNAL(destroyed(QObject*)), + this, SLOT(objectDestroyed(QObject*))); + + QHash::ConstIterator iter = d->propertyNames.find(name); + if(iter == d->propertyNames.end()) { + d->propertyNames.insert(name, d->propertyValues.count()); + d->propertyValues.append(QVariant::fromValue(value)); + } else { + int idx = *iter; + if (QmlMetaType::isObject(d->propertyValues.at(idx).userType())) { + QObject *old = QmlMetaType::toQObject(d->propertyValues.at(idx)); + QObject::disconnect(old, SIGNAL(destroyed(QObject*)), + this, SLOT(objectDestroyed(QObject*))); + } + d->propertyValues[*iter] = QVariant::fromValue(value); + QMetaObject::activate(this, *iter + d->notifyIndex, 0); + } } /*! diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index f527bb8..6f1e486 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -64,8 +64,10 @@ public: QmlContext *parent; QmlEngine *engine; - QHash properties; - QHash variantProperties; + + QHash propertyNames; + QList propertyValues; + int notifyIndex; QObjectList defaultObjects; int highPriorityCount; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c39a0d5..fb4cedf 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -211,6 +211,30 @@ QmlContext *QmlEnginePrivate::setCurrentBindContext(QmlContext *c) return old; } +QmlEnginePrivate::CapturedProperty::CapturedProperty(QObject *obj, int n) +: object(obj), notifyIndex(n) +{ +} + +QmlEnginePrivate::CapturedProperty::CapturedProperty(const QmlMetaProperty &p) +: object(p.object()), name(p.name()), notifyIndex(p.property().notifySignalIndex()) +{ +} + +QmlEnginePrivate::CapturedProperty::CapturedProperty(const CapturedProperty &o) +: object(o.object), name(o.name), notifyIndex(o.notifyIndex) +{ +} + +QmlEnginePrivate::CapturedProperty & +QmlEnginePrivate::CapturedProperty::operator=(const CapturedProperty &o) +{ + object = o.object; + name = o.name; + notifyIndex = o.notifyIndex; + return *this; +} + //////////////////////////////////////////////////////////////////// typedef QHash, bool> FunctionCache; Q_GLOBAL_STATIC(FunctionCache, functionCache); @@ -268,7 +292,8 @@ QScriptValue QmlEnginePrivate::propertyObject(const QScriptString &propName, return scriptEngine.newVariant(qVariantFromValue(prop)); } else { QVariant var = prop.read(); - capturedProperties << prop; + if (prop.needsChangedNotifier()) + capturedProperties << CapturedProperty(prop); QObject *varobj = QmlMetaType::toQObject(var); if (!varobj) varobj = qvariant_cast(var); @@ -318,7 +343,8 @@ bool QmlEnginePrivate::fetchCache(QmlBasicScriptNodeCache &cache, const QString if (!prop.isValid()) return false; - capturedProperties << prop; + if (prop.needsChangedNotifier()) + capturedProperties << CapturedProperty(prop); if (prop.type() & QmlMetaProperty::Attached) { @@ -357,16 +383,15 @@ bool QmlEnginePrivate::fetchCache(QmlBasicScriptNodeCache &cache, const QString bool QmlEnginePrivate::loadCache(QmlBasicScriptNodeCache &cache, const QString &propName, QmlContextPrivate *context) { while(context) { - if (context->variantProperties.contains(propName)) { + + QHash::ConstIterator iter = + context->propertyNames.find(propName); + if (iter != context->propertyNames.end()) { cache.object = 0; cache.type = QmlBasicScriptNodeCache::Variant; cache.context = context; - return true; - } - - if (context->properties.contains(propName)) { - cache.object = context->properties[propName]; - cache.type = QmlBasicScriptNodeCache::Explicit; + cache.contextIndex = *iter; + capturedProperties << CapturedProperty(context->q_ptr, *iter + context->notifyIndex); return true; } @@ -1045,13 +1070,14 @@ QVariant QmlExpression::value() log.setResult(rv); for (int ii = 0; ii < ep->capturedProperties.count(); ++ii) { - const QmlMetaProperty &prop = + const QmlEnginePrivate::CapturedProperty &prop = ep->capturedProperties.at(ii); - if (prop.hasChangedNotifier()) { - prop.connectNotifier(d->proxy, changedIndex); - } else if (prop.needsChangedNotifier()) { - QString warn = QLatin1String("Expression depends on property without a NOTIFY signal: [") + QLatin1String(prop.object()->metaObject()->className()) + QLatin1String("].") + prop.name(); + if (prop.notifyIndex != -1) { + QMetaObject::connect(prop.object, prop.notifyIndex, + 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); } } @@ -1059,11 +1085,12 @@ QVariant QmlExpression::value() } else { for (int ii = 0; ii < ep->capturedProperties.count(); ++ii) { - const QmlMetaProperty &prop = + const QmlEnginePrivate::CapturedProperty &prop = ep->capturedProperties.at(ii); - if (prop.hasChangedNotifier()) - prop.connectNotifier(d->proxy, changedIndex); + if (prop.notifyIndex != -1) + QMetaObject::connect(prop.object, prop.notifyIndex, + d->proxy, changedIndex); } } } else { @@ -1254,13 +1281,10 @@ QmlContextScriptClass::queryProperty(const QScriptValue &object, #endif *id = InvalidId; - if (bindContext->d_func()->variantProperties.contains(propName)) { + if (bindContext->d_func()->propertyNames.contains(propName)) { rv |= HandlesReadAccess; *id = VariantPropertyId; - } else if (bindContext->d_func()->properties.contains(propName)) { - rv |= HandlesReadAccess; - *id = ObjectListPropertyId; - } + } for (int ii = 0; !rv && ii < bindContext->d_func()->defaultObjects.count(); ++ii) { rv = engine->d_func()->queryObject(propName, id, @@ -1295,22 +1319,19 @@ QScriptValue QmlContextScriptClass::property(const QScriptValue &object, case VariantPropertyId: { QString propName = name.toString(); - QScriptValue rv = scriptEngine->newVariant(bindContext->d_func()->variantProperties[propName]); + int index = bindContext->d_func()->propertyNames.value(propName); + QVariant value = bindContext->d_func()->propertyValues.at(index); #ifdef PROPERTY_DEBUG qWarning() << "Context Property: Resolved property" << propName << "to context variant property list" << bindContext <<". Value:" << rv.toVariant(); #endif - return rv; - } - case ObjectListPropertyId: - { - QString propName = name.toString(); - QObject *o = bindContext->d_func()->properties[propName]; - QScriptValue rv = scriptEngine->newObject(engine->d_func()->objectClass, scriptEngine->newVariant(QVariant::fromValue(o))); -#ifdef PROPERTY_DEBUG - qWarning() << "Context Property: Resolved property" << propName - << "to context object property list" << bindContext <<". Value:" << rv.toVariant(); -#endif + QScriptValue rv; + if (QmlMetaType::isObject(value.userType())) { + rv = scriptEngine->newObject(engine->d_func()->objectClass, scriptEngine->newVariant(value)); + } else { + rv = scriptEngine->newVariant(value); + } + engine->d_func()->capturedProperties << QmlEnginePrivate::CapturedProperty(bindContext, index + bindContext->d_func()->notifyIndex); return rv; } default: diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 9402fa9..7578fdf 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -89,7 +89,17 @@ public: QScriptClass::QueryFlags queryObject(const QString &name, uint *id, QObject *); QScriptValue propertyObject(const QScriptString &propName, QObject *, uint id = 0); - QList capturedProperties; + struct CapturedProperty { + CapturedProperty(QObject *, int); + CapturedProperty(const QmlMetaProperty &); + CapturedProperty(const CapturedProperty &); + CapturedProperty &operator=(const CapturedProperty &); + + QObject *object; + QString name; + int notifyIndex; + }; + QList capturedProperties; QmlContext *rootContext; QmlContext *currentBindContext; @@ -172,7 +182,6 @@ public: { InvalidId = -1, - ObjectListPropertyId = 0xC0000000, FunctionId = 0x80000000, VariantPropertyId = 0x40000000, PropertyId = 0x00000000, diff --git a/src/declarative/qml/script/qmlbasicscript.cpp b/src/declarative/qml/script/qmlbasicscript.cpp index 129db7e..e0a668a 100644 --- a/src/declarative/qml/script/qmlbasicscript.cpp +++ b/src/declarative/qml/script/qmlbasicscript.cpp @@ -72,15 +72,9 @@ QDebug operator<<(QDebug lhs, const QmlBasicScriptNodeCache &rhs) case QmlBasicScriptNodeCache::SignalProperty: lhs << "SignalProperty" << rhs.object << rhs.core; break; - case QmlBasicScriptNodeCache::Explicit: - lhs << "Explicit" << rhs.object; - break; case QmlBasicScriptNodeCache::Variant: lhs << "Variant" << rhs.context; break; - case QmlBasicScriptNodeCache::ScriptValue: - lhs << "ScriptValue" << rhs.context; - break; } return lhs; @@ -210,15 +204,8 @@ QVariant QmlBasicScriptNodeCache::value(const char *name) const break; case SignalProperty: break; - case Explicit: - return qVariantFromValue(object); - break; case Variant: - return toObjectOrVariant(context->variantProperties[QLatin1String(name)]); - break; - case ScriptValue: - return qVariantFromValue(context->properties[QLatin1String(name)]); - break; + return context->propertyValues[contextIndex]; }; return QVariant(); } @@ -705,7 +692,7 @@ void QmlBasicScript::clearCache(void *voidCache) reinterpret_cast(voidCache); for (int ii = 0; ii < d->stateSize; ++ii) { - if (!dataCache[ii].isCore() && !dataCache[ii].isExplicit() && + if (!dataCache[ii].isCore() && !dataCache[ii].isVariant() && dataCache[ii].object) { QMetaObject::removeGuard(&dataCache[ii].object); dataCache[ii].object = 0; @@ -717,7 +704,7 @@ void QmlBasicScript::clearCache(void *voidCache) void QmlBasicScript::guard(QmlBasicScriptNodeCache &n) { if (n.object) { - if (n.isExplicit()) { + if (n.isVariant()) { } else if (n.isCore()) { n.metaObject = n.object->metaObject(); diff --git a/src/declarative/qml/script/qmlbasicscript_p.h b/src/declarative/qml/script/qmlbasicscript_p.h index fb9951e..3b7e966 100644 --- a/src/declarative/qml/script/qmlbasicscript_p.h +++ b/src/declarative/qml/script/qmlbasicscript_p.h @@ -29,19 +29,19 @@ public: Attached, Signal, SignalProperty, - Explicit, - Variant, - ScriptValue } type; + Variant + } type; union { int core; QObject *attached; QmlContextPrivate *context; }; int coreType; + int contextIndex; bool isValid() const { return type != Invalid; } bool isCore() const { return type == Core; } - bool isExplicit() const { return type == Explicit; } + bool isVariant() const { return type == Variant; } void clear(); QVariant value(const char *) const; }; diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp index ca840f4..9a14abb 100644 --- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp +++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include class MyQmlObject : public QObject { @@ -75,6 +77,7 @@ private slots: void methods(); void signalAssignment(); void bindingLoop(); + void contextPropertiesTriggerReeval(); private: QmlEngine engine; @@ -141,7 +144,7 @@ void tst_qmlbindengine::methods() QCOMPARE(object->methodIntCalled(), true); } } -#include + void tst_qmlbindengine::bindingLoop() { QmlComponent component(&engine, "MyQmlContainer { children : [ "\ @@ -153,6 +156,73 @@ void tst_qmlbindengine::bindingLoop() QVERIFY(object != 0); } +class MyExpression : public QmlExpression +{ +public: + MyExpression(QmlContext *ctxt, const QString &expr) + : QmlExpression(ctxt, expr, 0), changed(false) + { + } + + virtual void valueChanged() { + changed = true; + } + bool changed; +}; + +void tst_qmlbindengine::contextPropertiesTriggerReeval() +{ + QmlContext context(engine.rootContext()); + MyQmlObject object1; + MyQmlObject object2; + + object1.setStringProperty("Hello"); + object2.setStringProperty("World"); + + context.setContextProperty("testProp", QVariant(1)); + context.setContextProperty("testObj", &object1); + + { + MyExpression expr(&context, "testProp + 1"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant(2)); + + context.setContextProperty("testProp", QVariant(2)); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant(3)); + } + + { + MyExpression expr(&context, "testProp + testProp + testProp"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant(6)); + + context.setContextProperty("testProp", QVariant(4)); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant(12)); + } + + { + MyExpression expr(&context, "testObj.stringProperty"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant("Hello")); + + context.setContextProperty("testObj", &object2); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant("World")); + } + + { + MyExpression expr(&context, "testObj.stringProperty /**/"); + QCOMPARE(expr.changed, false); + QCOMPARE(expr.value(), QVariant("World")); + + context.setContextProperty("testObj", &object1); + QCOMPARE(expr.changed, true); + QCOMPARE(expr.value(), QVariant("Hello")); + } +} + QTEST_MAIN(tst_qmlbindengine) #include "tst_qmlbindengine.moc" -- cgit v0.12 From 53ef297f1292fd5783d619cff7925c919585671f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 11 May 2009 16:38:39 +1000 Subject: localfile optimization for Script elements --- src/declarative/util/qmlscript.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index 7e33502..d986b7a 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -152,11 +152,22 @@ void QmlScript::setSource(const QString &source) return; d->source = source; d->url = qmlContext(this)->resolvedUrl(source); - QNetworkRequest req(d->url); - req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); - d->reply = qmlEngine(this)->networkAccessManager()->get(req); - QObject::connect(d->reply, SIGNAL(finished()), - this, SLOT(replyFinished())); + +#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML + if (d->url.scheme() == QLatin1String("file")) { + QFile file(d->url.toLocalFile()); + file.open(QIODevice::ReadOnly); + QByteArray ba = file.readAll(); + d->addScriptToEngine(QString::fromUtf8(ba), d->source); + } else +#endif + { + QNetworkRequest req(d->url); + req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); + d->reply = qmlEngine(this)->networkAccessManager()->get(req); + QObject::connect(d->reply, SIGNAL(finished()), + this, SLOT(replyFinished())); + } } void QmlScript::replyFinished() -- cgit v0.12 From 036970e7d8c6b2e046ab11924d278c36df8c1c51 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 11 May 2009 17:24:56 +1000 Subject: Remove this doc for now, too incomplete. --- doc/src/declarative/qtdeclarative.qdoc | 1 - doc/src/declarative/qtprogrammers.qdoc | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index 67605dc..4fe9994 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -86,7 +86,6 @@ C++ Reference: \list - \o \l {qtprogrammers}{QML for Qt programmers} \o \l {qtbinding}{C++ Data Binding} \o \l {cppitem}{C++ Components} \endlist diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc index a79c671..6777724 100644 --- a/doc/src/declarative/qtprogrammers.qdoc +++ b/doc/src/declarative/qtprogrammers.qdoc @@ -1,4 +1,7 @@ -/*! +/* + + INCOMPLETE + \page qtprogrammers.html \target qtprogrammers \title QML for Qt programmers -- cgit v0.12 From edadc4df70324d3c4a875795d0032e129206f44b Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 11 May 2009 09:58:26 +0200 Subject: Fixed the conflicts introduced by UiArrayLiteral --- src/declarative/qml/parser/javascript.g | 11 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1279 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 14 +- src/declarative/qml/parser/javascriptparser.cpp | 418 ++++--- src/declarative/qml/parser/javascriptparser_p.h | 4 +- 5 files changed, 853 insertions(+), 873 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index d66266f..474fbb3 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -544,14 +544,14 @@ case $rule_number: { } break; ./ -UiArrayMemberList: UiArrayObjectMember ; +UiArrayMemberList: UiObjectDefinition ; /. case $rule_number: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); } break; ./ -UiArrayMemberList: UiArrayMemberList T_COMMA UiArrayObjectMember ; +UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectDefinition ; /. case $rule_number: { AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), @@ -580,8 +580,6 @@ case $rule_number: { } break; ./ -UiArrayObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; -/. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON T_IDENTIFIER UiObjectInitializer ; /. case $rule_number: { @@ -603,11 +601,8 @@ 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 ; /. case $rule_number: { @@ -641,8 +636,6 @@ case $rule_number: { UiObjectMember: UiQualifiedId T_COLON UiMultilineStringStatement ; /. case $rule_number: ./ -UiArrayObjectMember: UiQualifiedId T_COLON Statement ; -/. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON Statement ; /. case $rule_number: { diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index cb98c36..43422c6 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -56,477 +56,470 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 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}; + 98, 100, 100, 101, 101, 99, 97, 99, 99, 103, + 104, 104, 99, 99, 106, 106, 106, 99, 99, 99, + 99, 99, 99, 99, 102, 102, 110, 110, 110, 102, + 102, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 113, 113, 117, 117, + 112, 112, 115, 115, 118, 118, 118, 118, 118, 118, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 120, 120, 121, 121, 121, 121, 121, 124, 124, + 125, 125, 125, 125, 123, 123, 126, 126, 127, 127, + 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, + 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, + 133, 134, 134, 134, 134, 134, 134, 135, 135, 135, + 135, 135, 136, 136, 136, 136, 136, 137, 137, 138, + 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, + 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, + 148, 116, 116, 149, 149, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 107, 107, 151, + 151, 152, 152, 153, 153, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 154, 169, 169, 168, 168, 109, 109, 170, 170, 171, + 171, 173, 173, 172, 174, 177, 175, 175, 178, 176, + 176, 155, 156, 156, 157, 157, 158, 158, 158, 158, + 158, 158, 158, 159, 159, 159, 159, 160, 160, 160, + 160, 161, 161, 162, 164, 179, 179, 182, 182, 180, + 180, 183, 181, 163, 163, 163, 165, 165, 166, 166, + 166, 184, 185, 167, 167, 108, 122, 189, 189, 186, + 186, 187, 187, 190, 191, 191, 192, 192, 188, 188, + 114, 114, 193}; const int JavaScriptGrammar:: rhs[] = { 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, + 2, 1, 3, 2, 3, 4, 2, 1, 5, 1, + 2, 2, 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, 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, + 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, 3, 1, 3, 1, - 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, + 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 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, 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}; + 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, 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}; + 5, 0, 9, 1, 0, 17, 33, 40, 238, 0, + 0, 37, 38, 14, 35, 36, 39, 239, 18, 10, + 0, 0, 0, 34, 0, 27, 26, 25, 0, 30, + 0, 141, 208, 172, 180, 176, 120, 192, 168, 32, + 105, 43, 121, 184, 188, 109, 138, 119, 124, 104, + 158, 145, 0, 49, 50, 46, 309, 37, 311, 61, + 0, 0, 0, 0, 0, 44, 47, 0, 0, 38, + 39, 48, 42, 0, 45, 0, 0, 134, 0, 0, + 121, 140, 123, 122, 0, 0, 0, 136, 137, 135, + 139, 0, 169, 0, 0, 0, 0, 159, 0, 0, + 0, 0, 0, 0, 149, 0, 0, 0, 143, 144, + 142, 147, 151, 150, 148, 146, 161, 160, 162, 0, + 177, 0, 173, 0, 0, 115, 102, 114, 103, 71, + 72, 73, 98, 74, 99, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 100, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 101, + 0, 0, 113, 209, 116, 0, 117, 0, 118, 112, + 0, 205, 198, 196, 203, 204, 202, 201, 207, 200, + 199, 197, 206, 193, 0, 181, 0, 0, 185, 0, + 0, 189, 0, 0, 115, 107, 0, 106, 0, 111, + 125, 0, 310, 300, 301, 0, 298, 0, 299, 0, + 302, 216, 223, 222, 230, 218, 0, 219, 303, 0, + 308, 220, 221, 226, 224, 305, 304, 307, 227, 0, + 0, 0, 0, 0, 309, 37, 0, 311, 38, 210, + 252, 39, 0, 0, 0, 0, 0, 228, 229, 217, + 225, 253, 254, 297, 306, 0, 268, 269, 270, 271, + 0, 264, 265, 266, 267, 294, 295, 0, 0, 0, + 0, 0, 257, 258, 214, 212, 174, 182, 178, 194, + 170, 215, 0, 121, 186, 190, 163, 152, 0, 0, + 171, 0, 0, 0, 0, 164, 0, 0, 0, 0, + 0, 156, 154, 157, 155, 153, 166, 165, 167, 0, + 179, 0, 175, 0, 213, 121, 0, 195, 210, 211, + 0, 210, 0, 0, 260, 0, 0, 0, 262, 0, + 183, 0, 0, 187, 0, 0, 191, 250, 0, 242, + 251, 245, 0, 249, 0, 210, 243, 0, 210, 0, + 0, 261, 0, 0, 0, 263, 310, 300, 0, 0, + 302, 0, 296, 0, 286, 0, 0, 0, 256, 0, + 255, 0, 312, 0, 70, 232, 235, 0, 71, 238, + 74, 99, 76, 77, 46, 81, 82, 37, 83, 86, + 44, 47, 38, 210, 39, 48, 89, 42, 91, 45, + 93, 94, 239, 96, 97, 101, 0, 63, 0, 0, + 65, 69, 67, 55, 66, 68, 0, 64, 54, 233, + 231, 109, 110, 115, 0, 108, 0, 285, 0, 272, + 273, 0, 284, 0, 0, 0, 275, 280, 278, 281, + 0, 0, 279, 280, 0, 276, 0, 277, 234, 283, + 0, 234, 282, 0, 287, 288, 0, 234, 289, 290, + 0, 0, 291, 0, 0, 0, 292, 293, 127, 126, + 0, 0, 0, 259, 0, 0, 0, 274, 0, 62, + 0, 59, 61, 52, 0, 58, 53, 60, 57, 51, + 0, 56, 131, 129, 133, 130, 128, 132, 0, 0, + 29, 0, 31, 28, 15, 11, 0, 0, 24, 37, + 61, 20, 0, 23, 16, 0, 12, 0, 19, 13, + 21, 22, 41, 247, 240, 0, 248, 244, 0, 246, + 236, 0, 237, 241, 313}; const int JavaScriptGrammar::goto_default [] = { - 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}; + 6, 5, 13, 1, 4, 3, 28, 30, 29, 525, + 15, 31, 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, + 535, 534, 348, 349, 537, 351, 536, 350, 446, 450, + 453, 449, 448, 468, 469, 215, 229, 211, 214, 228, + 236, 235, 0}; const int JavaScriptGrammar::action_index [] = { - -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, + -10, -91, -42, -91, -1, 36, 71, 73, -91, -91, + -91, -17, -91, -91, 393, -91, -91, -91, -91, 17, + 208, 51, 197, -91, -91, -91, 30, -91, -91, -91, + 476, 102, 194, -91, 159, -91, -91, -91, 68, 82, + 723, 81, -91, 80, 60, 28, 175, -91, 327, 14, + -91, -91, 474, 18, 74, 165, 153, -91, -91, -91, + 353, 170, 723, -91, -91, -91, 158, -91, 1221, 5, + 723, 723, 723, 643, 723, -91, -91, 723, 723, -91, + -91, -91, -91, 723, -91, 723, 723, -91, 723, 723, + 111, 143, -91, -91, 723, 723, 723, -91, -91, -91, + 206, 723, 327, 723, 723, 723, 723, 373, 723, 723, + 723, 723, 723, 723, 207, 723, 723, 723, 91, 117, + 103, 254, 254, 254, 254, 254, 389, 343, 363, 723, + 21, 723, 0, 1134, 723, 723, -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, - 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, + 96, 723, -91, -91, 61, -2, -91, 723, -91, -91, + 723, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, 723, -14, 723, 723, 34, 33, + 723, -91, 1134, 723, 723, -91, 133, -91, -57, -91, + -91, -15, -91, 192, 49, 16, -91, 183, -91, 40, + 1482, -91, -91, -91, -91, -91, 205, -91, -91, 20, + -91, -91, -91, -91, -91, -91, 1482, -91, -91, 260, + 302, 100, 1395, 52, 198, 67, 41, 1656, 53, 723, + -91, 54, 27, 723, 29, 31, 32, -91, -91, -91, + -91, -91, -91, -91, -91, 108, -91, -91, -91, -91, + 89, -91, -91, -91, -91, -91, -91, 62, 59, 723, + 125, 116, -91, -91, 1047, -91, 84, 43, -52, -91, + 267, 48, -44, 564, 10, 113, 320, 254, 169, 723, + 269, 723, 723, 723, 723, 293, 723, 723, 723, 723, + 723, 166, 120, 146, 154, 254, 395, 324, 274, 723, + -73, 723, 24, 723, -91, 430, 723, -91, 723, 42, + -7, 723, -19, 1395, -91, 723, 122, 1395, -91, 723, + -20, 723, 723, 25, 26, 723, -91, 22, 115, 7, + -91, -91, 723, -91, 224, 723, -91, 55, 723, -28, + 1395, -91, 723, 86, 1395, -91, 6, 233, -25, 4, + 1482, -26, -91, 1395, -91, 723, 114, 1395, 15, 1395, + -91, 23, 35, -6, -91, -91, 1395, -4, 272, 45, + 275, 87, 723, 1395, 46, 12, 241, 37, 11, 643, + 38, 39, -91, 807, -91, 1, -29, 2, 723, 3, + -27, 723, -3, 723, -36, 19, 723, -91, 1308, -5, + -91, -91, -91, -91, -91, -91, 723, -91, -91, -91, + -91, 171, -91, 723, -41, -91, 1395, -91, 78, -91, + -91, 1395, -91, 723, 112, -9, -91, 105, -91, 13, + 101, 723, -91, 9, 8, -91, 47, -91, 1395, -91, + 93, 1395, -91, 167, -91, -91, 107, 1395, 66, -91, + 57, 70, -91, 173, 69, 72, -91, -91, -91, -91, + 723, 106, 1395, -91, 723, 99, 1395, -91, 104, 56, + 967, -91, 58, -91, 887, -91, -91, -91, -91, -91, + 188, -91, -91, -91, -91, -91, -91, -91, 44, 50, + 63, 723, 64, -91, -91, -91, 1569, 217, -91, 85, + 90, -91, 75, -91, -91, 88, -91, -18, -91, -91, + -91, -91, -91, 65, -91, 195, -91, -91, 723, -91, + -91, 185, -91, -91, -91, - -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}; + -103, -103, -103, -103, 34, 37, -103, -103, -103, -103, + -103, -103, -103, -103, 202, -103, -103, -103, -103, -103, + 39, -103, -103, -103, -103, -103, -103, -103, -103, -103, + 319, -103, 4, -103, 33, -103, -103, -103, -103, -103, + 44, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -58, -103, -103, -103, -103, -103, -103, -103, + -103, -103, 157, -103, -103, -103, -2, -103, -103, -103, + -3, 132, 136, 150, 137, -103, -103, 140, 15, -103, + -103, -103, -103, 112, -103, 120, 125, -103, 123, 145, + -103, -103, -103, -103, 116, 149, 163, -103, -103, -103, + -103, 146, -103, 152, 155, 65, 82, -103, 86, 85, + 108, 84, 58, 67, -103, 76, 74, 75, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, 98, + -103, 95, -103, 68, 36, 29, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, 1, -103, -103, -103, -103, -103, -9, -103, -103, + -20, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, 56, -103, 57, -17, -103, -103, + 46, -103, 222, 40, 59, -103, -103, -103, -103, -103, + -103, -103, -103, 51, -103, -103, -103, 38, -103, -103, + 32, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, 66, -103, -103, 19, + 11, -103, 18, -103, 16, -103, -103, -103, -103, 63, + -103, -103, -103, 60, -13, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -10, + -103, -103, -103, -103, 119, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, 14, 211, + -103, 203, 189, 199, 195, -103, 87, 94, 96, 102, + 106, -103, -103, -103, -103, -103, -103, -103, -103, 188, + -103, 166, -103, 170, -103, -103, 176, -103, 79, -103, + -103, 117, -103, 41, -103, 25, -103, 28, -103, 167, + -103, 174, 168, -103, -103, 164, -103, -103, -103, -103, + -103, -103, 207, -103, 70, 97, -103, -103, 69, -103, + 35, -103, 31, -103, 26, -103, -103, 71, -103, -103, + 83, -103, -103, 13, -103, 9, -103, 17, -103, 23, + -103, -103, -103, -103, -103, -103, 45, -103, 54, -103, + 55, -103, 81, 53, -103, -103, 50, -103, -103, 72, + -103, -103, -103, 62, -103, -103, -103, -103, 49, -103, + -19, 224, -103, 160, -103, -103, 43, -103, 48, -103, + -103, -103, -103, -103, -103, -103, -23, -103, -103, -103, + -103, -103, -103, 139, -103, -103, -5, -103, -103, -103, + -103, 7, -103, -6, -103, -103, -103, -103, -103, -78, + -103, -4, -103, -71, -103, -103, -103, -103, -77, -103, + -103, -55, -103, -103, -103, -103, -103, -103, -83, -103, + -103, -43, -103, 0, -103, -59, -103, -103, -103, -103, + -1, -103, 90, -103, 8, -103, -7, -103, -103, -103, + -22, -103, 42, -103, 47, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, 61, -103, -103, -103, -103, 52, 10, -103, 24, + 30, -103, -103, -103, -103, -103, -103, 22, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, 20, -103, + -103, 64, -103, -103, -103}; const int JavaScriptGrammar::action_info [] = { - 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, + 480, 101, 426, 209, -95, 321, 467, 443, -68, -90, + -92, 11, 339, 491, 451, 458, 14, 328, 451, 435, + 194, 213, 171, 7, 447, 299, 321, 339, 319, 372, + 416, 379, 360, 345, 129, 369, 194, 370, 362, 352, + 200, 333, 367, 418, -65, -87, -69, 375, 284, 428, + 171, 430, -98, -79, 331, 484, 323, 217, 179, 513, + 436, 441, 467, 443, 497, 11, 491, 480, 484, 177, + 511, 544, 171, 220, 373, 263, 219, 375, 2, 510, + 367, 101, 538, 34, 14, 299, 471, 2, 284, 40, + 0, 319, 373, 473, 171, 279, 527, 39, 491, 131, + 461, 171, 457, 467, 171, 467, 131, 171, 129, 516, + 451, 454, 492, 470, 171, 0, 358, 517, 14, 11, + 171, 88, 171, 354, 196, 0, 0, 471, 197, 475, + 171, 88, 89, 171, 9, 8, 531, 530, 278, 440, + 439, 171, 89, 88, 528, 115, 364, 116, 276, 275, + 274, 273, 172, 92, 89, 94, 455, 88, 117, 486, + 493, 276, 275, 341, 93, 94, 482, 342, 89, 269, + 268, 115, 445, 116, 377, 171, 355, 283, 282, 115, + 202, 116, 337, 0, 117, 281, 202, 67, 35, 207, + 133, 115, 117, 116, 0, 115, 171, 116, 67, 203, + 95, 204, 67, 541, 117, 203, 96, 433, 117, 134, + 95, 135, 67, 171, 67, 0, 96, 0, 94, 0, + 0, 67, 0, 67, 79, 80, 35, 67, 465, 464, + 0, 0, 115, 37, 116, 79, 80, 67, 0, 79, + 80, 0, 0, 0, 36, 117, 67, 0, 501, 79, + 80, 79, 80, 67, 0, 0, 542, 540, 79, 80, + 79, 80, 67, 95, 79, 80, 262, 261, 0, 96, + 67, 37, 0, 0, 79, 80, 0, -309, 0, 115, + 0, 116, 36, 79, 80, 301, 302, 301, 302, 67, + 79, 80, 117, 0, 0, 0, 0, 306, 307, 79, + 80, 67, 0, 0, 67, 0, 308, 79, 80, 309, + 0, 310, 303, 304, 303, 304, 306, 307, 0, 0, + 0, 267, 266, 0, 0, 308, 79, 80, 309, 0, + 310, 67, 0, 267, 266, 0, 272, 271, 79, 80, + 0, 79, 80, 306, 307, 103, 104, 306, 307, 0, + 0, 0, 308, 0, 0, 309, 308, 310, 0, 309, + 0, 310, 0, 272, 271, 0, 108, 109, 79, 80, + 0, 0, 105, 106, 110, 111, 108, 109, 112, 0, + 113, 0, 0, 0, 110, 111, 108, 109, 112, 0, + 113, 0, 0, 0, 110, 111, 108, 109, 112, 0, + 113, 0, 0, 19, 110, 111, 0, 0, 112, 0, + 113, 0, 108, 109, 0, 20, 0, 0, 306, 307, + 110, 111, 21, 0, 112, 0, 113, 308, 0, 0, + 309, 0, 310, 181, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 182, 0, 0, 0, 183, 23, 0, + 0, 0, 25, 0, 0, 0, 184, 0, 185, 22, + 26, 0, 0, 0, 0, 0, 0, 27, 0, 186, + 0, 187, 92, 0, 0, 0, 18, 181, 24, 188, + 0, 0, 189, 93, 0, 0, 19, 182, 190, 0, + 0, 183, 0, 0, 191, 0, 0, 0, 20, 0, + 184, 0, 185, 0, 0, 21, 0, 0, 0, 192, + 0, 0, 0, 186, 0, 187, 92, 0, 0, 0, + 0, 0, 0, 188, 0, 0, 189, 93, 0, 0, + 0, 514, 190, 0, 0, 25, 0, 0, 191, 0, + 0, 0, 22, 26, 0, 0, 0, 0, 0, 0, + 27, 0, 0, 192, 0, 0, 0, 0, 0, 18, + 0, 24, 0, 0, 0, 0, 0, 181, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, + 0, 183, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, -88, 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, 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, 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, - 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, + 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, 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, 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, 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, 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, + 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, -234, 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, - 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, + 459, 180, 427, 498, 476, 193, 280, 487, 199, 437, + 444, 472, 460, 500, 452, 481, 178, 212, 456, 474, + 477, 442, 462, 533, 485, 376, 173, 374, 529, 532, + 270, 378, 277, 347, 524, 366, 526, 380, 265, 10, + 365, 336, 338, 12, 466, 539, 237, 363, 38, 361, + 466, 90, 170, 506, 176, 334, 206, 218, 508, 429, + 49, 0, 0, 494, 0, 463, 518, 277, 417, 212, + 216, 201, 495, 265, 270, 419, 463, 512, 329, 329, + 237, 0, 0, 533, 176, 329, 0, 136, 0, 347, + 216, 208, 90, 90, 90, 329, 138, 237, 0, 124, + 0, 90, 431, 90, 483, 432, 195, 127, 125, 198, + 90, 90, 90, 329, 119, 120, 118, 90, 90, 210, + 90, 90, 90, 90, 128, 123, 121, 114, 311, 359, + 90, 90, 90, 329, 90, 312, 0, 313, 90, 330, + 0, 132, 90, 314, 90, 543, 130, 315, 90, 122, + 507, 0, 90, 356, 97, 293, 90, 357, 478, 90, + 297, 90, 91, 479, 176, 0, 368, 264, 90, 0, + 502, 434, 90, 90, 503, 504, 90, 332, 505, 371, + 431, 90, 90, 432, 100, 90, 0, 98, 90, 0, + 102, 90, 0, 90, 107, 210, 90, 126, 479, 90, + 325, 99, 90, 90, 325, 297, 325, 297, 297, 297, + 90, 297, 325, 322, 0, 297, 0, 297, 340, 16, + 33, 17, 346, 0, 90, 90, 344, 343, 324, 297, + 297, 90, 316, 0, 327, 90, 297, 320, 318, 90, + 297, 136, 317, 325, 297, 0, 305, 90, 297, 0, + 138, 205, 297, 0, 0, 0, 300, 0, 0, 0, + 90, 0, 478, 0, 0, 353, 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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 515, 0, 0, + 0, 0, 0, 0, 0, 0, 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, 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, @@ -534,224 +527,220 @@ const int JavaScriptGrammar::action_info [] = { 0, 0}; const int JavaScriptGrammar::action_check [] = { - 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, + 36, 1, 7, 60, 7, 78, 33, 36, 7, 7, + 7, 29, 2, 8, 5, 7, 33, 61, 5, 60, + 2, 36, 8, 65, 33, 1, 78, 2, 48, 55, + 7, 16, 60, 7, 48, 60, 2, 33, 31, 17, + 7, 60, 36, 8, 7, 7, 7, 36, 36, 55, + 8, 55, 7, 7, 61, 36, 8, 8, 60, 29, + 7, 7, 33, 36, 8, 29, 8, 36, 36, 8, + 7, 0, 8, 33, 7, 55, 60, 36, 88, 29, + 36, 1, 17, 66, 33, 1, 20, 88, 36, 7, + -1, 48, 7, 36, 8, 36, 8, 29, 8, 78, + 7, 8, 55, 33, 8, 33, 78, 8, 48, 7, + 5, 10, 8, 6, 8, -1, 61, 15, 33, 29, + 8, 40, 8, 8, 50, -1, -1, 20, 54, 60, + 8, 40, 51, 8, 61, 62, 61, 62, 76, 61, + 62, 8, 51, 40, 56, 25, 60, 27, 61, 62, + 61, 62, 56, 42, 51, 12, 55, 40, 38, 60, + 56, 61, 62, 50, 53, 12, 60, 54, 51, 61, + 62, 25, 60, 27, 60, 8, 61, 61, 62, 25, + 15, 27, 60, -1, 38, 60, 15, 29, 29, 56, + 15, 25, 38, 27, -1, 25, 8, 27, 29, 34, + 57, 36, 29, 8, 38, 34, 63, 36, 38, 34, + 57, 36, 29, 8, 29, -1, 63, -1, 12, -1, + -1, 29, -1, 29, 66, 67, 29, 29, 61, 62, + -1, -1, 25, 74, 27, 66, 67, 29, -1, 66, + 67, -1, -1, -1, 85, 38, 29, -1, 60, 66, + 67, 66, 67, 29, -1, -1, 61, 62, 66, 67, + 66, 67, 29, 57, 66, 67, 61, 62, -1, 63, + 29, 74, -1, -1, 66, 67, -1, 36, -1, 25, + -1, 27, 85, 66, 67, 18, 19, 18, 19, 29, + 66, 67, 38, -1, -1, -1, -1, 23, 24, 66, + 67, 29, -1, -1, 29, -1, 32, 66, 67, 35, + -1, 37, 45, 46, 45, 46, 23, 24, -1, -1, + -1, 61, 62, -1, -1, 32, 66, 67, 35, -1, + 37, 29, -1, 61, 62, -1, 61, 62, 66, 67, + -1, 66, 67, 23, 24, 18, 19, 23, 24, -1, + -1, -1, 32, -1, -1, 35, 32, 37, -1, 35, + -1, 37, -1, 61, 62, -1, 23, 24, 66, 67, + -1, -1, 45, 46, 31, 32, 23, 24, 35, -1, + 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, + 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, + 37, -1, -1, 10, 31, 32, -1, -1, 35, -1, + 37, -1, 23, 24, -1, 22, -1, -1, 23, 24, + 31, 32, 29, -1, 35, -1, 37, 32, -1, -1, + 35, -1, 37, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 13, -1, -1, -1, 17, 55, -1, + -1, -1, 59, -1, -1, -1, 26, -1, 28, 66, + 67, -1, -1, -1, -1, -1, -1, 74, -1, 39, + -1, 41, 42, -1, -1, -1, 83, 3, 85, 49, + -1, -1, 52, 53, -1, -1, 10, 13, 58, -1, + -1, 17, -1, -1, 64, -1, -1, -1, 22, -1, + 26, -1, 28, -1, -1, 29, -1, -1, -1, 79, + -1, -1, -1, 39, -1, 41, 42, -1, -1, -1, + -1, -1, -1, 49, -1, -1, 52, 53, -1, -1, + -1, 55, 58, -1, -1, 59, -1, -1, 64, -1, + -1, -1, 66, 67, -1, -1, -1, -1, -1, -1, + 74, -1, -1, 79, -1, -1, -1, -1, -1, 83, + -1, 85, -1, -1, -1, -1, -1, 3, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 13, -1, -1, + -1, 17, -1, -1, -1, -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, -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, 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, -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, 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, 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, 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, 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, + -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, 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, 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, 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, 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, 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, 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, + 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, 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, 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, + 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, 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, -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, + 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, - 55, -1, -1, -1, 59, -1, 61, -1, -1, -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, + -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, -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, 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, 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, - 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, + 77, 59, 25, 25, 63, 25, 16, 14, 25, 14, + 16, 94, 16, 16, 92, 16, 25, 19, 89, 19, + 63, 14, 77, 19, 16, 16, 25, 14, 6, 19, + 19, 14, 14, 19, 10, 19, 6, 14, 19, 5, + 14, 16, 14, 6, 63, 25, 14, 16, 15, 14, + 63, 36, 16, 38, 25, 14, 16, 19, 19, 14, + 16, -1, -1, 21, -1, 16, 14, 14, 25, 19, + 19, 25, 25, 19, 19, 27, 16, 16, 16, 16, + 14, -1, -1, 19, 25, 16, -1, 19, -1, 19, + 19, 32, 36, 36, 36, 16, 28, 14, -1, 41, + -1, 36, 30, 36, 14, 33, 50, 42, 41, 52, + 36, 36, 36, 16, 40, 40, 40, 36, 36, 38, + 36, 36, 36, 36, 42, 41, 41, 41, 41, 60, + 36, 36, 36, 16, 36, 41, -1, 41, 36, 60, + -1, 46, 36, 41, 36, 81, 48, 41, 36, 41, + 38, -1, 36, 83, 38, 36, 36, 60, 38, 36, + 41, 36, 39, 38, 25, -1, 95, 101, 36, -1, + 38, 32, 36, 36, 38, 38, 36, 60, 38, 96, + 30, 36, 36, 33, 39, 36, -1, 38, 36, -1, + 44, 36, -1, 36, 42, 38, 36, 42, 38, 36, + 36, 38, 36, 36, 36, 41, 36, 41, 41, 41, + 36, 41, 36, 47, -1, 41, -1, 41, 51, 17, + 18, 19, 58, -1, 36, 36, 58, 53, 58, 41, + 41, 36, 43, -1, 58, 36, 41, 49, 43, 36, + 41, 19, 43, 36, 41, -1, 43, 36, 41, -1, + 28, 29, 41, -1, -1, -1, 45, -1, -1, -1, + 36, -1, 38, -1, -1, 58, -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, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, + -1, -1, -1, -1, -1, -1, 17, 18, 19, -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, 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, diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 3b98238..84f1a64 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 = 553, - RULE_COUNT = 317, - STATE_COUNT = 554, + ACCEPT_STATE = 544, + RULE_COUNT = 313, + STATE_COUNT = 545, TERMINAL_COUNT = 91, - NON_TERMINAL_COUNT = 104, + NON_TERMINAL_COUNT = 103, - GOTO_INDEX_OFFSET = 554, - GOTO_INFO_OFFSET = 1836, - GOTO_CHECK_OFFSET = 1836 + GOTO_INDEX_OFFSET = 545, + GOTO_INFO_OFFSET = 1747, + GOTO_CHECK_OFFSET = 1747 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 0857eef..f9615c0 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -231,8 +231,8 @@ case 14: { node->rbraceToken = loc(3); sym(1).Node = node; } break; - case 15: -case 16: { + +case 15: { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); @@ -240,14 +240,14 @@ case 16: { sym(1).Node = node; } break; -case 17: { +case 16: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; - case 20: -case 21: { + +case 18: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -256,33 +256,33 @@ case 21: { sym(1).Node = node; } break; -case 22: { +case 19: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 24: { +case 21: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; - case 25: case 26: -case 27: { + case 22: +case 23: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 28: +case 24: -case 29: { +case 25: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); break; } -case 31: { +case 27: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (JavaScriptNameIdImpl *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -291,7 +291,7 @@ case 31: { sym(1).Node = node; } break; -case 32: { +case 28: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -299,7 +299,7 @@ case 32: { sym(1).Node = node; } break; -case 33: { +case 29: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -309,7 +309,7 @@ case 33: { sym(1).Node = node; } break; -case 34: { +case 30: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -319,7 +319,7 @@ case 34: { sym(1).Node = node; } break; -case 35: { +case 31: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -331,88 +331,88 @@ case 35: { sym(1).Node = node; } break; -case 36: { +case 32: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 37: { +case 33: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 38: -case 39: +case 34: +case 35: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 41: { +case 37: { QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 42: { +case 38: { QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 43: { +case 39: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 44: { +case 40: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 45: { +case 41: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 42: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 43: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 48: { +case 44: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 49: { +case 45: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 50: { +case 46: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 51: { +case 47: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 52: { +case 48: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -423,7 +423,7 @@ case 52: { sym(1).Node = node; } break; -case 53: { +case 49: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -434,21 +434,21 @@ case 53: { sym(1).Node = node; } break; -case 54: { +case 50: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 55: { +case 51: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 56: { +case 52: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -456,7 +456,7 @@ case 56: { sym(1).Node = node; } break; -case 57: { +case 53: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode (driver->nodePool(), @@ -468,7 +468,7 @@ case 57: { sym(1).Node = node; } break; -case 58: { +case 54: { AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -476,51 +476,51 @@ case 58: { sym(1).Node = node; } break; -case 59: { +case 55: { AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 60: { +case 56: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 61: { +case 57: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 62: { +case 58: { AST::Elision *node = makeAstNode (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 63: { +case 59: { AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 64: { +case 60: { sym(1).Node = 0; } break; -case 65: { +case 61: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 66: { +case 62: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 67: { +case 63: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -528,36 +528,44 @@ case 67: { sym(1).Node = node; } break; -case 68: { +case 64: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 69: -case 70: { +case 65: +case 66: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 71: { +case 67: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 72: { +case 68: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 73: { +case 69: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; +case 70: + +case 71: + +case 72: + +case 73: + case 74: case 75: @@ -611,33 +619,25 @@ case 98: case 99: case 100: - -case 101: - -case 102: - -case 103: - -case 104: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 109: { +case 105: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 110: { +case 106: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 111: { +case 107: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -645,384 +645,384 @@ case 111: { sym(1).Node = node; } break; -case 113: { +case 109: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 114: { +case 110: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 115: { +case 111: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 116: { +case 112: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 117: { +case 113: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 118: { +case 114: { sym(1).Node = 0; } break; -case 119: { +case 115: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 120: { +case 116: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 121: { +case 117: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 125: { +case 121: { AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 126: { +case 122: { AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 128: { +case 124: { AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 129: { +case 125: { AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 130: { +case 126: { AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 131: { +case 127: { AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 132: { +case 128: { AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 133: { +case 129: { AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 130: { AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 135: { +case 131: { AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 136: { +case 132: { AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 138: { +case 134: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 139: { +case 135: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 136: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 142: { +case 138: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 139: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 141: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 142: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 143: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 145: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 146: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { +case 147: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 148: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 153: { +case 149: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 150: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 152: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 157: { +case 153: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 154: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 159: { +case 155: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 156: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 158: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 159: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 164: { +case 160: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 161: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +case 163: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { +case 164: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 169: { +case 165: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 166: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 168: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +case 170: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +case 172: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 178: { +case 174: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 176: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +case 178: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +case 180: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 186: { +case 182: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 188: { +case 184: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 190: { +case 186: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 192: { +case 188: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1030,7 +1030,7 @@ case 192: { sym(1).Node = node; } break; -case 194: { +case 190: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1038,112 +1038,112 @@ case 194: { sym(1).Node = node; } break; -case 196: { +case 192: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 198: { +case 194: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 199: { +case 195: { sym(1).ival = QSOperator::Assign; } break; -case 200: { +case 196: { sym(1).ival = QSOperator::InplaceMul; } break; -case 201: { +case 197: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 202: { +case 198: { sym(1).ival = QSOperator::InplaceMod; } break; -case 203: { +case 199: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 204: { +case 200: { sym(1).ival = QSOperator::InplaceSub; } break; -case 205: { +case 201: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 206: { +case 202: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 207: { +case 203: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 208: { +case 204: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 209: { +case 205: { sym(1).ival = QSOperator::InplaceXor; } break; -case 210: { +case 206: { sym(1).ival = QSOperator::InplaceOr; } break; -case 212: { +case 208: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 213: { +case 209: { sym(1).Node = 0; } break; -case 216: { +case 212: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 217: { +case 213: { sym(1).Node = 0; } break; -case 234: { +case 230: { AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 235: { +case 231: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 236: { +case 232: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 237: { +case 233: { sym(1).Node = 0; } break; -case 238: { +case 234: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 240: { +case 236: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1151,76 +1151,76 @@ case 240: { sym(1).Node = node; } break; -case 241: { +case 237: { sym(1).ival = T_CONST; } break; -case 242: { +case 238: { sym(1).ival = T_VAR; } break; -case 243: { +case 239: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 244: { +case 240: { AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 245: { +case 241: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 246: { +case 242: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 247: { +case 243: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 248: { +case 244: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 249: { +case 245: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 250: { +case 246: { sym(1).Node = 0; } break; -case 252: { +case 248: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 253: { +case 249: { sym(1).Node = 0; } break; -case 255: { +case 251: { AST::EmptyStatement *node = makeAstNode (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 257: { +case 253: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 258: { +case 254: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1229,7 +1229,7 @@ case 258: { sym(1).Node = node; } break; -case 259: { +case 255: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1237,7 +1237,7 @@ case 259: { sym(1).Node = node; } break; -case 261: { +case 257: { AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1247,7 +1247,7 @@ case 261: { sym(1).Node = node; } break; -case 262: { +case 258: { AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1255,7 +1255,7 @@ case 262: { sym(1).Node = node; } break; -case 263: { +case 259: { AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1266,7 +1266,7 @@ case 263: { sym(1).Node = node; } break; -case 264: { +case 260: { AST::LocalForStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1279,7 +1279,7 @@ case 264: { sym(1).Node = node; } break; -case 265: { +case 261: { AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1289,7 +1289,7 @@ case 265: { sym(1).Node = node; } break; -case 266: { +case 262: { AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1300,14 +1300,14 @@ case 266: { sym(1).Node = node; } break; -case 268: { +case 264: { AST::ContinueStatement *node = makeAstNode (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 270: { +case 266: { AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1315,14 +1315,14 @@ case 270: { sym(1).Node = node; } break; -case 272: { +case 268: { AST::BreakStatement *node = makeAstNode (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 274: { +case 270: { AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1330,14 +1330,14 @@ case 274: { sym(1).Node = node; } break; -case 276: { +case 272: { AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 277: { +case 273: { AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1345,7 +1345,7 @@ case 277: { sym(1).Node = node; } break; -case 278: { +case 274: { AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1353,90 +1353,90 @@ case 278: { sym(1).Node = node; } break; -case 279: { +case 275: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 280: { +case 276: { AST::CaseBlock *node = makeAstNode (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 281: { +case 277: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 282: { +case 278: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 283: { +case 279: { sym(1).Node = 0; } break; -case 284: { +case 280: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 285: { +case 281: { AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 286: { +case 282: { AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 287: -case 288: { +case 283: +case 284: { AST::LabelledStatement *node = makeAstNode (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 289: { +case 285: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 291: { +case 287: { AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 292: { +case 288: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 293: { +case 289: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 294: { +case 290: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 295: { +case 291: { AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1445,20 +1445,20 @@ case 295: { sym(1).Node = node; } break; -case 296: { +case 292: { AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 298: { +case 294: { AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 299: { +case 295: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1469,7 +1469,7 @@ case 299: { sym(1).Node = node; } break; -case 300: { +case 296: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1481,56 +1481,56 @@ case 300: { sym(1).Node = node; } break; -case 301: { +case 297: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 302: { +case 298: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 303: { +case 299: { sym(1).Node = 0; } break; -case 304: { +case 300: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 305: { +case 301: { sym(1).Node = 0; } break; -case 307: { +case 303: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 308: { +case 304: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 309: { +case 305: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 310: { +case 306: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 311: { +case 307: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 312: { +case 308: { sym(1).sval = 0; } break; -case 314: { +case 310: { sym(1).Node = 0; } break; @@ -1580,7 +1580,6 @@ case 314: { 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, msg)); action = errorState; @@ -1609,7 +1608,6 @@ case 314: { 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, msg)); yytoken = *tk; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 5e68fe7..f7b51e0 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -205,9 +205,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 52 +#define J_SCRIPT_REGEXPLITERAL_RULE1 48 -#define J_SCRIPT_REGEXPLITERAL_RULE2 53 +#define J_SCRIPT_REGEXPLITERAL_RULE2 49 QT_END_NAMESPACE -- cgit v0.12 From 205885831029730ee8faf28dcc7083806cfd5205 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 11 May 2009 10:10:23 +0200 Subject: Added positioning information to the dom as position+length. Reviewed-by: Roberto Raggi --- src/declarative/qml/qmldom.cpp | 72 +++++++++++++++++++++++++++++++++ src/declarative/qml/qmldom.h | 9 +++++ src/declarative/qml/qmlparser_p.h | 8 ++++ src/declarative/qml/qmlscriptparser.cpp | 2 + 4 files changed, 91 insertions(+) diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 4e754a3..ae335df 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -398,6 +398,30 @@ void QmlDomProperty::setValue(const QmlDomValue &value) qWarning("QmlDomProperty::setValue(const QmlDomValue &): Not Implemented"); } +/*! + Returns the position in the input data where the property ID startd, or 0 if + the property is invalid. +*/ +int QmlDomProperty::position() const +{ + if (d && d->property) { + return d->property->location.range.offset; + } else + return 0; +} + +/*! + Returns the length in the input data from where the property ID started upto + the end of it, or 0 if the property is invalid. +*/ +int QmlDomProperty::length() const +{ + if (d && d->property) + return d->property->location.range.length; + else + return 0; +} + QmlDomObjectPrivate::QmlDomObjectPrivate() : object(0), isVirtualComponent(false) { @@ -732,6 +756,30 @@ QmlDomComponent QmlDomObject::toComponent() const return rv; } +/*! + Returns the position in the input data where the property assignment started +, or 0 if the property is invalid. +*/ +int QmlDomObject::position() const +{ + if (d && d->object) + return d->object->location.range.offset; + else + return 0; +} + +/*! + Returns the length in the input data from where the property assignment star +ted upto the end of it, or 0 if the property is invalid. +*/ +int QmlDomObject::length() const +{ + if (d && d->object) + return d->object->location.range.length; + else + return 0; +} + QmlDomBasicValuePrivate::QmlDomBasicValuePrivate() : value(0) { @@ -1254,6 +1302,30 @@ QmlDomList QmlDomValue::toList() const } /*! + Returns the position in the input data where the property value startd, or 0 + if the value is invalid. +*/ +int QmlDomValue::position() const +{ + if (type() == Invalid) + return 0; + else + return d->value->location.range.offset; +} + +/*! + Returns the length in the input data from where the property value started u +pto the end of it, or 0 if the value is invalid. +*/ +int QmlDomValue::length() const +{ + if (type() == Invalid) + return 0; + else + return d->value->location.range.length; +} + +/*! \class QmlDomList \internal \brief The QmlDomList class represents a list of values assigned to a QML property. diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h index 8b503fa..04ce8b9 100644 --- a/src/declarative/qml/qmldom.h +++ b/src/declarative/qml/qmldom.h @@ -99,6 +99,9 @@ public: QmlDomValue value() const; void setValue(const QmlDomValue &); + int position() const; + int length() const; + private: friend class QmlDomObject; QSharedDataPointer d; @@ -134,6 +137,9 @@ public: bool isComponent() const; QmlDomComponent toComponent() const; + int position() const; + int length() const; + private: friend class QmlDomDocument; friend class QmlDomComponent; @@ -236,6 +242,9 @@ public: QmlDomObject toObject() const; QmlDomList toList() const; + int position() const; + int length() const; + private: friend class QmlDomProperty; friend class QmlDomList; diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 31f8702..f0eb864 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -74,10 +74,18 @@ namespace QmlParser int column; }; + struct LocationRange + { + LocationRange() : offset(0), length(0) {} + quint32 offset; + quint32 length; + }; + struct LocationSpan { Location start; Location end; + LocationRange range; }; class Property; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 169e2ea..36005c2 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -339,6 +339,8 @@ LocationSpan ProcessAST::location(AST::SourceLocation start, AST::SourceLocation rv.start.column = start.startColumn; rv.end.line = end.startLine; rv.end.column = end.startColumn + end.length - 1; + rv.range.offset = start.offset; + rv.range.length = end.offset + end.length - start.offset; return rv; } -- cgit v0.12 From 936b9b898830c9d5e05be5da584a20b28db78e11 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 11 May 2009 11:36:24 +0200 Subject: qdoc: Fixed some qdoc errors. --- src/declarative/3rdparty/qlistmodelinterface.cpp | 25 ++++++++++++++++-------- src/declarative/3rdparty/qlistmodelinterface.h | 4 ++-- src/declarative/qml/qmlengine.cpp | 4 +--- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index d327b58..75960a1 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -69,13 +69,13 @@ QT_BEGIN_NAMESPACE Returns the number of data entries in the model. */ -/*! \fn QHash_int QListModelInterface::data(int index, const QList &roles) const +/*! \fn QHash QListModelInterface::data(int index, const QList& roles) const Returns the data at the given \a index for the specifed \a roles. */ -/*! \fn bool QListModelInterface::setData(int index, const QHash &values) +/*! \fn bool QListModelInterface::setData(int index, const QHash& values) Sets the data at the given \a index. \a values is a mapping of - QVariant values to roles. + QVariant values to roles. Returns false. */ /*! \fn QList QListModelInterface::roles() const @@ -87,13 +87,22 @@ QT_BEGIN_NAMESPACE Returns a string description of the specified \a role. */ -/*! \enum QListModelInterface::Roles +/*! \fn void QListModelInterface::itemsInserted(int index, int count) + Emit this signal when \a count items are inserted at \a index. + */ - Values for representing roles. +/*! \fn void QListModelInterface::itemsRemoved(int index, int count) + Emit this signal when \a count items are removed at \a index. + */ - \value TextRole +/*! \fn void QListModelInterface::itemsMoved(int from, int to, int count) + Emit this signal when \a count items are moved from index \a from + to index \a to. + */ - \value IconRole -*/ +/*! \fn void QListModelInterface::itemsChanged(int index, int count, const QList &roles) + Emit this signal when \a count items at \a index have had their + \a roles changed. + */ QT_END_NAMESPACE diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h index 191a95b..19284ca 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ b/src/declarative/3rdparty/qlistmodelinterface.h @@ -61,8 +61,8 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject virtual ~QListModelInterface() {} virtual int count() const = 0; - virtual QHash data(int index, const QList &roles = (QList())) const = 0; - virtual bool setData(int index, const QHash &values) + virtual QHash data(int index, const QList& roles = QList()) const = 0; + virtual bool setData(int index, const QHash& values) { Q_UNUSED(index); Q_UNUSED(values); return false; } virtual QList roles() const = 0; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c39a0d5..85578e7 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -621,9 +621,7 @@ QNetworkAccessManager *QmlEngine::networkAccessManager() const Returns the QmlContext for the \a object, or 0 if no context has been set. When the QmlEngine instantiates a QObject, the context is set automatically. - - \sa qmlContext() - */ + */ QmlContext *QmlEngine::contextForObject(const QObject *object) { if(!object) -- cgit v0.12 From ec23f2eb4ff31e415e81c8fb09ff3022e9bc3c95 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 11 May 2009 12:33:02 +0200 Subject: qdoc: Fixed some qdoc errors. --- src/declarative/fx/qfxcomponentinstance.cpp | 2 +- src/declarative/fx/qfxgridview.cpp | 8 ++++---- src/declarative/fx/qfximage.cpp | 2 +- src/declarative/fx/qfxlistview.cpp | 10 +++++----- src/gui/painting/qdrawutil.cpp | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/declarative/fx/qfxcomponentinstance.cpp b/src/declarative/fx/qfxcomponentinstance.cpp index 9645e77..472b98b 100644 --- a/src/declarative/fx/qfxcomponentinstance.cpp +++ b/src/declarative/fx/qfxcomponentinstance.cpp @@ -58,7 +58,7 @@ QML_DEFINE_TYPE(QFxComponentInstance,ComponentInstance); /*! \qmlclass ComponentInstance QFxComponentInstance - \brief The ComponentInstance item allows you to instantiate a \l{qml-component.html} {Component}. + \brief The ComponentInstance item allows you to instantiate a \l{Component}. \qml Item { diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 9e6f2c9..5156d06 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -689,10 +689,10 @@ QFxGridView::~QFxGridView() \qmlproperty model GridView::model This property holds the model providing data for the grid. - The model provides a set of data that is used to create the items for the view. - For large or dynamic datasets the model is usually provided by a C++ model object. - The C++ model object must be a \l QAbstractItemModel subclass, a \l VisualModel, - or a simple list. + The model provides a set of data that is used to create the items + for the view. For large or dynamic datasets the model is usually + provided by a C++ model object. The C++ model object must be a \l + {QAbstractItemModel} subclass, a VisualModel, or a simple list. */ QVariant QFxGridView::model() const { diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index e1ac2c7..dfd6915 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -185,7 +185,7 @@ void QFxImage::setPixmap(const QPixmap &pix) Each scale grid property (left, right, top, and bottom) specifies an offset from the respective side. For example, \c scaleGrid.bottom="10" sets the bottom scale grid line 10 pixels up from the bottom of the image. A scale grid can also be specified using a - \l {Image::src}{.sci file}. + \l {Image::source}{.sci file}. */ QFxScaleGrid *QFxImage::scaleGrid() { diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index bb71a91..fcd6e1f 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -858,12 +858,12 @@ QFxListView::~QFxListView() \qmlproperty model ListView::model This property holds the model providing data for the list. - The model provides a set of data that is used to create the items for the view. - For large or dynamic datasets the model is usually provided by a C++ model object. - The C++ model object must be a \l QAbstractItemModel subclass, a \l VisualModel, - or a simple list. + The model provides a set of data that is used to create the items + for the view. For large or dynamic datasets the model is usually + provided by a C++ model object. The C++ model object must be a \l + {QAbstractItemModel} subclass, a VisualModel, or a simple list. - Models can also be created directly in QML, using a \l ListModel. + Models can also be created directly in QML, using a \l{ListModel}. */ QVariant QFxListView::model() const { diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 230d30b..4020593 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1039,7 +1039,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, #endif /*! - \struct QMargins + \class QMargins \since 4.6 Holds the borders used to split a pixmap into nine segments in order to @@ -1050,7 +1050,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, */ /*! - \struct QTileRules + \class QTileRules \since 4.6 Holds the rules used to draw a pixmap or image split into nine segments, -- cgit v0.12 From 61f8c6f4d6af1a2e73c918b43da8f25871b254b7 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 22:14:50 +1000 Subject: Remove some XML'isms from the parser/compiler interface --- src/declarative/qml/qmlcompiler.cpp | 43 ++++++--------- src/declarative/qml/qmlcompiler_p.h | 1 - src/declarative/qml/qmlcustomparser.cpp | 2 +- src/declarative/qml/qmldom.cpp | 4 +- src/declarative/qml/qmlparser.cpp | 92 ++++++++++++++++++++++++++++++++- src/declarative/qml/qmlparser_p.h | 44 +++++++++++++++- src/declarative/qml/qmlscriptparser.cpp | 79 ++++++++++++---------------- 7 files changed, 183 insertions(+), 82 deletions(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index a40b7c8..c547d31 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -192,16 +192,6 @@ bool QmlCompiler::isValidId(const QString &val) return true; } -/*! - Returns true if \a str is a valid binding string, false otherwise. - - Valid binding strings are those enclosed in braces ({}). -*/ -bool QmlCompiler::isBinding(const QString &str) -{ - return str.startsWith(QLatin1Char('{')) && str.endsWith(QLatin1Char('}')); -} - /*! Returns true if property name \a name refers to an attached property, false otherwise. @@ -671,7 +661,7 @@ bool QmlCompiler::compileComponent(Object *obj, int ctxt) COMPILE_CHECK(compileComponentFromRoot(root, ctxt)); if (idProp && idProp->values.count()) { - QString val = idProp->values.at(0)->primitive; + QString val = idProp->values.at(0)->primitive(); if (!isValidId(val)) COMPILE_EXCEPTION("Invalid id property value"); @@ -766,13 +756,10 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) return rv; } else { - QString script = prop->values.at(0)->primitive.trimmed(); + QString script = prop->values.at(0)->value.asScript().trimmed(); if (script.isEmpty()) return true; - if (isBinding(script)) - COMPILE_EXCEPTION("Cannot assign binding to signal property"); - int idx = output->indexForString(script); int pr = output->indexForByteArray(prop->name); @@ -887,7 +874,7 @@ bool QmlCompiler::compileIdProperty(QmlParser::Property *prop, if (prop->values.count() == 1) { if (prop->values.at(0)->object) COMPILE_EXCEPTION("Cannot assign an object as an id"); - QString val = prop->values.at(0)->primitive; + QString val = prop->values.at(0)->primitive(); if (!isValidId(val)) COMPILE_EXCEPTION(val << "is not a valid id"); if (ids.contains(val)) @@ -1031,11 +1018,12 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, assign.assignObject.property = output->indexForByteArray(prop->name); assign.assignObject.castValue = 0; output->bytecode << assign; - } else if (isBinding(v->primitive)) { + } else if (v->value.isScript()) { if (assignedBinding) COMPILE_EXCEPTION("Can only assign one binding to lists"); - compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->location.start.line); + compileBinding(v->value.asScript(), prop, ctxt, + obj->metaObject(), v->location.start.line); v->type = Value::PropertyBinding; } else { COMPILE_EXCEPTION("Cannot assign primitives to lists"); @@ -1186,9 +1174,10 @@ bool QmlCompiler::compilePropertyLiteralAssignment(QmlParser::Property *prop, QmlParser::Value *v, int ctxt) { - if (isBinding(v->primitive)) { + if (v->value.isScript()) { - compileBinding(v->primitive, prop, ctxt, obj->metaObject(), v->location.start.line); + compileBinding(v->value.asScript(), prop, ctxt, obj->metaObject(), + v->location.start.line); v->type = Value::PropertyBinding; @@ -1199,8 +1188,9 @@ bool QmlCompiler::compilePropertyLiteralAssignment(QmlParser::Property *prop, bool doassign = true; if (prop->index != -1) { + QString value = v->primitive(); StoreInstructionResult r = - generateStoreInstruction(*output, assign, obj->metaObject()->property(prop->index), prop->index, -1, &v->primitive); + generateStoreInstruction(*output, assign, obj->metaObject()->property(prop->index), prop->index, -1, &value); if (r == Ok) { doassign = false; @@ -1208,10 +1198,10 @@ bool QmlCompiler::compilePropertyLiteralAssignment(QmlParser::Property *prop, //### we are restricted to a rather generic message here. If we can find a way to move // the exception into generateStoreInstruction we could potentially have better messages. // (the problem is that both compile and run exceptions can be generated, though) - COMPILE_EXCEPTION2(v, "Cannot assign value" << v->primitive << "to property" << obj->metaObject()->property(prop->index).name()); + COMPILE_EXCEPTION2(v, "Cannot assign value" << v->primitive() << "to property" << obj->metaObject()->property(prop->index).name()); doassign = false; } else if (r == ReadOnly) { - COMPILE_EXCEPTION2(v, "Cannot assign value" << v->primitive << "to the read-only property" << obj->metaObject()->property(prop->index).name()); + COMPILE_EXCEPTION2(v, "Cannot assign value" << v->primitive() << "to the read-only property" << obj->metaObject()->property(prop->index).name()); } else { doassign = true; } @@ -1226,7 +1216,7 @@ bool QmlCompiler::compilePropertyLiteralAssignment(QmlParser::Property *prop, output->indexForByteArray(prop->name); } assign.assignConstant.constant = - output->indexForString(v->primitive); + output->indexForString(v->primitive()); } output->bytecode << assign; @@ -1335,12 +1325,9 @@ bool QmlCompiler::compileDynamicMeta(QmlParser::Object *obj) return true; } -void QmlCompiler::compileBinding(const QString &str, QmlParser::Property *prop, +void QmlCompiler::compileBinding(const QString &bind, QmlParser::Property *prop, int ctxt, const QMetaObject *mo, qint64 line) { - Q_ASSERT(isBinding(str)); - - QString bind = str.mid(1, str.length() - 2).trimmed(); QmlBasicScript bs; bs.compile(bind.toLatin1()); diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index b885e7b..b122650 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -118,7 +118,6 @@ public: QList errors() const; static bool isValidId(const QString &); - static bool isBinding(const QString &); static bool isAttachedProperty(const QByteArray &); enum StoreInstructionResult { Ok, UnknownType, InvalidData, ReadOnly }; diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qmlcustomparser.cpp index 06035b0..e864df9 100644 --- a/src/declarative/qml/qmlcustomparser.cpp +++ b/src/declarative/qml/qmlcustomparser.cpp @@ -138,7 +138,7 @@ QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p) QmlCustomParserNode node = fromObject(v->object); prop.d->values << QVariant::fromValue(node); } else { - prop.d->values << QVariant::fromValue(v->primitive); + prop.d->values << QVariant::fromValue(v->primitive()); } } diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 4e754a3..09b4a3b 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -809,7 +809,7 @@ Rect { x: 10 } */ QString QmlDomValueLiteral::literal() const { - if (d->value) return d->value->primitive; + if (d->value) return d->value->primitive(); else return QString(); } @@ -878,7 +878,7 @@ Rect { x: Other.x } QString QmlDomValueBinding::binding() const { if (d->value) - return d->value->primitive.mid(1, d->value->primitive.length() - 2); + return d->value->value.asScript(); else return QString(); } diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 2bd41e2..bafdb02 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -233,14 +233,102 @@ void QmlParser::Value::dump(int indent) const case Value::Id: type = "Id"; break; - }; + } + + QByteArray primType; + switch(this->value.type()) { + default: + case Variant::Invalid: + primType = "Invalid"; + break; + case Variant::Boolean: + primType = "Boolean"; + break; + case Variant::Number: + primType = "Number"; + break; + case Variant::String: + primType = "String"; + break; + case Variant::Script: + primType = "Script"; + break; + } QByteArray ba(indent * 4, ' '); if (object) { qWarning() << ba.constData() << "Value (" << type << "):"; object->dump(indent + 1); } else { - qWarning() << ba.constData() << "Value (" << type << "):" << primitive; + qWarning() << ba.constData() << "Value (" << type << "):" << primType.constData() << primitive(); + } +} + +QmlParser::Variant::Variant() +: t(Invalid) {} + +QmlParser::Variant::Variant(const Variant &o) +: t(o.t), d(o.d), s(o.s) +{ +} + +QmlParser::Variant::Variant(bool v) +: t(Boolean), b(v) +{ +} + +QmlParser::Variant::Variant(double v) +: t(Number), d(v) +{ +} + +QmlParser::Variant::Variant(const QString &v, Type type) +: t(type), s(v) +{ + Q_ASSERT(type == String || type == Script); +} + +QmlParser::Variant &QmlParser::Variant::operator=(const Variant &o) +{ + t = o.t; + d = o.d; + s = o.s; + return *this; +} + +QmlParser::Variant::Type QmlParser::Variant::type() const +{ + return t; +} + +bool QmlParser::Variant::asBoolean() const +{ + return b; +} + +QString QmlParser::Variant::asString() const +{ + return s; +} + +double QmlParser::Variant::asNumber() const +{ + return d; +} + +QString QmlParser::Variant::asScript() const +{ + switch(type()) { + default: + case Invalid: + return QString(); + case Boolean: + return b?QLatin1String("true"):QLatin1String("false"); + case Number: + return QString::number(d); + case String: + case Script: + return s; } } diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 31f8702..d67690b 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -152,6 +152,45 @@ namespace QmlParser void dump(int = 0) const; }; + class Variant + { + public: + enum Type { + Invalid, + Boolean, + Number, + String, + Script + }; + + Variant(); + Variant(const Variant &); + Variant(bool); + Variant(double); + Variant(const QString &, Type = String); + Variant &operator=(const Variant &); + + Type type() const; + + bool isBoolean() const { return type() == Boolean; } + bool isNumber() const { return type() == Number; } + bool isString() const { return type() == String; } + bool isScript() const { return type() == Script; } + + bool asBoolean() const; + QString asString() const; + double asNumber() const; + QString asScript() const; + + private: + Type t; + union { + bool b; + double d; + }; + QString s; + }; + class Value : public QmlRefCount { public: @@ -180,8 +219,11 @@ namespace QmlParser }; Type type; + // ### Temporary + QString primitive() const { return value.asScript(); } + // Primitive value - QString primitive; + Variant value; // Object value Object *object; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 169e2ea..4de9e40 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -74,8 +74,8 @@ protected: AST::SourceLocation typeLocation, LocationSpan location, AST::UiObjectInitializer *initializer = 0); - QString getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr); - void defineProperty(const QString &propertyName, const LocationSpan &location, const QString &primitive); + + QmlParser::Variant getVariant(AST::ExpressionNode *expr); LocationSpan location(AST::SourceLocation start, AST::SourceLocation end); LocationSpan location(AST::UiQualifiedId *); @@ -305,15 +305,22 @@ Object *ProcessAST::defineObjectBinding(int line, QString propertyName = asString(scriptBinding->qualifiedId); if (propertyName == QLatin1String("script")) { QString script; + if (AST::ExpressionStatement *stmt = AST::cast(scriptBinding->statement)) { - script = getPrimitive("script", stmt->expression); + script = getVariant(stmt->expression).asScript(); } else { script = asString(scriptBinding->statement); } LocationSpan l = this->location(scriptBinding->statement->firstSourceLocation(), scriptBinding->statement->lastSourceLocation()); - defineProperty(QLatin1String("script"), l, script); + + _stateStack.pushProperty(QLatin1String("script"), l); + Value *value = new Value; + value->value = QmlParser::Variant(script); + value->location = l; + currentProperty()->addValue(value); + _stateStack.pop(); } else { accept(it->member); } @@ -342,16 +349,6 @@ LocationSpan ProcessAST::location(AST::SourceLocation start, AST::SourceLocation 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->location = location; - currentProperty()->addValue(value); - _stateStack.pop(); -} - // UiProgram: UiImportListOpt UiObjectMemberList ; bool ProcessAST::visit(AST::UiProgram *node) { @@ -436,7 +433,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) Value *value = new Value; value->location = location(node->expression->firstSourceLocation(), node->expression->lastSourceLocation()); - value->primitive = getPrimitive("value", node->expression); + value->value = getVariant(node->expression); property.defaultValue->values << value; } @@ -480,30 +477,25 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) return false; } -QString ProcessAST::getPrimitive(const QByteArray &propertyName, AST::ExpressionNode *expr) +QmlParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr) { - QString primitive; + QmlParser::Variant rv; - if (isSignalProperty(propertyName)) { - primitive = asString(expr); - } else if (propertyName == "id" && expr && expr->kind == AST::Node::Kind_IdentifierExpression) { - primitive = asString(expr); - } else if (AST::StringLiteral *lit = AST::cast(expr)) { + if (AST::StringLiteral *lit = AST::cast(expr)) { // hack: emulate weird XML feature that string literals are not quoted. //This needs to be fixed in the qmlcompiler once xml goes away. - primitive = lit->value->asString(); - } else if (expr->kind == AST::Node::Kind_TrueLiteral - || expr->kind == AST::Node::Kind_FalseLiteral - || expr->kind == AST::Node::Kind_NumericLiteral - ) { - primitive = asString(expr); + rv = QmlParser::Variant(lit->value->asString()); + } else if (expr->kind == AST::Node::Kind_TrueLiteral) { + rv = QmlParser::Variant(true); + } else if (expr->kind == AST::Node::Kind_FalseLiteral) { + rv = QmlParser::Variant(false); + } else if(AST::NumericLiteral *lit = AST::cast(expr)) { + rv = QmlParser::Variant(lit->value); } else { - // create a binding - primitive += QLatin1Char('{'); - primitive += asString(expr); - primitive += QLatin1Char('}'); + rv = QmlParser::Variant(asString(expr), QmlParser::Variant::Script); } - return primitive; + + return rv; } @@ -519,25 +511,18 @@ bool ProcessAST::visit(AST::UiScriptBinding *node) } Property *prop = currentProperty(); - QString primitive; + + QmlParser::Variant primitive; if (AST::ExpressionStatement *stmt = AST::cast(node->statement)) { - primitive = getPrimitive(prop->name, stmt->expression); - } else if (isSignalProperty(prop->name)) { - if (AST::Block *block = AST::cast(node->statement)) { - const int start = block->lbraceToken.offset + block->rbraceToken.length; - primitive += _contents.mid(start, block->rbraceToken.offset - start); - } else { - primitive += asString(node->statement); - } + primitive = getVariant(stmt->expression); } else { // do binding - primitive += QLatin1Char('{'); - primitive += asString(node->statement); - primitive += QLatin1Char('}'); + primitive = QmlParser::Variant(asString(node->statement), + QmlParser::Variant::Script); } Value *v = new Value; - v->primitive = primitive; + v->value = primitive; v->location = location(node->statement->firstSourceLocation(), node->statement->lastSourceLocation()); @@ -616,7 +601,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) Value *value = new Value; value->location = location(node->firstSourceLocation(), node->lastSourceLocation()); - value->primitive = source; + value->value = QmlParser::Variant(source); obj->getDefaultProperty()->addValue(value); } -- cgit v0.12 From ab8d845ac9f1397706f517fcc24ed4e1978ef259 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 22:27:22 +1000 Subject: Ensure negative numeric literals are not treated as bindings --- src/declarative/qml/qmlscriptparser.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 4de9e40..0cd52d9 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -479,23 +479,26 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) QmlParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr) { - QmlParser::Variant rv; - if (AST::StringLiteral *lit = AST::cast(expr)) { // hack: emulate weird XML feature that string literals are not quoted. //This needs to be fixed in the qmlcompiler once xml goes away. - rv = QmlParser::Variant(lit->value->asString()); + return QmlParser::Variant(lit->value->asString()); } else if (expr->kind == AST::Node::Kind_TrueLiteral) { - rv = QmlParser::Variant(true); + return QmlParser::Variant(true); } else if (expr->kind == AST::Node::Kind_FalseLiteral) { - rv = QmlParser::Variant(false); - } else if(AST::NumericLiteral *lit = AST::cast(expr)) { - rv = QmlParser::Variant(lit->value); + return QmlParser::Variant(false); + } else if (AST::NumericLiteral *lit = AST::cast(expr)) { + return QmlParser::Variant(lit->value); } else { - rv = QmlParser::Variant(asString(expr), QmlParser::Variant::Script); - } - return rv; + if (AST::UnaryMinusExpression *unaryMinus = AST::cast(expr)) { + if (AST::NumericLiteral *lit = AST::cast(unaryMinus->expression)) { + return QmlParser::Variant(-lit->value); + } + } + + return QmlParser::Variant(asString(expr), QmlParser::Variant::Script); + } } -- cgit v0.12 From da91e9315fb553cb22431a29318f4b006ffb1a42 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 May 2009 22:36:43 +1000 Subject: Remove outdated comment --- src/declarative/qml/qmlscriptparser.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 0cd52d9..082d0a5 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -480,8 +480,6 @@ bool ProcessAST::visit(AST::UiObjectBinding *node) QmlParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr) { if (AST::StringLiteral *lit = AST::cast(expr)) { - // hack: emulate weird XML feature that string literals are not quoted. - //This needs to be fixed in the qmlcompiler once xml goes away. return QmlParser::Variant(lit->value->asString()); } else if (expr->kind == AST::Node::Kind_TrueLiteral) { return QmlParser::Variant(true); -- cgit v0.12 From 70cd26cfaf24455ceea6cb698a88be694728030c Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 11 May 2009 15:02:34 +0200 Subject: Automatic semicolon insertion for property and signal definitions. --- src/declarative/qml/parser/javascript.g | 16 +- src/declarative/qml/parser/javascriptast_p.h | 11 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1029 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 12 +- src/declarative/qml/parser/javascriptparser.cpp | 396 ++++----- src/declarative/qml/parser/javascriptparser_p.h | 4 +- 6 files changed, 728 insertions(+), 740 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 474fbb3..48e8244 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -672,18 +672,21 @@ case $rule_number: { } break; ./ -UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER ; +UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; +UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_SEMICOLON ; /. case $rule_number: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); node->identifierToken = loc(3); + node->semicolonToken = loc(4); sym(1).Node = node; } break; ./ -UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER ; +UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_AUTOMATIC_SEMICOLON ; +UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_SEMICOLON ; /. case $rule_number: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval); @@ -692,11 +695,13 @@ case $rule_number: { node->propertyToken = loc(2); node->typeToken = loc(3); node->identifierToken = loc(4); + node->semicolonToken = loc(5); sym(1).Node = node; } break; ./ -UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression ; +UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_AUTOMATIC_SEMICOLON ; +UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_SEMICOLON ; /. case $rule_number: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, @@ -705,11 +710,13 @@ case $rule_number: { node->typeToken = loc(2); node->identifierToken = loc(3); node->colonToken = loc(4); + node->semicolonToken = loc(6); sym(1).Node = node; } break; ./ -UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression ; +UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_AUTOMATIC_SEMICOLON ; +UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_SEMICOLON ; /. case $rule_number: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval, @@ -720,6 +727,7 @@ case $rule_number: { node->typeToken = loc(3); node->identifierToken = loc(4); node->colonToken = loc(5); + node->semicolonToken = loc(7); sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index ad317e8..cd47e42 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -2345,15 +2345,7 @@ public: virtual SourceLocation lastSourceLocation() const { - if (expression) - return expression->lastSourceLocation(); - else if (colonToken.isValid()) - return colonToken; - else if (identifierToken.isValid()) - return identifierToken; - else if (typeToken.isValid()) - return typeToken; - return propertyToken; + return semicolonToken; } virtual void accept0(Visitor *visitor); @@ -2369,6 +2361,7 @@ public: SourceLocation typeToken; SourceLocation identifierToken; SourceLocation colonToken; + SourceLocation semicolonToken; }; class UiObjectDefinition: public UiObjectMember diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index 43422c6..abe3f1c 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -58,535 +58,525 @@ const int JavaScriptGrammar::lhs [] = { 91, 92, 92, 95, 95, 96, 96, 94, 93, 98, 98, 100, 100, 101, 101, 99, 97, 99, 99, 103, 104, 104, 99, 99, 106, 106, 106, 99, 99, 99, - 99, 99, 99, 99, 102, 102, 110, 110, 110, 102, - 102, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 113, 113, 117, 117, - 112, 112, 115, 115, 118, 118, 118, 118, 118, 118, + 99, 99, 99, 99, 99, 99, 99, 99, 102, 102, + 110, 110, 110, 102, 102, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 113, 113, 117, 117, 112, 112, 115, 115, 118, 118, + 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 120, 120, 121, 121, 121, 121, 121, 124, 124, - 125, 125, 125, 125, 123, 123, 126, 126, 127, 127, - 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, - 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, - 133, 134, 134, 134, 134, 134, 134, 135, 135, 135, - 135, 135, 136, 136, 136, 136, 136, 137, 137, 138, - 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, - 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, - 148, 116, 116, 149, 149, 150, 150, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 107, 107, 151, - 151, 152, 152, 153, 153, 105, 105, 105, 105, 105, + 119, 119, 119, 119, 119, 120, 120, 121, 121, 121, + 121, 121, 124, 124, 125, 125, 125, 125, 123, 123, + 126, 126, 127, 127, 128, 128, 128, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, + 130, 131, 131, 131, 132, 132, 132, 132, 133, 133, + 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, + 134, 135, 135, 135, 135, 135, 136, 136, 136, 136, + 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, + 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, + 146, 147, 147, 148, 148, 116, 116, 149, 149, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 107, 107, 151, 151, 152, 152, 153, 153, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 154, 169, 169, 168, 168, 109, 109, 170, 170, 171, - 171, 173, 173, 172, 174, 177, 175, 175, 178, 176, - 176, 155, 156, 156, 157, 157, 158, 158, 158, 158, - 158, 158, 158, 159, 159, 159, 159, 160, 160, 160, - 160, 161, 161, 162, 164, 179, 179, 182, 182, 180, - 180, 183, 181, 163, 163, 163, 165, 165, 166, 166, - 166, 184, 185, 167, 167, 108, 122, 189, 189, 186, - 186, 187, 187, 190, 191, 191, 192, 192, 188, 188, - 114, 114, 193}; + 105, 105, 105, 105, 154, 169, 169, 168, 168, 109, + 109, 170, 170, 171, 171, 173, 173, 172, 174, 177, + 175, 175, 178, 176, 176, 155, 156, 156, 157, 157, + 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, + 159, 160, 160, 160, 160, 161, 161, 162, 164, 179, + 179, 182, 182, 180, 180, 183, 181, 163, 163, 163, + 165, 165, 166, 166, 166, 184, 185, 167, 167, 108, + 122, 189, 189, 186, 186, 187, 187, 190, 191, 191, + 192, 192, 188, 188, 114, 114, 193}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 1, 2, 1, 3, 2, 3, 4, 2, 1, 5, 1, - 2, 2, 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, + 2, 2, 3, 3, 1, 1, 1, 2, 4, 4, + 5, 5, 6, 6, 7, 7, 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, 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, + 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, - 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, - 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, - 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, + 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 0, 1, 1, 3, 0, 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, 0, 9, 1, 0, 17, 33, 40, 238, 0, - 0, 37, 38, 14, 35, 36, 39, 239, 18, 10, - 0, 0, 0, 34, 0, 27, 26, 25, 0, 30, - 0, 141, 208, 172, 180, 176, 120, 192, 168, 32, - 105, 43, 121, 184, 188, 109, 138, 119, 124, 104, - 158, 145, 0, 49, 50, 46, 309, 37, 311, 61, - 0, 0, 0, 0, 0, 44, 47, 0, 0, 38, - 39, 48, 42, 0, 45, 0, 0, 134, 0, 0, - 121, 140, 123, 122, 0, 0, 0, 136, 137, 135, - 139, 0, 169, 0, 0, 0, 0, 159, 0, 0, - 0, 0, 0, 0, 149, 0, 0, 0, 143, 144, - 142, 147, 151, 150, 148, 146, 161, 160, 162, 0, - 177, 0, 173, 0, 0, 115, 102, 114, 103, 71, - 72, 73, 98, 74, 99, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 100, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 101, - 0, 0, 113, 209, 116, 0, 117, 0, 118, 112, - 0, 205, 198, 196, 203, 204, 202, 201, 207, 200, - 199, 197, 206, 193, 0, 181, 0, 0, 185, 0, - 0, 189, 0, 0, 115, 107, 0, 106, 0, 111, - 125, 0, 310, 300, 301, 0, 298, 0, 299, 0, - 302, 216, 223, 222, 230, 218, 0, 219, 303, 0, - 308, 220, 221, 226, 224, 305, 304, 307, 227, 0, - 0, 0, 0, 0, 309, 37, 0, 311, 38, 210, - 252, 39, 0, 0, 0, 0, 0, 228, 229, 217, - 225, 253, 254, 297, 306, 0, 268, 269, 270, 271, - 0, 264, 265, 266, 267, 294, 295, 0, 0, 0, - 0, 0, 257, 258, 214, 212, 174, 182, 178, 194, - 170, 215, 0, 121, 186, 190, 163, 152, 0, 0, - 171, 0, 0, 0, 0, 164, 0, 0, 0, 0, - 0, 156, 154, 157, 155, 153, 166, 165, 167, 0, - 179, 0, 175, 0, 213, 121, 0, 195, 210, 211, - 0, 210, 0, 0, 260, 0, 0, 0, 262, 0, - 183, 0, 0, 187, 0, 0, 191, 250, 0, 242, - 251, 245, 0, 249, 0, 210, 243, 0, 210, 0, - 0, 261, 0, 0, 0, 263, 310, 300, 0, 0, - 302, 0, 296, 0, 286, 0, 0, 0, 256, 0, - 255, 0, 312, 0, 70, 232, 235, 0, 71, 238, - 74, 99, 76, 77, 46, 81, 82, 37, 83, 86, - 44, 47, 38, 210, 39, 48, 89, 42, 91, 45, - 93, 94, 239, 96, 97, 101, 0, 63, 0, 0, - 65, 69, 67, 55, 66, 68, 0, 64, 54, 233, - 231, 109, 110, 115, 0, 108, 0, 285, 0, 272, - 273, 0, 284, 0, 0, 0, 275, 280, 278, 281, - 0, 0, 279, 280, 0, 276, 0, 277, 234, 283, - 0, 234, 282, 0, 287, 288, 0, 234, 289, 290, - 0, 0, 291, 0, 0, 0, 292, 293, 127, 126, - 0, 0, 0, 259, 0, 0, 0, 274, 0, 62, - 0, 59, 61, 52, 0, 58, 53, 60, 57, 51, - 0, 56, 131, 129, 133, 130, 128, 132, 0, 0, - 29, 0, 31, 28, 15, 11, 0, 0, 24, 37, - 61, 20, 0, 23, 16, 0, 12, 0, 19, 13, - 21, 22, 41, 247, 240, 0, 248, 244, 0, 246, - 236, 0, 237, 241, 313}; + 5, 0, 9, 1, 0, 17, 37, 44, 242, 0, + 0, 41, 42, 14, 39, 40, 43, 243, 18, 10, + 0, 0, 0, 38, 0, 27, 26, 25, 0, 0, + 31, 0, 32, 145, 212, 176, 184, 180, 124, 196, + 172, 0, 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, 35, 36, 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, 0, 29, 0, 30, 0, 33, + 34, 28, 15, 11, 0, 0, 24, 41, 65, 20, + 0, 23, 16, 0, 12, 0, 19, 13, 21, 22, + 45, 251, 244, 0, 252, 248, 0, 250, 240, 0, + 241, 245, 317}; const int JavaScriptGrammar::goto_default [] = { - 6, 5, 13, 1, 4, 3, 28, 30, 29, 525, - 15, 31, 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, - 535, 534, 348, 349, 537, 351, 536, 350, 446, 450, - 453, 449, 448, 468, 469, 215, 229, 211, 214, 228, - 236, 235, 0}; + 6, 5, 13, 1, 4, 3, 28, 30, 29, 533, + 15, 31, 530, 531, 389, 513, 230, 234, 263, 53, + 61, 494, 492, 387, 386, 44, 493, 385, 388, 139, + 57, 52, 177, 59, 48, 176, 54, 60, 89, 58, + 43, 63, 62, 300, 50, 294, 45, 290, 47, 292, + 46, 291, 55, 298, 56, 299, 49, 293, 289, 330, + 442, 295, 296, 225, 229, 231, 235, 236, 227, 226, + 238, 264, 237, 242, 261, 262, 228, 391, 390, 32, + 543, 542, 352, 353, 545, 355, 544, 354, 450, 454, + 457, 453, 452, 472, 473, 219, 233, 215, 218, 232, + 240, 239, 0}; const int JavaScriptGrammar::action_index [] = { - -10, -91, -42, -91, -1, 36, 71, 73, -91, -91, - -91, -17, -91, -91, 393, -91, -91, -91, -91, 17, - 208, 51, 197, -91, -91, -91, 30, -91, -91, -91, - 476, 102, 194, -91, 159, -91, -91, -91, 68, 82, - 723, 81, -91, 80, 60, 28, 175, -91, 327, 14, - -91, -91, 474, 18, 74, 165, 153, -91, -91, -91, - 353, 170, 723, -91, -91, -91, 158, -91, 1221, 5, - 723, 723, 723, 643, 723, -91, -91, 723, 723, -91, - -91, -91, -91, 723, -91, 723, 723, -91, 723, 723, - 111, 143, -91, -91, 723, 723, 723, -91, -91, -91, - 206, 723, 327, 723, 723, 723, 723, 373, 723, 723, - 723, 723, 723, 723, 207, 723, 723, 723, 91, 117, - 103, 254, 254, 254, 254, 254, 389, 343, 363, 723, - 21, 723, 0, 1134, 723, 723, -91, -91, -91, -91, + -23, -91, 10, -91, -19, 50, 77, 56, -91, -91, + -91, 67, -91, -91, 383, -91, -91, -91, -91, -4, + 213, 20, 186, -91, -91, -91, -18, -91, -91, -91, + 370, 129, 203, -91, 204, -91, -91, -91, -17, 192, + -91, 693, -91, 87, -91, 42, 9, -20, 191, -91, + 310, 140, -91, -91, 534, 17, 114, 160, 125, -91, + -91, -91, 344, 162, 693, -91, -91, -91, 157, -91, + 1191, 34, 693, 693, 693, 613, 693, -91, -91, 693, + 693, -91, -91, -91, -91, 693, -91, 693, 693, -91, + 693, 693, 119, 227, -91, -91, 693, 693, 693, -91, + -91, -91, 193, 693, 310, 693, 693, 693, 693, 446, + 693, 693, 693, 693, 693, 693, 237, 693, 693, 693, + 88, 106, 107, 237, 237, 166, 237, 237, 354, 372, + 334, 693, -11, 693, 19, 1104, 693, 693, -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, - 96, 723, -91, -91, 61, -2, -91, 723, -91, -91, - 723, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, 723, -14, 723, 723, 34, 33, - 723, -91, 1134, 723, 723, -91, 133, -91, -57, -91, - -91, -15, -91, 192, 49, 16, -91, 183, -91, 40, - 1482, -91, -91, -91, -91, -91, 205, -91, -91, 20, - -91, -91, -91, -91, -91, -91, 1482, -91, -91, 260, - 302, 100, 1395, 52, 198, 67, 41, 1656, 53, 723, - -91, 54, 27, 723, 29, 31, 32, -91, -91, -91, - -91, -91, -91, -91, -91, 108, -91, -91, -91, -91, - 89, -91, -91, -91, -91, -91, -91, 62, 59, 723, - 125, 116, -91, -91, 1047, -91, 84, 43, -52, -91, - 267, 48, -44, 564, 10, 113, 320, 254, 169, 723, - 269, 723, 723, 723, 723, 293, 723, 723, 723, 723, - 723, 166, 120, 146, 154, 254, 395, 324, 274, 723, - -73, 723, 24, 723, -91, 430, 723, -91, 723, 42, - -7, 723, -19, 1395, -91, 723, 122, 1395, -91, 723, - -20, 723, 723, 25, 26, 723, -91, 22, 115, 7, - -91, -91, 723, -91, 224, 723, -91, 55, 723, -28, - 1395, -91, 723, 86, 1395, -91, 6, 233, -25, 4, - 1482, -26, -91, 1395, -91, 723, 114, 1395, 15, 1395, - -91, 23, 35, -6, -91, -91, 1395, -4, 272, 45, - 275, 87, 723, 1395, 46, 12, 241, 37, 11, 643, - 38, 39, -91, 807, -91, 1, -29, 2, 723, 3, - -27, 723, -3, 723, -36, 19, 723, -91, 1308, -5, - -91, -91, -91, -91, -91, -91, 723, -91, -91, -91, - -91, 171, -91, 723, -41, -91, 1395, -91, 78, -91, - -91, 1395, -91, 723, 112, -9, -91, 105, -91, 13, - 101, 723, -91, 9, 8, -91, 47, -91, 1395, -91, - 93, 1395, -91, 167, -91, -91, 107, 1395, 66, -91, - 57, 70, -91, 173, 69, 72, -91, -91, -91, -91, - 723, 106, 1395, -91, 723, 99, 1395, -91, 104, 56, - 967, -91, 58, -91, 887, -91, -91, -91, -91, -91, - 188, -91, -91, -91, -91, -91, -91, -91, 44, 50, - 63, 723, 64, -91, -91, -91, 1569, 217, -91, 85, - 90, -91, 75, -91, -91, 88, -91, -18, -91, -91, - -91, -91, -91, 65, -91, 195, -91, -91, 723, -91, - -91, 185, -91, -91, -91, + -91, -91, 98, 693, -91, -91, 0, -43, -91, 693, + -91, -91, -91, -91, 693, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, 693, 6, + 693, 693, -2, 82, 693, -91, 1104, 693, 693, -91, + 96, -91, 8, -91, -91, 61, -91, 147, 80, 33, + -91, 154, -91, 63, 1452, -91, -91, -91, -91, -91, + 169, -91, -91, 23, -91, -91, -91, -91, -91, -91, + 1452, -91, -91, 285, 287, 68, 1365, 55, 112, 79, + 46, 1626, 66, 693, -91, 65, 47, 693, 52, 58, + 59, -91, -91, -91, -91, -91, -91, -91, -91, 64, + -91, -91, -91, -91, 73, -91, -91, -91, -91, -91, + -91, -5, 45, 693, 137, 81, -91, -91, 1017, -91, + 69, 28, 14, -91, 240, 76, 53, 476, 171, 120, + 308, 237, 180, 693, 264, 693, 693, 693, 693, 298, + 693, 693, 693, 693, 693, 230, 237, 237, 237, 237, + 288, 268, 378, 693, -68, 693, 12, 693, -91, 445, + 693, -91, 693, 7, -47, 693, -44, 1365, -91, 693, + 100, 1365, -91, 693, -25, 693, 693, 22, 15, 693, + -91, -8, 108, -13, -91, -91, 693, -91, 178, 693, + -91, -60, 693, -58, 1365, -91, 693, 99, 1365, -91, + -33, 199, -53, -27, 1452, -26, -91, 1365, -91, 693, + 95, 1365, 32, 1365, -91, 43, 41, 4, -91, -91, + 1365, 5, 232, 54, 275, 70, 693, 1365, 49, 27, + 252, 48, 30, 613, 40, 39, -91, 777, -91, 25, + -1, 26, 693, 24, -3, 693, 21, 693, 1, 2, + 693, -91, 1278, 37, -91, -91, -91, -91, -91, -91, + 693, -91, -91, -91, -91, 156, -91, 693, -21, -91, + 1365, -91, 60, -91, -91, 1365, -91, 693, 102, 3, + -91, 29, -91, 35, 101, 693, -91, 36, 38, -91, + -30, -91, 1365, -91, 94, 1365, -91, 176, -91, -91, + 143, 1365, 44, -91, 16, -6, -91, 207, -9, -29, + -91, -91, -91, -91, 693, 90, 1365, -91, 693, 91, + 1365, -91, 111, 13, 857, -91, 18, -91, 937, -91, + -91, -91, -91, -91, 105, -91, -91, -91, -91, -91, + -91, -91, -33, -24, 215, -91, 693, -91, 187, -91, + -91, -91, -91, -91, 1539, 174, -91, 133, 104, -91, + 62, -91, -91, 97, -91, 51, -91, -91, -91, -91, + -91, 57, -91, 173, -91, -91, 693, -91, -91, 151, + -91, -91, -91, - -103, -103, -103, -103, 34, 37, -103, -103, -103, -103, - -103, -103, -103, -103, 202, -103, -103, -103, -103, -103, - 39, -103, -103, -103, -103, -103, -103, -103, -103, -103, - 319, -103, 4, -103, 33, -103, -103, -103, -103, -103, - 44, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -58, -103, -103, -103, -103, -103, -103, -103, - -103, -103, 157, -103, -103, -103, -2, -103, -103, -103, - -3, 132, 136, 150, 137, -103, -103, 140, 15, -103, - -103, -103, -103, 112, -103, 120, 125, -103, 123, 145, - -103, -103, -103, -103, 116, 149, 163, -103, -103, -103, - -103, 146, -103, 152, 155, 65, 82, -103, 86, 85, - 108, 84, 58, 67, -103, 76, 74, 75, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, 98, - -103, 95, -103, 68, 36, 29, -103, -103, -103, -103, + -103, -103, -103, -103, 15, 16, -103, -103, -103, -103, + -103, -103, -103, -103, 208, -103, -103, -103, -103, -103, + -1, -103, -103, -103, -103, -103, -103, -103, -103, -103, + 237, -103, 26, -103, 31, -103, -103, -103, -103, -103, + -103, 28, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -46, -103, -103, -103, -103, -103, + -103, -103, -103, -103, 98, -103, -103, -103, 7, -103, + -103, -103, -10, 118, 111, 67, 112, -103, -103, 119, + 123, -103, -103, -103, -103, 124, -103, 115, 97, -103, + 32, 106, -103, -103, -103, -103, 128, 171, 101, -103, + -103, -103, -103, 156, -103, 157, 159, 81, 131, -103, + 127, 136, 145, 139, 102, 91, -103, 59, 50, 72, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, 70, -103, 80, -103, 85, 61, 51, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, 54, -103, -103, -103, -103, -103, -24, + -103, -103, -103, -103, -23, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, 134, -103, + 138, 17, -103, -103, 23, -103, 255, -4, 73, -103, + -103, -103, -103, -103, -103, -103, -103, 11, -103, -103, + -103, 8, -103, -103, 9, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + 77, -103, -103, 10, 2, -103, 5, -103, -3, -103, + -103, -103, -103, 19, -103, -103, -103, 27, -31, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, 1, -103, -103, -103, -103, -103, -9, -103, -103, - -20, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, 56, -103, 57, -17, -103, -103, - 46, -103, 222, 40, 59, -103, -103, -103, -103, -103, - -103, -103, -103, 51, -103, -103, -103, 38, -103, -103, - 32, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, 66, -103, -103, 19, - 11, -103, 18, -103, 16, -103, -103, -103, -103, 63, - -103, -103, -103, 60, -13, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -10, - -103, -103, -103, -103, 119, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, 14, 211, - -103, 203, 189, 199, 195, -103, 87, 94, 96, 102, - 106, -103, -103, -103, -103, -103, -103, -103, -103, 188, - -103, 166, -103, 170, -103, -103, 176, -103, 79, -103, - -103, 117, -103, 41, -103, 25, -103, 28, -103, 167, - -103, 174, 168, -103, -103, 164, -103, -103, -103, -103, - -103, -103, 207, -103, 70, 97, -103, -103, 69, -103, - 35, -103, 31, -103, 26, -103, -103, 71, -103, -103, - 83, -103, -103, 13, -103, 9, -103, 17, -103, 23, - -103, -103, -103, -103, -103, -103, 45, -103, 54, -103, - 55, -103, 81, 53, -103, -103, 50, -103, -103, 72, - -103, -103, -103, 62, -103, -103, -103, -103, 49, -103, - -19, 224, -103, 160, -103, -103, 43, -103, 48, -103, - -103, -103, -103, -103, -103, -103, -23, -103, -103, -103, - -103, -103, -103, 139, -103, -103, -5, -103, -103, -103, - -103, 7, -103, -6, -103, -103, -103, -103, -103, -78, - -103, -4, -103, -71, -103, -103, -103, -103, -77, -103, - -103, -55, -103, -103, -103, -103, -103, -103, -83, -103, - -103, -43, -103, 0, -103, -59, -103, -103, -103, -103, - -1, -103, 90, -103, 8, -103, -7, -103, -103, -103, - -22, -103, 42, -103, 47, -103, -103, -103, -103, -103, + -103, -103, -103, -5, -103, -103, -103, -103, 105, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, 61, -103, -103, -103, -103, 52, 10, -103, 24, - 30, -103, -103, -103, -103, -103, -103, 22, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, 20, -103, - -103, 64, -103, -103, -103}; + -103, -103, 34, 205, -103, 193, 169, 181, 201, -103, + 147, 66, 78, 79, 89, -103, -103, -103, -103, -103, + -103, -103, -103, 202, -103, 192, -103, 212, -103, -103, + 182, -103, 68, -103, -103, 62, -103, 56, -103, 33, + -103, 55, -103, 170, -103, 161, 162, -103, -103, 172, + -103, -103, -103, -103, -103, -103, 211, -103, 69, 71, + -103, -103, 64, -103, 60, -103, 41, -103, 42, -103, + -103, 74, -103, -103, 75, -103, -103, 38, -103, 35, + -103, 36, -103, 44, -103, -103, -103, -103, -103, -103, + 52, -103, 45, -103, 43, -103, 65, 46, -103, -103, + 40, -103, -103, 146, -103, -103, -103, 49, -103, -103, + -103, -103, 47, -103, -22, 149, -103, 153, -103, -103, + 30, -103, 48, -103, -103, -103, -103, -103, -103, -103, + 29, -103, -103, -103, -103, -103, -103, 133, -103, -103, + 53, -103, -103, -103, -103, 58, -103, 57, -103, -103, + -103, -103, -103, -56, -103, -6, -103, -82, -103, -103, + -103, -103, -77, -103, -103, -68, -103, -103, -103, -103, + -103, -103, -90, -103, -103, -58, -103, -11, -103, -60, + -103, -103, -103, -103, 21, -103, 25, -103, 22, -103, + 20, -103, -103, -103, 6, -103, 12, -103, 3, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, 24, -103, -103, -103, + -103, -103, -103, -103, 1, -2, -103, 4, 104, -103, + -103, -103, -103, -103, -103, 18, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, 0, -103, -103, 63, + -103, -103, -103}; const int JavaScriptGrammar::action_info [] = { - 480, 101, 426, 209, -95, 321, 467, 443, -68, -90, - -92, 11, 339, 491, 451, 458, 14, 328, 451, 435, - 194, 213, 171, 7, 447, 299, 321, 339, 319, 372, - 416, 379, 360, 345, 129, 369, 194, 370, 362, 352, - 200, 333, 367, 418, -65, -87, -69, 375, 284, 428, - 171, 430, -98, -79, 331, 484, 323, 217, 179, 513, - 436, 441, 467, 443, 497, 11, 491, 480, 484, 177, - 511, 544, 171, 220, 373, 263, 219, 375, 2, 510, - 367, 101, 538, 34, 14, 299, 471, 2, 284, 40, - 0, 319, 373, 473, 171, 279, 527, 39, 491, 131, - 461, 171, 457, 467, 171, 467, 131, 171, 129, 516, - 451, 454, 492, 470, 171, 0, 358, 517, 14, 11, - 171, 88, 171, 354, 196, 0, 0, 471, 197, 475, - 171, 88, 89, 171, 9, 8, 531, 530, 278, 440, - 439, 171, 89, 88, 528, 115, 364, 116, 276, 275, - 274, 273, 172, 92, 89, 94, 455, 88, 117, 486, - 493, 276, 275, 341, 93, 94, 482, 342, 89, 269, - 268, 115, 445, 116, 377, 171, 355, 283, 282, 115, - 202, 116, 337, 0, 117, 281, 202, 67, 35, 207, - 133, 115, 117, 116, 0, 115, 171, 116, 67, 203, - 95, 204, 67, 541, 117, 203, 96, 433, 117, 134, - 95, 135, 67, 171, 67, 0, 96, 0, 94, 0, - 0, 67, 0, 67, 79, 80, 35, 67, 465, 464, - 0, 0, 115, 37, 116, 79, 80, 67, 0, 79, - 80, 0, 0, 0, 36, 117, 67, 0, 501, 79, - 80, 79, 80, 67, 0, 0, 542, 540, 79, 80, - 79, 80, 67, 95, 79, 80, 262, 261, 0, 96, - 67, 37, 0, 0, 79, 80, 0, -309, 0, 115, - 0, 116, 36, 79, 80, 301, 302, 301, 302, 67, - 79, 80, 117, 0, 0, 0, 0, 306, 307, 79, - 80, 67, 0, 0, 67, 0, 308, 79, 80, 309, - 0, 310, 303, 304, 303, 304, 306, 307, 0, 0, - 0, 267, 266, 0, 0, 308, 79, 80, 309, 0, - 310, 67, 0, 267, 266, 0, 272, 271, 79, 80, - 0, 79, 80, 306, 307, 103, 104, 306, 307, 0, - 0, 0, 308, 0, 0, 309, 308, 310, 0, 309, - 0, 310, 0, 272, 271, 0, 108, 109, 79, 80, - 0, 0, 105, 106, 110, 111, 108, 109, 112, 0, - 113, 0, 0, 0, 110, 111, 108, 109, 112, 0, - 113, 0, 0, 0, 110, 111, 108, 109, 112, 0, - 113, 0, 0, 19, 110, 111, 0, 0, 112, 0, - 113, 0, 108, 109, 0, 20, 0, 0, 306, 307, - 110, 111, 21, 0, 112, 0, 113, 308, 0, 0, - 309, 0, 310, 181, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 182, 0, 0, 0, 183, 23, 0, - 0, 0, 25, 0, 0, 0, 184, 0, 185, 22, - 26, 0, 0, 0, 0, 0, 0, 27, 0, 186, - 0, 187, 92, 0, 0, 0, 18, 181, 24, 188, - 0, 0, 189, 93, 0, 0, 19, 182, 190, 0, - 0, 183, 0, 0, 191, 0, 0, 0, 20, 0, - 184, 0, 185, 0, 0, 21, 0, 0, 0, 192, - 0, 0, 0, 186, 0, 187, 92, 0, 0, 0, - 0, 0, 0, 188, 0, 0, 189, 93, 0, 0, - 0, 514, 190, 0, 0, 25, 0, 0, 191, 0, - 0, 0, 22, 26, 0, 0, 0, 0, 0, 0, - 27, 0, 0, 192, 0, 0, 0, 0, 0, 18, - 0, 24, 0, 0, 0, 0, 0, 181, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, - 0, 183, 0, 0, 0, 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, + 198, 362, 364, 371, 471, 514, 374, 373, 179, 356, + 325, 521, 39, 303, 335, 173, 337, 181, 366, 198, + 103, 501, 349, 323, 343, 461, 495, 471, -99, 376, + 471, -96, -72, -94, 455, 447, 451, 484, 488, 439, + 455, 455, 495, 103, 430, 462, -73, -91, 383, 422, + 420, 479, 477, 14, 131, -69, -83, 131, 133, 432, + 434, -102, 34, 288, 475, 2, 379, 133, 213, 2, + 303, 282, 445, 440, 546, 7, 323, 552, 267, 11, + 11, 283, 379, 447, 327, 471, 377, 0, 221, 204, + 0, 288, 325, 223, 484, 488, 224, 217, 173, 173, + 14, 465, 173, 173, 173, 535, 173, 173, 173, 0, + 173, 458, 495, 173, 332, 0, 358, 9, 8, 496, + 0, 444, 443, 539, 538, 273, 272, 90, 90, 280, + 279, 280, 279, 11, 278, 277, 524, 96, 91, 91, + 377, 69, 287, 286, 525, 173, 90, 90, 173, 474, + 486, 490, 211, 536, 174, 381, 459, 91, 91, 368, + 341, 94, 449, 475, 200, 505, 14, 497, 201, 359, + 345, 206, 95, 343, 346, 206, 69, 173, 81, 82, + 69, 549, 97, 69, 173, 0, 69, 117, 98, 118, + 207, 117, 437, 118, 207, 173, 208, 285, 0, 41, + 119, 183, 182, 69, 119, 96, 135, 69, 0, 69, + 0, 0, 0, 81, 82, 35, 0, 81, 82, 0, + 81, 82, 516, 81, 82, 136, 0, 137, 69, 0, + 266, 265, 69, 35, 550, 548, 69, 469, 468, 96, + 81, 82, 69, 0, 81, 82, 81, 82, 520, 519, + 97, 0, 0, 42, 40, 117, 98, 118, 305, 306, + 37, 69, 117, 0, 118, 81, 82, 0, 119, 81, + 82, 36, 0, 81, 82, 119, 517, 515, 37, 81, + 82, 69, 305, 306, 97, 307, 308, 0, -313, 36, + 98, 310, 311, 271, 270, 0, 0, 0, 81, 82, + 312, 0, 0, 313, 69, 314, 0, 0, 0, 307, + 308, 310, 311, 0, 69, 0, 69, 0, 81, 82, + 312, 310, 311, 313, 0, 314, 0, 0, 105, 106, + 312, 310, 311, 313, 0, 314, 276, 275, 0, 0, + 312, 81, 82, 313, 0, 314, 271, 270, 276, 275, + 0, 81, 82, 81, 82, 107, 108, 110, 111, 0, + 0, 0, 0, 0, 0, 112, 113, 110, 111, 114, + 0, 115, 0, 0, 0, 112, 113, 110, 111, 114, + 19, 115, 0, 0, 0, 112, 113, 0, 0, 114, + 0, 115, 20, 19, 0, 110, 111, 0, 0, 21, + 0, 310, 311, 112, 113, 20, 0, 114, 0, 115, + 312, 0, 21, 313, 0, 314, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 522, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 22, 26, 23, 0, + 0, 0, 25, 0, 27, 0, 0, 0, 185, 22, + 26, 0, 0, 18, 0, 24, 0, 27, 186, 0, + 0, 0, 187, 0, 0, 0, 18, 0, 24, 110, + 111, 188, 0, 189, 0, 0, 0, 112, 113, 185, + 0, 114, 0, 115, 190, 0, 191, 94, 0, 186, + 0, 0, 0, 187, 192, 0, 0, 193, 95, 0, + 0, 0, 188, 194, 189, 0, 0, 339, 0, 195, + 0, 0, 0, 0, 0, 190, 0, 191, 94, 0, + 0, 0, 0, 0, 196, 192, 0, 0, 193, 95, + 0, 0, 0, 0, 194, 0, 0, 185, 0, 0, + 195, 0, 0, 0, 0, 0, 0, 186, 0, 0, + 0, 187, 0, 0, 0, 196, 0, 0, 0, 0, + 188, 0, 189, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 190, 0, 191, 94, 0, 0, 0, + 0, 0, 0, 192, 0, 0, 193, 95, 0, 0, + 0, 0, 194, 0, 0, 0, 0, 0, 195, 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, 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, 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, -88, 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, 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, + 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, + 0, 0, 69, 0, 0, 0, 70, 71, 0, 72, + 0, 0, 0, 0, 0, 0, 75, 0, 0, 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, 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, 83, 81, + 82, 0, 84, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 77, 86, 67, 0, 0, 0, 0, + 0, 0, 0, 0, 64, 65, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, + 0, 0, 69, 0, 0, 0, 70, 71, 0, 72, + 0, 0, 0, 73, 0, 74, 75, 76, 0, 0, + 78, 0, 0, 0, 79, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, + 82, 0, 84, 0, 85, 0, 87, 0, 88, 0, + 0, 0, 0, 77, 86, 67, 0, 0, 0, 0, + 0, 0, 0, 0, -92, 0, 0, 0, 64, 65, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, + 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, + 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, + 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, + 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, + 80, 0, 0, 503, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, + 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, + 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, + 80, 0, 0, 500, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, + 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, + 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, + 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, + 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, + 87, 302, 88, 0, 0, 0, 0, 77, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, + 143, 0, 0, 145, 147, 148, 0, 0, 149, 0, + 150, 0, 0, 0, 152, 153, 154, 0, 0, 0, + 0, 0, 0, 69, 155, 156, 157, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 158, 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, 161, 0, 0, 0, 0, 0, 0, + 81, 82, 162, 163, 164, 0, 166, 167, 168, 169, + 170, 171, 0, 0, 159, 165, 151, 144, 146, 160, + 0, 0, 0, 0, 0, 141, 142, 143, 0, 0, + 145, 147, 148, 0, 0, 149, 0, 150, 0, 0, + 0, 152, 153, 154, 0, 0, 0, 0, 0, 0, + 424, 155, 156, 157, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 158, 0, 0, 0, 425, 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, 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, -234, 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, + 161, 0, 0, 0, 0, 0, 429, 426, 428, 162, + 163, 164, 0, 166, 167, 168, 169, 170, 171, 0, + 0, 159, 165, 151, 144, 146, 160, 0, 0, 0, + 0, 0, 141, 142, 143, 0, 0, 145, 147, 148, + 0, 0, 149, 0, 150, 0, 0, 0, 152, 153, + 154, 0, 0, 0, 0, 0, 0, 424, 155, 156, + 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 158, 0, 0, 0, 425, 0, 0, 0, 0, + 0, 0, 0, 427, 0, 0, 0, 161, 0, 0, + 0, 0, 0, 429, 426, 428, 162, 163, 164, 0, + 166, 167, 168, 169, 170, 171, 0, 0, 159, 165, + 151, 144, 146, 160, 0, 0, 0, 0, 0, 243, + 0, 0, 0, 0, 244, 0, 64, 65, 66, 246, + 0, 0, 0, 0, 0, 0, 247, 68, 0, 0, + 0, 0, 0, 0, 249, 250, 0, 0, 251, 71, + 0, 72, 0, 0, 0, 73, 0, 74, 75, 76, + 0, 0, 78, 0, 0, 0, 79, 0, 80, 0, + 0, 0, 0, 0, 253, 0, 254, 0, 0, 0, + 83, 252, 255, 256, 84, 257, 85, 258, 87, 27, + 88, 259, 260, 0, 0, 77, 86, 67, 18, 245, + 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, + 0, 244, 0, 64, 65, 66, 246, 0, 0, 0, + 0, 0, 0, 247, 248, 0, 0, 0, 0, 0, + 0, 249, 250, 0, 0, 251, 71, 0, 72, 0, + 0, 0, 73, 0, 74, 75, 76, 0, 0, 78, + 0, 0, 0, 79, 0, 80, 0, 0, 0, 0, + 0, 253, 0, 254, 0, 0, 0, 83, 252, 255, + 256, 84, 257, 85, 258, 87, 27, 88, 259, 260, + 0, 0, 77, 86, 67, 18, 245, 0, 0, 0, + 0, 0, 0, 243, 0, 0, 0, 0, 244, 0, + 64, 65, 66, 246, 0, 0, 0, 0, 0, 0, + 247, 68, 0, 0, 0, 0, 0, 0, 527, 250, + 0, 0, 251, 528, 0, 72, 0, 0, 0, 73, + 0, 74, 75, 76, 0, 0, 78, 0, 0, 0, + 79, 0, 80, 0, 0, 0, 0, 0, 253, 0, + 254, 0, 0, 0, 83, 252, 255, 256, 84, 257, + 85, 258, 87, 27, 88, 259, 260, 0, 0, 77, + 86, 67, 18, 245, 0, 529, 0, 0, 0, 0, + 392, 142, 143, 0, 0, 394, 147, 396, 65, 66, + 397, 0, 150, 0, 0, 0, 152, 399, 400, 0, + 0, 0, 0, 0, 0, 401, 402, 156, 157, 251, + 71, 0, 72, 0, 0, 0, 73, 0, 74, 403, + 76, 0, 0, 405, 0, 0, 0, 79, 0, 80, + 0, -238, 0, 0, 0, 407, 0, 254, 0, 0, + 0, 409, 406, 408, 410, 411, 412, 85, 414, 415, + 416, 417, 418, 419, 0, 0, 404, 413, 398, 393, + 395, 160, 0, 0, 0, 0, 0, - 459, 180, 427, 498, 476, 193, 280, 487, 199, 437, - 444, 472, 460, 500, 452, 481, 178, 212, 456, 474, - 477, 442, 462, 533, 485, 376, 173, 374, 529, 532, - 270, 378, 277, 347, 524, 366, 526, 380, 265, 10, - 365, 336, 338, 12, 466, 539, 237, 363, 38, 361, - 466, 90, 170, 506, 176, 334, 206, 218, 508, 429, - 49, 0, 0, 494, 0, 463, 518, 277, 417, 212, - 216, 201, 495, 265, 270, 419, 463, 512, 329, 329, - 237, 0, 0, 533, 176, 329, 0, 136, 0, 347, - 216, 208, 90, 90, 90, 329, 138, 237, 0, 124, - 0, 90, 431, 90, 483, 432, 195, 127, 125, 198, - 90, 90, 90, 329, 119, 120, 118, 90, 90, 210, - 90, 90, 90, 90, 128, 123, 121, 114, 311, 359, - 90, 90, 90, 329, 90, 312, 0, 313, 90, 330, - 0, 132, 90, 314, 90, 543, 130, 315, 90, 122, - 507, 0, 90, 356, 97, 293, 90, 357, 478, 90, - 297, 90, 91, 479, 176, 0, 368, 264, 90, 0, - 502, 434, 90, 90, 503, 504, 90, 332, 505, 371, - 431, 90, 90, 432, 100, 90, 0, 98, 90, 0, - 102, 90, 0, 90, 107, 210, 90, 126, 479, 90, - 325, 99, 90, 90, 325, 297, 325, 297, 297, 297, - 90, 297, 325, 322, 0, 297, 0, 297, 340, 16, - 33, 17, 346, 0, 90, 90, 344, 343, 324, 297, - 297, 90, 316, 0, 327, 90, 297, 320, 318, 90, - 297, 136, 317, 325, 297, 0, 305, 90, 297, 0, - 138, 205, 297, 0, 0, 0, 300, 0, 0, 0, - 90, 0, 478, 0, 0, 353, 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, + 463, 180, 197, 480, 476, 481, 504, 460, 478, 466, + 464, 284, 210, 184, 532, 526, 370, 540, 512, 281, + 10, 274, 12, 241, 537, 547, 216, 222, 499, 269, + 220, 502, 470, 498, 491, 333, 456, 485, 489, 487, + 518, 470, 203, 467, 51, 541, 38, 0, 205, 340, + 382, 380, 378, 351, 431, 421, 369, 367, 384, 216, + 281, 0, 274, 467, 269, 333, 433, 441, 92, 342, + 338, 93, 446, 448, 365, 423, 178, 172, 333, 175, + 333, 0, 541, 0, 333, 0, 92, 333, 351, 241, + 121, 241, 0, 220, 0, 92, 0, 435, 178, 120, + 436, 92, 92, 214, 138, 212, 92, 316, 92, 0, + 534, 0, 122, 140, 92, 92, 92, 92, 132, 317, + 318, 0, 336, 129, 363, 92, 134, 92, 334, 0, + 319, 361, 127, 92, 92, 483, 214, 92, 92, 101, + 0, 297, 92, 126, 551, 102, 301, 92, 92, 507, + 508, 92, 360, 482, 92, 92, 506, 509, 178, 92, + 92, 510, 511, 92, 92, 438, 99, 92, 116, 372, + 92, 375, 92, 130, 92, 92, 435, 123, 268, 436, + 125, 92, 0, 92, 199, 92, 124, 482, 315, 92, + 202, 483, 92, 92, 0, 92, 0, 92, 329, 109, + 104, 128, 301, 301, 0, 92, 92, 92, 329, 100, + 301, 301, 320, 301, 347, 0, 0, 92, 329, 0, + 348, 344, 301, 301, 321, 16, 33, 17, 92, 92, + 350, 0, 0, 301, 301, 0, 309, 92, 92, 326, + 331, 92, 301, 301, 322, 523, 301, 329, 329, 0, + 304, 324, 301, 301, 16, 33, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, + 328, 0, 0, 0, 138, 0, 0, 0, 0, 0, + 0, 0, 0, 140, 209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 515, 0, 0, - 0, 0, 0, 0, 0, 0, 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, 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, 0, 0, 0, 0, - 0, 0}; + 0, 0, 0, 0, 0, 0, 0, 0}; const int JavaScriptGrammar::action_check [] = { - 36, 1, 7, 60, 7, 78, 33, 36, 7, 7, - 7, 29, 2, 8, 5, 7, 33, 61, 5, 60, - 2, 36, 8, 65, 33, 1, 78, 2, 48, 55, - 7, 16, 60, 7, 48, 60, 2, 33, 31, 17, - 7, 60, 36, 8, 7, 7, 7, 36, 36, 55, - 8, 55, 7, 7, 61, 36, 8, 8, 60, 29, - 7, 7, 33, 36, 8, 29, 8, 36, 36, 8, - 7, 0, 8, 33, 7, 55, 60, 36, 88, 29, - 36, 1, 17, 66, 33, 1, 20, 88, 36, 7, - -1, 48, 7, 36, 8, 36, 8, 29, 8, 78, - 7, 8, 55, 33, 8, 33, 78, 8, 48, 7, - 5, 10, 8, 6, 8, -1, 61, 15, 33, 29, - 8, 40, 8, 8, 50, -1, -1, 20, 54, 60, - 8, 40, 51, 8, 61, 62, 61, 62, 76, 61, - 62, 8, 51, 40, 56, 25, 60, 27, 61, 62, - 61, 62, 56, 42, 51, 12, 55, 40, 38, 60, - 56, 61, 62, 50, 53, 12, 60, 54, 51, 61, - 62, 25, 60, 27, 60, 8, 61, 61, 62, 25, - 15, 27, 60, -1, 38, 60, 15, 29, 29, 56, - 15, 25, 38, 27, -1, 25, 8, 27, 29, 34, - 57, 36, 29, 8, 38, 34, 63, 36, 38, 34, - 57, 36, 29, 8, 29, -1, 63, -1, 12, -1, - -1, 29, -1, 29, 66, 67, 29, 29, 61, 62, - -1, -1, 25, 74, 27, 66, 67, 29, -1, 66, - 67, -1, -1, -1, 85, 38, 29, -1, 60, 66, - 67, 66, 67, 29, -1, -1, 61, 62, 66, 67, - 66, 67, 29, 57, 66, 67, 61, 62, -1, 63, - 29, 74, -1, -1, 66, 67, -1, 36, -1, 25, - -1, 27, 85, 66, 67, 18, 19, 18, 19, 29, - 66, 67, 38, -1, -1, -1, -1, 23, 24, 66, - 67, 29, -1, -1, 29, -1, 32, 66, 67, 35, - -1, 37, 45, 46, 45, 46, 23, 24, -1, -1, - -1, 61, 62, -1, -1, 32, 66, 67, 35, -1, - 37, 29, -1, 61, 62, -1, 61, 62, 66, 67, - -1, 66, 67, 23, 24, 18, 19, 23, 24, -1, - -1, -1, 32, -1, -1, 35, 32, 37, -1, 35, - -1, 37, -1, 61, 62, -1, 23, 24, 66, 67, - -1, -1, 45, 46, 31, 32, 23, 24, 35, -1, - 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, - 37, -1, -1, -1, 31, 32, 23, 24, 35, -1, - 37, -1, -1, 10, 31, 32, -1, -1, 35, -1, - 37, -1, 23, 24, -1, 22, -1, -1, 23, 24, - 31, 32, 29, -1, 35, -1, 37, 32, -1, -1, - 35, -1, 37, 3, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 13, -1, -1, -1, 17, 55, -1, - -1, -1, 59, -1, -1, -1, 26, -1, 28, 66, - 67, -1, -1, -1, -1, -1, -1, 74, -1, 39, - -1, 41, 42, -1, -1, -1, 83, 3, 85, 49, - -1, -1, 52, 53, -1, -1, 10, 13, 58, -1, - -1, 17, -1, -1, 64, -1, -1, -1, 22, -1, - 26, -1, 28, -1, -1, 29, -1, -1, -1, 79, - -1, -1, -1, 39, -1, 41, 42, -1, -1, -1, - -1, -1, -1, 49, -1, -1, 52, 53, -1, -1, - -1, 55, 58, -1, -1, 59, -1, -1, 64, -1, - -1, -1, 66, 67, -1, -1, -1, -1, -1, -1, - 74, -1, -1, 79, -1, -1, -1, -1, -1, 83, - -1, 85, -1, -1, -1, -1, -1, 3, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 13, -1, -1, - -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, - 26, -1, 28, -1, -1, 31, -1, -1, -1, -1, + 2, 61, 60, 36, 33, 29, 33, 60, 8, 17, + 78, 29, 29, 1, 61, 8, 60, 60, 31, 2, + 1, 8, 7, 48, 2, 55, 8, 33, 7, 55, + 33, 7, 7, 7, 5, 36, 33, 36, 36, 60, + 5, 5, 8, 1, 7, 7, 7, 7, 16, 8, + 7, 60, 36, 33, 48, 7, 7, 48, 78, 55, + 55, 7, 66, 36, 20, 88, 36, 78, 60, 88, + 1, 76, 7, 7, 17, 65, 48, 0, 55, 29, + 29, 36, 36, 36, 8, 33, 7, -1, 8, 7, + -1, 36, 78, 60, 36, 36, 33, 36, 8, 8, + 33, 7, 8, 8, 8, 8, 8, 8, 8, -1, + 8, 10, 8, 8, 61, -1, 8, 61, 62, 8, + -1, 61, 62, 61, 62, 61, 62, 40, 40, 61, + 62, 61, 62, 29, 61, 62, 7, 12, 51, 51, + 7, 29, 61, 62, 15, 8, 40, 40, 8, 6, + 60, 60, 56, 56, 56, 60, 55, 51, 51, 60, + 60, 42, 60, 20, 50, 60, 33, 56, 54, 61, + 50, 15, 53, 2, 54, 15, 29, 8, 66, 67, + 29, 8, 57, 29, 8, -1, 29, 25, 63, 27, + 34, 25, 36, 27, 34, 8, 36, 60, -1, 7, + 38, 61, 62, 29, 38, 12, 15, 29, -1, 29, + -1, -1, -1, 66, 67, 29, -1, 66, 67, -1, + 66, 67, 7, 66, 67, 34, -1, 36, 29, -1, + 61, 62, 29, 29, 61, 62, 29, 61, 62, 12, + 66, 67, 29, -1, 66, 67, 66, 67, 61, 62, + 57, -1, -1, 61, 62, 25, 63, 27, 18, 19, + 74, 29, 25, -1, 27, 66, 67, -1, 38, 66, + 67, 85, -1, 66, 67, 38, 61, 62, 74, 66, + 67, 29, 18, 19, 57, 45, 46, -1, 36, 85, + 63, 23, 24, 61, 62, -1, -1, -1, 66, 67, + 32, -1, -1, 35, 29, 37, -1, -1, -1, 45, + 46, 23, 24, -1, 29, -1, 29, -1, 66, 67, + 32, 23, 24, 35, -1, 37, -1, -1, 18, 19, + 32, 23, 24, 35, -1, 37, 61, 62, -1, -1, + 32, 66, 67, 35, -1, 37, 61, 62, 61, 62, + -1, 66, 67, 66, 67, 45, 46, 23, 24, -1, + -1, -1, -1, -1, -1, 31, 32, 23, 24, 35, + -1, 37, -1, -1, -1, 31, 32, 23, 24, 35, + 10, 37, -1, -1, -1, 31, 32, -1, -1, 35, + -1, 37, 22, 10, -1, 23, 24, -1, -1, 29, + -1, 23, 24, 31, 32, 22, -1, 35, -1, 37, + 32, -1, 29, 35, -1, 37, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, + -1, -1, -1, -1, -1, -1, 66, 67, 55, -1, + -1, -1, 59, -1, 74, -1, -1, -1, 3, 66, + 67, -1, -1, 83, -1, 85, -1, 74, 13, -1, + -1, -1, 17, -1, -1, -1, 83, -1, 85, 23, + 24, 26, -1, 28, -1, -1, -1, 31, 32, 3, + -1, 35, -1, 37, 39, -1, 41, 42, -1, 13, + -1, -1, -1, 17, 49, -1, -1, 52, 53, -1, + -1, -1, 26, 58, 28, -1, -1, 31, -1, 64, + -1, -1, -1, -1, -1, 39, -1, 41, 42, -1, + -1, -1, -1, -1, 79, 49, -1, -1, 52, 53, + -1, -1, -1, -1, 58, -1, -1, 3, -1, -1, + 64, -1, -1, -1, -1, -1, -1, 13, -1, -1, + -1, 17, -1, -1, -1, 79, -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, @@ -703,47 +693,40 @@ const int JavaScriptGrammar::action_check [] = { 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, - 77, 59, 25, 25, 63, 25, 16, 14, 25, 14, - 16, 94, 16, 16, 92, 16, 25, 19, 89, 19, - 63, 14, 77, 19, 16, 16, 25, 14, 6, 19, - 19, 14, 14, 19, 10, 19, 6, 14, 19, 5, - 14, 16, 14, 6, 63, 25, 14, 16, 15, 14, - 63, 36, 16, 38, 25, 14, 16, 19, 19, 14, - 16, -1, -1, 21, -1, 16, 14, 14, 25, 19, - 19, 25, 25, 19, 19, 27, 16, 16, 16, 16, - 14, -1, -1, 19, 25, 16, -1, 19, -1, 19, - 19, 32, 36, 36, 36, 16, 28, 14, -1, 41, - -1, 36, 30, 36, 14, 33, 50, 42, 41, 52, - 36, 36, 36, 16, 40, 40, 40, 36, 36, 38, - 36, 36, 36, 36, 42, 41, 41, 41, 41, 60, - 36, 36, 36, 16, 36, 41, -1, 41, 36, 60, - -1, 46, 36, 41, 36, 81, 48, 41, 36, 41, - 38, -1, 36, 83, 38, 36, 36, 60, 38, 36, - 41, 36, 39, 38, 25, -1, 95, 101, 36, -1, - 38, 32, 36, 36, 38, 38, 36, 60, 38, 96, - 30, 36, 36, 33, 39, 36, -1, 38, 36, -1, - 44, 36, -1, 36, 42, 38, 36, 42, 38, 36, - 36, 38, 36, 36, 36, 41, 36, 41, 41, 41, - 36, 41, 36, 47, -1, 41, -1, 41, 51, 17, - 18, 19, 58, -1, 36, 36, 58, 53, 58, 41, - 41, 36, 43, -1, 58, 36, 41, 49, 43, 36, - 41, 19, 43, 36, 41, -1, 43, 36, 41, -1, - 28, 29, 41, -1, -1, -1, 45, -1, -1, -1, - 36, -1, 38, -1, -1, 58, -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, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, - -1, -1, -1, -1, -1, -1, 17, 18, 19, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 77, 25, 25, 63, 94, 63, 16, 89, 19, 77, + 16, 16, 16, 59, 10, 14, 19, 19, 19, 14, + 5, 19, 6, 14, 6, 25, 19, 19, 25, 19, + 19, 25, 63, 21, 14, 16, 92, 16, 16, 14, + 16, 63, 25, 16, 16, 19, 15, -1, 25, 16, + 14, 16, 14, 19, 25, 25, 14, 16, 14, 19, + 14, -1, 19, 16, 19, 16, 14, 14, 36, 14, + 14, 39, 14, 16, 14, 27, 25, 16, 16, 25, + 16, -1, 19, -1, 16, -1, 36, 16, 19, 14, + 40, 14, -1, 19, -1, 36, -1, 30, 25, 40, + 33, 36, 36, 38, 19, 32, 36, 41, 36, -1, + 6, -1, 40, 28, 36, 36, 36, 36, 48, 41, + 41, -1, 60, 42, 60, 36, 46, 36, 60, -1, + 41, 60, 41, 36, 36, 38, 38, 36, 36, 38, + -1, 36, 36, 41, 81, 39, 41, 36, 36, 38, + 38, 36, 83, 38, 36, 36, 38, 38, 25, 36, + 36, 38, 38, 36, 36, 32, 38, 36, 41, 95, + 36, 96, 36, 42, 36, 36, 30, 41, 101, 33, + 41, 36, -1, 36, 50, 36, 41, 38, 41, 36, + 52, 38, 36, 36, -1, 36, -1, 36, 36, 42, + 44, 42, 41, 41, -1, 36, 36, 36, 36, 38, + 41, 41, 43, 41, 53, -1, -1, 36, 36, -1, + 58, 51, 41, 41, 43, 17, 18, 19, 36, 36, + 58, -1, -1, 41, 41, -1, 43, 36, 36, 47, + 58, 36, 41, 41, 43, 8, 41, 36, 36, -1, + 45, 49, 41, 41, 17, 18, 19, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, + 58, -1, -1, -1, 19, -1, -1, -1, -1, -1, + -1, -1, -1, 28, 29, -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, -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}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 84f1a64..70c9766 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 = 544, - RULE_COUNT = 313, - STATE_COUNT = 545, + ACCEPT_STATE = 552, + RULE_COUNT = 317, + STATE_COUNT = 553, TERMINAL_COUNT = 91, NON_TERMINAL_COUNT = 103, - GOTO_INDEX_OFFSET = 545, - GOTO_INFO_OFFSET = 1747, - GOTO_CHECK_OFFSET = 1747 + GOTO_INDEX_OFFSET = 553, + GOTO_INFO_OFFSET = 1717, + GOTO_CHECK_OFFSET = 1717 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index f9615c0..ed791c8 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -291,35 +291,38 @@ case 27: { sym(1).Node = node; } break; -case 28: { +case 29: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); node->identifierToken = loc(3); + node->semicolonToken = loc(4); sym(1).Node = node; } break; -case 29: { +case 31: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); node->propertyToken = loc(2); node->typeToken = loc(3); node->identifierToken = loc(4); + node->semicolonToken = loc(5); sym(1).Node = node; } break; -case 30: { +case 33: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); node->typeToken = loc(2); node->identifierToken = loc(3); node->colonToken = loc(4); + node->semicolonToken = loc(6); sym(1).Node = node; } break; -case 31: { +case 35: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -328,91 +331,92 @@ case 31: { node->typeToken = loc(3); node->identifierToken = loc(4); node->colonToken = loc(5); + node->semicolonToken = loc(7); sym(1).Node = node; } break; -case 32: { +case 36: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 33: { +case 37: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 34: -case 35: +case 38: +case 39: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 37: { +case 41: { QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 38: { +case 42: { QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 39: { +case 43: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 40: { +case 44: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 41: { +case 45: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 42: { +case 46: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 43: { +case 47: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 44: { +case 48: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 45: { +case 49: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 50: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 51: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 48: { +case 52: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -423,7 +427,7 @@ case 48: { sym(1).Node = node; } break; -case 49: { +case 53: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -434,21 +438,21 @@ case 49: { sym(1).Node = node; } break; -case 50: { +case 54: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 51: { +case 55: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 52: { +case 56: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -456,7 +460,7 @@ case 52: { sym(1).Node = node; } break; -case 53: { +case 57: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode (driver->nodePool(), @@ -468,7 +472,7 @@ case 53: { sym(1).Node = node; } break; -case 54: { +case 58: { AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -476,51 +480,51 @@ case 54: { sym(1).Node = node; } break; -case 55: { +case 59: { AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 56: { +case 60: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 57: { +case 61: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 58: { +case 62: { AST::Elision *node = makeAstNode (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 59: { +case 63: { AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 60: { +case 64: { sym(1).Node = 0; } break; -case 61: { +case 65: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 62: { +case 66: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 63: { +case 67: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -528,44 +532,36 @@ case 63: { sym(1).Node = node; } break; -case 64: { +case 68: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 65: -case 66: { +case 69: +case 70: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 67: { +case 71: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 68: { +case 72: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 69: { +case 73: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 70: - -case 71: - -case 72: - -case 73: - case 74: case 75: @@ -619,25 +615,33 @@ case 98: case 99: case 100: + +case 101: + +case 102: + +case 103: + +case 104: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 105: { +case 109: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 106: { +case 110: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 107: { +case 111: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -645,384 +649,384 @@ case 107: { sym(1).Node = node; } break; -case 109: { +case 113: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 110: { +case 114: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 111: { +case 115: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 112: { +case 116: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 113: { +case 117: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 114: { +case 118: { sym(1).Node = 0; } break; -case 115: { +case 119: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 116: { +case 120: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 117: { +case 121: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 121: { +case 125: { AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 122: { +case 126: { AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 124: { +case 128: { AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 125: { +case 129: { AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 126: { +case 130: { AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 127: { +case 131: { AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 128: { +case 132: { AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 129: { +case 133: { AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 130: { +case 134: { AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 131: { +case 135: { AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 132: { +case 136: { AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 138: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 135: { +case 139: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 136: { +case 140: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 138: { +case 142: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 139: { +case 143: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 141: { +case 145: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 142: { +case 146: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 147: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 149: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 150: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 151: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 148: { +case 152: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 153: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 154: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 156: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 153: { +case 157: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 158: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 155: { +case 159: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 160: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 162: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 159: { +case 163: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 164: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 161: { +case 165: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 167: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 164: { +case 168: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 169: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +case 170: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { +case 172: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 174: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 176: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +case 178: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +case 180: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 178: { +case 182: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 184: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +case 186: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +case 188: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 186: { +case 190: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 188: { +case 192: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1030,7 +1034,7 @@ case 188: { sym(1).Node = node; } break; -case 190: { +case 194: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1038,112 +1042,112 @@ case 190: { sym(1).Node = node; } break; -case 192: { +case 196: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 194: { +case 198: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 195: { +case 199: { sym(1).ival = QSOperator::Assign; } break; -case 196: { +case 200: { sym(1).ival = QSOperator::InplaceMul; } break; -case 197: { +case 201: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 198: { +case 202: { sym(1).ival = QSOperator::InplaceMod; } break; -case 199: { +case 203: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 200: { +case 204: { sym(1).ival = QSOperator::InplaceSub; } break; -case 201: { +case 205: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 202: { +case 206: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 203: { +case 207: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 204: { +case 208: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 205: { +case 209: { sym(1).ival = QSOperator::InplaceXor; } break; -case 206: { +case 210: { sym(1).ival = QSOperator::InplaceOr; } break; -case 208: { +case 212: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 209: { +case 213: { sym(1).Node = 0; } break; -case 212: { +case 216: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 213: { +case 217: { sym(1).Node = 0; } break; -case 230: { +case 234: { AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 231: { +case 235: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 232: { +case 236: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 233: { +case 237: { sym(1).Node = 0; } break; -case 234: { +case 238: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 236: { +case 240: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1151,76 +1155,76 @@ case 236: { sym(1).Node = node; } break; -case 237: { +case 241: { sym(1).ival = T_CONST; } break; -case 238: { +case 242: { sym(1).ival = T_VAR; } break; -case 239: { +case 243: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 240: { +case 244: { AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 241: { +case 245: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 242: { +case 246: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 243: { +case 247: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 244: { +case 248: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 245: { +case 249: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 246: { +case 250: { sym(1).Node = 0; } break; -case 248: { +case 252: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 249: { +case 253: { sym(1).Node = 0; } break; -case 251: { +case 255: { AST::EmptyStatement *node = makeAstNode (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 253: { +case 257: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 254: { +case 258: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1229,7 +1233,7 @@ case 254: { sym(1).Node = node; } break; -case 255: { +case 259: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1237,7 +1241,7 @@ case 255: { sym(1).Node = node; } break; -case 257: { +case 261: { AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1247,7 +1251,7 @@ case 257: { sym(1).Node = node; } break; -case 258: { +case 262: { AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1255,7 +1259,7 @@ case 258: { sym(1).Node = node; } break; -case 259: { +case 263: { AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1266,7 +1270,7 @@ case 259: { sym(1).Node = node; } break; -case 260: { +case 264: { AST::LocalForStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1279,7 +1283,7 @@ case 260: { sym(1).Node = node; } break; -case 261: { +case 265: { AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1289,7 +1293,7 @@ case 261: { sym(1).Node = node; } break; -case 262: { +case 266: { AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1300,14 +1304,14 @@ case 262: { sym(1).Node = node; } break; -case 264: { +case 268: { AST::ContinueStatement *node = makeAstNode (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 266: { +case 270: { AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1315,14 +1319,14 @@ case 266: { sym(1).Node = node; } break; -case 268: { +case 272: { AST::BreakStatement *node = makeAstNode (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 270: { +case 274: { AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1330,14 +1334,14 @@ case 270: { sym(1).Node = node; } break; -case 272: { +case 276: { AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 273: { +case 277: { AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1345,7 +1349,7 @@ case 273: { sym(1).Node = node; } break; -case 274: { +case 278: { AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1353,90 +1357,90 @@ case 274: { sym(1).Node = node; } break; -case 275: { +case 279: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 276: { +case 280: { AST::CaseBlock *node = makeAstNode (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 277: { +case 281: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 278: { +case 282: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 279: { +case 283: { sym(1).Node = 0; } break; -case 280: { +case 284: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 281: { +case 285: { AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 282: { +case 286: { AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 283: -case 284: { +case 287: +case 288: { AST::LabelledStatement *node = makeAstNode (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 285: { +case 289: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 287: { +case 291: { AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 288: { +case 292: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 289: { +case 293: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 290: { +case 294: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 291: { +case 295: { AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1445,20 +1449,20 @@ case 291: { sym(1).Node = node; } break; -case 292: { +case 296: { AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 294: { +case 298: { AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 295: { +case 299: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1469,7 +1473,7 @@ case 295: { sym(1).Node = node; } break; -case 296: { +case 300: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1481,56 +1485,56 @@ case 296: { sym(1).Node = node; } break; -case 297: { +case 301: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 298: { +case 302: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 299: { +case 303: { sym(1).Node = 0; } break; -case 300: { +case 304: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 301: { +case 305: { sym(1).Node = 0; } break; -case 303: { +case 307: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 304: { +case 308: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 305: { +case 309: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 306: { +case 310: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 307: { +case 311: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 308: { +case 312: { sym(1).sval = 0; } break; -case 310: { +case 314: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index f7b51e0..5e68fe7 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -205,9 +205,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 48 +#define J_SCRIPT_REGEXPLITERAL_RULE1 52 -#define J_SCRIPT_REGEXPLITERAL_RULE2 49 +#define J_SCRIPT_REGEXPLITERAL_RULE2 53 QT_END_NAMESPACE -- cgit v0.12 From 5e690831db11d5d84dc98589da01bf953f4fe06e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 12 May 2009 09:05:02 +1000 Subject: Use sub-component metaobjects to improve performance This reduces the number of runtime-resolved AssignConstant instructions that need to be generated. --- src/declarative/qml/qmlcompiledcomponent.cpp | 4 ++-- src/declarative/qml/qmlcompiler.cpp | 36 +++++++++++++++++++--------- src/declarative/qml/qmlcompiler_p.h | 4 +++- src/declarative/qml/qmlinstruction_p.h | 1 + src/declarative/qml/qmlvme.cpp | 4 ++-- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/declarative/qml/qmlcompiledcomponent.cpp b/src/declarative/qml/qmlcompiledcomponent.cpp index c69af44..bea736a 100644 --- a/src/declarative/qml/qmlcompiledcomponent.cpp +++ b/src/declarative/qml/qmlcompiledcomponent.cpp @@ -56,8 +56,8 @@ QmlCompiledComponent::QmlCompiledComponent() QmlCompiledComponent::~QmlCompiledComponent() { - for (int ii = 0; ii < mos.count(); ++ii) - qFree(mos.at(ii)); + for (int ii = 0; ii < synthesizedMetaObjects.count(); ++ii) + qFree(synthesizedMetaObjects.at(ii)); } diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index c547d31..8e279a5 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -61,6 +61,7 @@ #include #include "private/qmlcustomparser_p_p.h" #include +#include #include "qmlscriptparser_p.h" @@ -431,10 +432,10 @@ void QmlCompiler::reset(QmlCompiledComponent *cc, bool deleteMemory) cc->customTypeData.clear(); cc->datas.clear(); if (deleteMemory) { - for (int ii = 0; ii < cc->mos.count(); ++ii) - qFree(cc->mos.at(ii)); + for (int ii = 0; ii < cc->synthesizedMetaObjects.count(); ++ii) + qFree(cc->synthesizedMetaObjects.at(ii)); } - cc->mos.clear(); + cc->synthesizedMetaObjects.clear(); cc->bytecode.clear(); } @@ -523,6 +524,11 @@ void QmlCompiler::compileTree(Object *tree) if (!compileObject(tree, 0)) // Compile failed return; + if (tree->metatype) + static_cast(output->root) = *tree->metaObject(); + else + static_cast(output->root) = *output->types.at(tree->type).metaObject(); + QmlInstruction def; init.line = 0; def.type = QmlInstruction::SetDefault; @@ -533,10 +539,8 @@ void QmlCompiler::compileTree(Object *tree) bool QmlCompiler::compileObject(Object *obj, int ctxt) { - if (obj->type != -1) { - obj->metatype = - QmlMetaType::metaObjectForType(output->types.at(obj->type).className); - } + if (obj->type != -1) + obj->metatype = output->types.at(obj->type).metaObject(); if (output->types.at(obj->type).className == "Component") { COMPILE_CHECK(compileComponent(obj, ctxt)); @@ -1064,7 +1068,7 @@ bool QmlCompiler::compilePropertyObjectAssignment(QmlParser::Property *prop, int ctxt) { if (v->object->type != -1) - v->object->metatype = QmlMetaType::metaObjectForType(output->types.at(v->object->type).className); + v->object->metatype = output->types.at(v->object->type).metaObject(); if (v->object->metaObject()) { @@ -1293,10 +1297,10 @@ bool QmlCompiler::compileDynamicMeta(QmlParser::Object *obj) obj->extObjectData = builder.toMetaObject(); static_cast(obj->extObject) = *obj->extObjectData; - output->mos << obj->extObjectData; + output->synthesizedMetaObjects << obj->extObjectData; QmlInstruction store; store.type = QmlInstruction::StoreMetaObject; - store.storeMeta.data = output->mos.count() - 1; + store.storeMeta.data = output->synthesizedMetaObjects.count() - 1; store.storeMeta.slotData = slotStart; store.line = obj->location.start.line; output->bytecode << store; @@ -1474,12 +1478,13 @@ QmlCompiledData::~QmlCompiledData() QmlCompiledData &QmlCompiledData::operator=(const QmlCompiledData &other) { types = other.types; + root = other.root; primitives = other.primitives; floatData = other.floatData; intData = other.intData; customTypeData = other.customTypeData; datas = other.datas; - mos = other.mos; + synthesizedMetaObjects = other.synthesizedMetaObjects; bytecode = other.bytecode; return *this; } @@ -1503,5 +1508,14 @@ QObject *QmlCompiledData::TypeReference::createInstance(QmlContext *ctxt) const } } +const QMetaObject *QmlCompiledData::TypeReference::metaObject() const +{ + if (type) + return type->metaObject(); + else if (component) + return &static_cast(QObjectPrivate::get(component))->cc->root; + else + return 0; +} QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index b122650..9d2f8f7 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -81,6 +81,7 @@ public: QmlRefCount *ref; QObject *createInstance(QmlContext *) const; + const QMetaObject *metaObject() const; }; QList types; struct CustomTypeData @@ -88,12 +89,13 @@ public: int index; int type; }; + QAbstractDynamicMetaObject root; QList primitives; QList floatData; QList intData; QList customTypeData; QList datas; - QList mos; + QList synthesizedMetaObjects; QList locations; QList bytecode; diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index 86bddf8..f465e9f 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -281,6 +281,7 @@ public: struct { int count; int endLine; + int metaObject; } createComponent; struct { int id; diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index e42b2fc..5e0f257 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -215,7 +215,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in const QList &types = comp->types; const QList &primitives = comp->primitives; const QList &datas = comp->datas; - const QList &mos = comp->mos; + const QList &synthesizedMetaObjects = comp->synthesizedMetaObjects;; const QList &customTypeData = comp->customTypeData; #ifdef Q_ENABLE_PERFORMANCE_LOG @@ -334,7 +334,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in QFxCompilerTimer cc; #endif QObject *target = stack.top(); - new QmlVMEMetaObject(target, mos.at(instr.storeMeta.data), &comp->primitives, instr.storeMeta.slotData, comp); + new QmlVMEMetaObject(target, synthesizedMetaObjects.at(instr.storeMeta.data), &comp->primitives, instr.storeMeta.slotData, comp); } break; -- cgit v0.12 From 419118871087d6ed47065129459fa3c3db97f14f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 12 May 2009 09:56:41 +1000 Subject: Fix resizing and skinning. Broke with mainwindow introduction. --- demos/declarative/flickr/flickr.qml | 25 ++++++++++++- src/declarative/util/qfxview.cpp | 17 +++++++++ src/declarative/util/qfxview.h | 2 ++ tools/qmlviewer/qmlviewer.cpp | 70 ++++++++++++++++++------------------- tools/qmlviewer/qmlviewer.h | 6 ++-- 5 files changed, 81 insertions(+), 39 deletions(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index fa3bc35..b33b00f 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -119,8 +119,10 @@ Item { Item { id: Background + + anchors.fill: parent - Image { source: "content/pics/background.png"; opaque: true } + Image { source: "content/pics/background.png"; opaque: true; anchors.fill: parent } GridView { id: PhotoGridView; model: FeedModel; delegate: PhotoDelegate; cacheBuffer: 100 @@ -203,4 +205,25 @@ Item { (FeedModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + FeedModel.tags) font.size: 16; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" } + + Image { + source: "content/pics/fingerpoint.png" + opacity: finger.pressed ? 0 : 1 + x: finger.mouseX-16 + y: finger.mouseY-16 + } + + Image { + source: "content/pics/fingerpoint-pressed.png" + opacity: finger.pressed ? 1.0 : 0.0 + x: finger.mouseX-16 + y: finger.mouseY-16 + } + + MouseRegion { + // this region is just to show where the finger is (good for videos) + id: finger + absorb: false + anchors.fill: parent + } } diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 078916b..e17decf 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -105,6 +105,8 @@ public: QmlComponent *component; QBasicTimer resizetimer; + QSize initialSize; + void init(); }; @@ -137,6 +139,7 @@ public: QFxView::QFxView(QWidget *parent) : QSimpleCanvas(parent), d(new QFxViewPrivate(this)) { + setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); d->init(); } @@ -150,6 +153,7 @@ QFxView::QFxView(QWidget *parent) QFxView::QFxView(QSimpleCanvas::CanvasMode mode, QWidget *parent) : QSimpleCanvas(mode, parent), d(new QFxViewPrivate(this)) { + setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); d->init(); } @@ -381,10 +385,23 @@ void QFxView::timerEvent(QTimerEvent* e) if (d->root) emit sceneResized(QSize(d->root->width(),d->root->height())); d->resizetimer.stop(); + updateGeometry(); } } /*! + The size hint is the size of the root item. +*/ +QSize QFxView::sizeHint() const +{ + if (d->initialSize.width() <= 0) + d->initialSize.setWidth(d->root->width()); + if (d->initialSize.height() <= 0) + d->initialSize.setHeight(d->root->height()); + return d->initialSize; +} + +/*! Creates a \l{QmlComponent} {component} from the \a qml string, and returns it as an \l {QFxItem} {item}. If the \a parent item is provided, it becomes the new item's diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h index f575f27..d6f786c 100644 --- a/src/declarative/util/qfxview.h +++ b/src/declarative/util/qfxview.h @@ -82,6 +82,8 @@ public: virtual QFxItem *root() const; + QSize sizeHint() const; + void dumpRoot(); static void printErrorLine(const QmlError &); diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 8457972..bd52b46 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -49,27 +49,34 @@ QmlViewer::QmlViewer(QFxTestEngine::TestMode testMode, const QString &testDir, Q record_autotime = 0; record_period = 20; - int width = 240; - int height = 320; - setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_NoSystemBackground); if (!(flags & Qt::FramelessWindowHint)) - createMenuBar(); + createMenu(menuBar(),0); canvas = new QFxView(this); if(testMode != QFxTestEngine::NoTest) testEngine = new QFxTestEngine(testMode, testDir, canvas, this); QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize))); - canvas->setFixedSize(width, height); - resize(width, height); + setCentralWidget(canvas); } -void QmlViewer::createMenuBar() +QSize QmlViewer::sizeHint() const { - QMenu *fileMenu = menuBar()->addMenu(tr("&File")); + if (skin) + return QMainWindow::sizeHint(); + else { + QSize sh = canvas->sizeHint(); + sh.setHeight(sh.height()+menuBar()->sizeHint().height()); + return sh; + } +} + +void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu) +{ + QMenu *fileMenu = flatmenu ? flatmenu : menu->addMenu(tr("&File")); QAction *openAction = new QAction(tr("&Open..."), this); openAction->setShortcut(QKeySequence("Ctrl+O")); @@ -81,13 +88,9 @@ void QmlViewer::createMenuBar() connect(reloadAction, SIGNAL(triggered()), this, SLOT(reload())); fileMenu->addAction(reloadAction); - QAction *quitAction = new QAction(tr("&Quit"), this); - quitAction->setShortcut(QKeySequence("Ctrl+Q")); - connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); - fileMenu->addSeparator(); - fileMenu->addAction(quitAction); + if (flatmenu) flatmenu->addSeparator(); - QMenu *recordMenu = menuBar()->addMenu(tr("&Recording")); + QMenu *recordMenu = flatmenu ? flatmenu : menu->addMenu(tr("&Recording")); QAction *snapshotAction = new QAction(tr("&Take Snapsot\tF3"), this); connect(snapshotAction, SIGNAL(triggered()), this, SLOT(takeSnapShot())); @@ -97,10 +100,19 @@ void QmlViewer::createMenuBar() connect(recordAction, SIGNAL(triggered()), this, SLOT(toggleRecordingWithSelection())); recordMenu->addAction(recordAction); - QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); + if (flatmenu) flatmenu->addSeparator(); + + QMenu *helpMenu = flatmenu ? flatmenu : menu->addMenu(tr("&Help")); QAction *aboutAction = new QAction(tr("&About Qt..."), this); connect(aboutAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); helpMenu->addAction(aboutAction); + + QAction *quitAction = new QAction(tr("&Quit"), this); + quitAction->setShortcut(QKeySequence("Ctrl+Q")); + connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); + fileMenu->addSeparator(); + fileMenu->addAction(quitAction); + } void QmlViewer::takeSnapShot() @@ -216,13 +228,14 @@ public: setTransform(fit); } + QMenu* menu; + private slots: void slotSkinKeyPressEvent(int code, const QString& text, bool autorep); void slotSkinKeyReleaseEvent(int code, const QString& text, bool autorep); void slotPopupMenu(); private: - void populateContextMenu(QMenu *menu); const QSize m_screenSize; }; @@ -231,6 +244,7 @@ PreviewDeviceSkin::PreviewDeviceSkin(const DeviceSkinParameters ¶meters, QWi DeviceSkin(parameters, parent), m_screenSize(parameters.screenSize()) { + menu = new QMenu(this); connect(this, SIGNAL(skinKeyPressEvent(int,QString,bool)), this, SLOT(slotSkinKeyPressEvent(int,QString,bool))); connect(this, SIGNAL(skinKeyReleaseEvent(int,QString,bool)), @@ -265,14 +279,7 @@ void PreviewDeviceSkin::slotSkinKeyReleaseEvent(int code, const QString& text, b void PreviewDeviceSkin::slotPopupMenu() { - QMenu menu(this); - populateContextMenu(&menu); - menu.exec(QCursor::pos()); -} - -void PreviewDeviceSkin::populateContextMenu(QMenu *menu) -{ - connect(menu->addAction(tr("&Close")), SIGNAL(triggered()), parentWidget(), SLOT(close())); + menu->exec(QCursor::pos()); } void QmlViewer::setSkin(const QString& skinDirectory) @@ -283,12 +290,13 @@ void QmlViewer::setSkin(const QString& skinDirectory) delete skin; if (!err.isEmpty()) qWarning() << err; + delete menuBar(); skin = new PreviewDeviceSkin(parameters,this); - skin->setScreenSize(canvas->size()); + skin->setScreenSize(canvas->sizeHint()); canvas->setParent(skin, Qt::SubWindow); canvas->setAutoFillBackground(true); skin->setView(canvas); - delete layout(); + createMenu(0,skin->menu); canvas->show(); } @@ -318,21 +326,11 @@ void QmlViewer::setRecordPeriod(int ms) void QmlViewer::sceneResized(QSize size) { if (size.width() > 0 && size.height() > 0) { - canvas->setFixedSize(size.width(), size.height()); if (skin) skin->setScreenSize(size); - else - resize(size); } } -void QmlViewer::resizeEvent(QResizeEvent *e) -{ - QMainWindow::resizeEvent(e); - //if (!skin) - //canvas->setFixedSize(width(),height()); -} - void QmlViewer::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_0 && devicemode) diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index fc8a427..3f17912 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -31,7 +31,6 @@ Q_OBJECT public: QmlViewer(QFxTestEngine::TestMode = QFxTestEngine::NoTest, const QString &testDir = QString(), QWidget *parent=0, Qt::WindowFlags flags=0); - void createMenuBar(); void setRecordDither(const QString& s) { record_dither = s; } void setRecordPeriod(int ms); void setRecordFile(const QString&); @@ -43,6 +42,8 @@ public: void setDeviceKeys(bool); void setCacheEnabled(bool); + QSize sizeHint() const; + public slots: void sceneResized(QSize size); void openQml(const QString& fileName); @@ -55,7 +56,8 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); virtual void timerEvent(QTimerEvent *); - virtual void resizeEvent(QResizeEvent *); + + void createMenu(QMenuBar *menu, QMenu *flatmenu); private: QString currentFileName; -- cgit v0.12