QmlJS indenter: Fix indentation for property initializers.

property int foo: {

used to start an object literal but is a block statement now.

Change-Id: I9ffbce4927b444314f1a43aba65ca3d9d234e47c
Reviewed-on: http://codereview.qt-project.org/4339
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-07 12:06:46 +02:00
parent 84364b7884
commit 62a71b75a0
4 changed files with 24 additions and 41 deletions

View File

@@ -166,21 +166,6 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
default: enter(expression); continue;
} break;
// property inits don't take statements
case property_initializer:
switch (kind) {
case Semicolon: leave(true); break;
case LeftBrace: enter(objectliteral_open); break;
case On:
case As:
case List:
case Import:
case Signal:
case Property:
case Identifier: enter(expression_or_objectdefinition); break;
default: enter(expression); continue;
} break;
case objectdefinition_open:
switch (kind) {
case RightBrace: leave(true); break;
@@ -222,7 +207,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
case property_maybe_initializer:
switch (kind) {
case Colon: enter(property_initializer); break;
case Colon: turnInto(binding_assignment); break;
default: leave(true); continue;
} break;

View File

@@ -127,7 +127,6 @@ public: // must be public to make Q_GADGET introspection work
binding_or_objectdefinition, // after an identifier
binding_assignment, // after : in a binding
property_initializer, // after : in a property
objectdefinition_open, // after {
expression,