aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-12-02 16:53:32 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-06 08:58:39 +0100
commit37b42a135cb9c5c7ea10756b4b6896272c490ced (patch)
tree6e5d97ef7ea238ba102effa6bcc68269bf8f6139 /src
parente9a0aa7dd30566b1da6fd9e56e638aa4846a132b (diff)
Introduce methods to get the source location of the AST nodes.
Also removed deprecate AST nodes. Change-Id: I9221e81b15b18530bb2ab8b09da2482df543bace Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/parser/qdeclarativejs.g4
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast.cpp25
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast_p.h505
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastfwd_p.h3
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastvisitor_p.h6
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp1
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser_p.h3
-rw-r--r--src/declarative/qml/v4/qv4irbuilder.cpp18
-rw-r--r--src/declarative/qml/v4/qv4irbuilder_p.h3
9 files changed, 300 insertions, 268 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g
index 8a8342b462..d99f1dffff 100644
--- a/src/declarative/qml/parser/qdeclarativejs.g
+++ b/src/declarative/qml/parser/qdeclarativejs.g
@@ -255,9 +255,6 @@ public:
AST::UiObjectMemberList *UiObjectMemberList;
AST::UiArrayMemberList *UiArrayMemberList;
AST::UiQualifiedId *UiQualifiedId;
- AST::UiSignature *UiSignature;
- AST::UiFormalList *UiFormalList;
- AST::UiFormal *UiFormal;
};
public:
@@ -828,6 +825,7 @@ UiParameterList: UiPropertyType JsIdentifier ;
/.
case $rule_number: {
AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
+ node->propertyTypeToken = loc(1);
node->identifierToken = loc(2);
sym(1).Node = node;
} break;
diff --git a/src/declarative/qml/parser/qdeclarativejsast.cpp b/src/declarative/qml/parser/qdeclarativejsast.cpp
index 8aff1ad4d0..18e92720a2 100644
--- a/src/declarative/qml/parser/qdeclarativejsast.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsast.cpp
@@ -808,31 +808,6 @@ void UiProgram::accept0(Visitor *visitor)
visitor->endVisit(this);
}
-void UiSignature::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(formals, visitor);
- }
- visitor->endVisit(this);
-}
-
-void UiFormalList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (UiFormalList *it = this; it; it = it->next) {
- accept(it->formal, visitor);
- }
- }
- visitor->endVisit(this);
-}
-
-void UiFormal::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
- visitor->endVisit(this);
-}
-
void UiPublicMember::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
diff --git a/src/declarative/qml/parser/qdeclarativejsast_p.h b/src/declarative/qml/parser/qdeclarativejsast_p.h
index b2c441d37b..8b3783137d 100644
--- a/src/declarative/qml/parser/qdeclarativejsast_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsast_p.h
@@ -216,10 +216,7 @@ public:
Kind_UiPublicMember,
Kind_UiQualifiedId,
Kind_UiScriptBinding,
- Kind_UiSourceElement,
- Kind_UiFormal,
- Kind_UiFormalList,
- Kind_UiSignature
+ Kind_UiSourceElement
};
inline Node()
@@ -242,6 +239,8 @@ public:
{ return accept(node, visitor); } // ### remove
virtual void accept0(Visitor *visitor) = 0;
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
// attributes
int kind;
@@ -253,9 +252,6 @@ public:
ExpressionNode() {}
virtual ExpressionNode *expressionCast();
-
- virtual SourceLocation firstSourceLocation() const = 0;
- virtual SourceLocation lastSourceLocation() const = 0;
};
class QML_PARSER_EXPORT Statement: public Node
@@ -264,92 +260,6 @@ public:
Statement() {}
virtual Statement *statementCast();
-
- virtual SourceLocation firstSourceLocation() const = 0;
- virtual SourceLocation lastSourceLocation() const = 0;
-};
-
-class QML_PARSER_EXPORT UiFormal: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(UiFormal)
-
- UiFormal(const QStringRef &name, const QStringRef &alias)
- : name(name), alias(alias)
- { }
-
- virtual SourceLocation firstSourceLocation() const
- { return SourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return SourceLocation(); }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- QStringRef name;
- QStringRef alias;
- SourceLocation identifierToken;
- SourceLocation asToken;
- SourceLocation aliasToken;
-};
-
-class QML_PARSER_EXPORT UiFormalList: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(UiFormalList)
-
- UiFormalList(UiFormal *formal)
- : formal(formal), next(this) {}
-
- UiFormalList(UiFormalList *previous, UiFormal *formal)
- : formal(formal)
- {
- next = previous->next;
- previous->next = this;
- }
-
- UiFormalList *finish()
- {
- UiFormalList *head = next;
- next = 0;
- return head;
- }
-
- virtual SourceLocation firstSourceLocation() const
- { return SourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return SourceLocation(); }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- UiFormal *formal;
- UiFormalList *next;
-};
-
-class QML_PARSER_EXPORT UiSignature: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(UiSignature)
-
- UiSignature(UiFormalList *formals = 0)
- : formals(formals)
- { }
-
- virtual SourceLocation firstSourceLocation() const
- { return SourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return SourceLocation(); }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- SourceLocation lparenToken;
- UiFormalList *formals;
- SourceLocation rparenToken;
};
class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
@@ -594,6 +504,41 @@ public:
SourceLocation rbraceToken;
};
+class QML_PARSER_EXPORT Elision: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Elision)
+
+ Elision():
+ next (this) { kind = K; }
+
+ Elision(Elision *previous)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return commaToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : commaToken; }
+
+ inline Elision *finish ()
+ {
+ Elision *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ Elision *next;
+ SourceLocation commaToken;
+};
+
class QML_PARSER_EXPORT ElementList: public Node
{
public:
@@ -620,6 +565,20 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (elision)
+ return elision->firstSourceLocation();
+ return expression->firstSourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (next)
+ return next->lastSourceLocation();
+ return expression->lastSourceLocation();
+ }
+
// attributes
Elision *elision;
ExpressionNode *expression;
@@ -627,33 +586,21 @@ public:
SourceLocation commaToken;
};
-class QML_PARSER_EXPORT Elision: public Node
+class QML_PARSER_EXPORT PropertyName: public Node
{
public:
- QDECLARATIVEJS_DECLARE_AST_NODE(Elision)
-
- Elision():
- next (this) { kind = K; }
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
- Elision(Elision *previous)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
+ PropertyName() { kind = K; }
- virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return propertyNameToken; }
- inline Elision *finish ()
- {
- Elision *front = next;
- next = 0;
- return front;
- }
+ virtual SourceLocation lastSourceLocation() const
+ { return propertyNameToken; }
// attributes
- Elision *next;
- SourceLocation commaToken;
+ SourceLocation propertyNameToken;
};
class QML_PARSER_EXPORT PropertyNameAndValueList: public Node
@@ -675,6 +622,16 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return name->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (next)
+ return next->lastSourceLocation();
+ return value->lastSourceLocation();
+ }
+
inline PropertyNameAndValueList *finish ()
{
PropertyNameAndValueList *front = next;
@@ -690,17 +647,6 @@ public:
SourceLocation commaToken;
};
-class QML_PARSER_EXPORT PropertyName: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
-
- PropertyName() { kind = K; }
-
-// attributes
- SourceLocation propertyNameToken;
-};
-
class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
{
public:
@@ -880,6 +826,16 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return expression->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (next)
+ return next->lastSourceLocation();
+ return expression->lastSourceLocation();
+ }
+
inline ArgumentList *finish ()
{
ArgumentList *front = next;
@@ -1238,6 +1194,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return statement->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : statement->lastSourceLocation(); }
+
inline StatementList *finish ()
{
StatementList *front = next;
@@ -1284,6 +1246,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression ? expression->lastSourceLocation() : identifierToken; }
+
// attributes
QStringRef name;
ExpressionNode *expression;
@@ -1310,6 +1278,16 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return declaration->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (next)
+ return next->lastSourceLocation();
+ return declaration->lastSourceLocation();
+ }
+
inline VariableDeclarationList *finish (bool readOnly)
{
VariableDeclarationList *front = next;
@@ -1670,6 +1648,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
// attributes
CaseClauses *clauses;
DefaultClause *defaultClause;
@@ -1703,6 +1687,30 @@ public:
SourceLocation rparenToken;
};
+class QML_PARSER_EXPORT CaseClause: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause)
+
+ CaseClause(ExpressionNode *e, StatementList *slist):
+ expression (e), statements (slist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return caseToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statements ? statements->lastSourceLocation() : colonToken; }
+
+// attributes
+ ExpressionNode *expression;
+ StatementList *statements;
+ SourceLocation caseToken;
+ SourceLocation colonToken;
+};
+
class QML_PARSER_EXPORT CaseClauses: public Node
{
public:
@@ -1722,6 +1730,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return clause->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : clause->lastSourceLocation(); }
+
inline CaseClauses *finish ()
{
CaseClauses *front = next;
@@ -1734,24 +1748,6 @@ public:
CaseClauses *next;
};
-class QML_PARSER_EXPORT CaseClause: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause)
-
- CaseClause(ExpressionNode *e, StatementList *slist):
- expression (e), statements (slist)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- ExpressionNode *expression;
- StatementList *statements;
- SourceLocation caseToken;
- SourceLocation colonToken;
-};
-
class QML_PARSER_EXPORT DefaultClause: public Node
{
public:
@@ -1763,6 +1759,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return defaultToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statements ? statements->lastSourceLocation() : colonToken; }
+
// attributes
StatementList *statements;
SourceLocation defaultToken;
@@ -1826,6 +1828,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return catchToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
// attributes
QStringRef name;
Block *statement;
@@ -1846,6 +1854,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return finallyToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement ? statement->lastSourceLocation() : finallyToken; }
+
// attributes
Block *statement;
SourceLocation finallyToken;
@@ -1950,6 +1964,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : identifierToken; }
+
inline FormalParameterList *finish ()
{
FormalParameterList *front = next;
@@ -1964,34 +1984,13 @@ public:
SourceLocation identifierToken;
};
-class QML_PARSER_EXPORT FunctionBody: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody)
-
- FunctionBody(SourceElements *elts):
- elements (elts)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- SourceElements *elements;
-};
-
-class QML_PARSER_EXPORT Program: public Node
+class QML_PARSER_EXPORT SourceElement: public Node
{
public:
- QDECLARATIVEJS_DECLARE_AST_NODE(Program)
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement)
- Program(SourceElements *elts):
- elements (elts)
+ inline SourceElement()
{ kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- SourceElements *elements;
};
class QML_PARSER_EXPORT SourceElements: public Node
@@ -2013,6 +2012,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return element->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : element->lastSourceLocation(); }
+
inline SourceElements *finish ()
{
SourceElements *front = next;
@@ -2025,13 +2030,46 @@ public:
SourceElements *next;
};
-class QML_PARSER_EXPORT SourceElement: public Node
+class QML_PARSER_EXPORT FunctionBody: public Node
{
public:
- QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody)
- inline SourceElement()
+ FunctionBody(SourceElements *elts):
+ elements (elts)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return elements ? elements->firstSourceLocation() : SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return elements ? elements->lastSourceLocation() : SourceLocation(); }
+
+// attributes
+ SourceElements *elements;
+};
+
+class QML_PARSER_EXPORT Program: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Program)
+
+ Program(SourceElements *elts):
+ elements (elts)
{ kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return elements ? elements->firstSourceLocation() : SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return elements ? elements->lastSourceLocation() : SourceLocation(); }
+
+// attributes
+ SourceElements *elements;
};
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
@@ -2045,6 +2083,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return declaration->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return declaration->lastSourceLocation(); }
+
// attributes
FunctionDeclaration *declaration;
};
@@ -2060,6 +2104,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return statement->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
// attributes
Statement *statement;
};
@@ -2085,22 +2135,6 @@ public:
SourceLocation semicolonToken;
};
-class QML_PARSER_EXPORT UiProgram: public Node
-{
-public:
- QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram)
-
- UiProgram(UiImportList *imports, UiObjectMemberList *members)
- : imports(imports), members(members)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- UiImportList *imports;
- UiObjectMemberList *members;
-};
-
class QML_PARSER_EXPORT UiQualifiedId: public Node
{
public:
@@ -2127,6 +2161,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : identifierToken; }
+
// attributes
UiQualifiedId *next;
QStringRef name;
@@ -2146,14 +2186,14 @@ public:
: importUri(uri)
{ kind = K; }
+ virtual void accept0(Visitor *visitor);
+
virtual SourceLocation firstSourceLocation() const
{ return importToken; }
virtual SourceLocation lastSourceLocation() const
{ return semicolonToken; }
- virtual void accept0(Visitor *visitor);
-
// attributes
QStringRef fileName;
UiQualifiedId *importUri;
@@ -2184,21 +2224,6 @@ public:
previous->next = this;
}
- virtual SourceLocation firstSourceLocation() const
- {
- if (import) return import->firstSourceLocation();
- else return SourceLocation();
- }
-
- virtual SourceLocation lastSourceLocation() const
- {
- for (const UiImportList *it = this; it; it = it->next)
- if (!it->next && it->import)
- return it->import->lastSourceLocation();
-
- return SourceLocation();
- }
-
UiImportList *finish()
{
UiImportList *head = next;
@@ -2208,6 +2233,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return import->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : import->lastSourceLocation(); }
+
// attributes
UiImport *import;
UiImportList *next;
@@ -2241,6 +2272,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return member->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
+
UiObjectMemberList *finish()
{
UiObjectMemberList *head = next;
@@ -2253,6 +2290,40 @@ public:
UiObjectMember *member;
};
+class QML_PARSER_EXPORT UiProgram: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram)
+
+ UiProgram(UiImportList *imports, UiObjectMemberList *members)
+ : imports(imports), members(members)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (imports)
+ return imports->firstSourceLocation();
+ else if (members)
+ return members->firstSourceLocation();
+ return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (members)
+ return members->lastSourceLocation();
+ else if (imports)
+ return imports->lastSourceLocation();
+ return SourceLocation();
+ }
+
+// attributes
+ UiImportList *imports;
+ UiObjectMemberList *members;
+};
+
class QML_PARSER_EXPORT UiArrayMemberList: public Node
{
public:
@@ -2272,6 +2343,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return member->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
+
UiArrayMemberList *finish()
{
UiArrayMemberList *head = next;
@@ -2296,6 +2373,12 @@ public:
virtual void accept0(Visitor *visitor);
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
// attributes
SourceLocation lbraceToken;
UiObjectMemberList *members;
@@ -2321,6 +2404,12 @@ public:
virtual void accept0(Visitor *) {}
+ virtual SourceLocation firstSourceLocation() const
+ { return propertyTypeToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return next ? next->lastSourceLocation() : identifierToken; }
+
inline UiParameterList *finish ()
{
UiParameterList *front = next;
@@ -2333,6 +2422,7 @@ public:
QStringRef name;
UiParameterList *next;
SourceLocation commaToken;
+ SourceLocation propertyTypeToken;
SourceLocation identifierToken;
};
@@ -2352,6 +2442,8 @@ public:
: type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
{ kind = K; }
+ virtual void accept0(Visitor *visitor);
+
virtual SourceLocation firstSourceLocation() const
{
if (defaultToken.isValid())
@@ -2372,8 +2464,6 @@ public:
return semicolonToken;
}
- virtual void accept0(Visitor *visitor);
-
// attributes
enum { Signal, Property } type;
QStringRef typeModifier;
@@ -2404,14 +2494,14 @@ public:
: qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer)
{ kind = K; }
+ virtual void accept0(Visitor *visitor);
+
virtual SourceLocation firstSourceLocation() const
{ return qualifiedTypeNameId->identifierToken; }
virtual SourceLocation lastSourceLocation() const
{ return initializer->rbraceToken; }
- virtual void accept0(Visitor *visitor);
-
// attributes
UiQualifiedId *qualifiedTypeNameId;
UiObjectInitializer *initializer;
@@ -2446,9 +2536,9 @@ public:
return SourceLocation();
}
-
virtual void accept0(Visitor *visitor);
+
// attributes
Node *sourceElement;
};
@@ -2480,6 +2570,7 @@ public:
virtual void accept0(Visitor *visitor);
+
// attributes
UiQualifiedId *qualifiedId;
UiQualifiedId *qualifiedTypeNameId;
diff --git a/src/declarative/qml/parser/qdeclarativejsastfwd_p.h b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
index fbc983a7ef..28462ffcf7 100644
--- a/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
@@ -178,9 +178,6 @@ class UiObjectMember;
class UiObjectMemberList;
class UiArrayMemberList;
class UiQualifiedId;
-class UiFormalList;
-class UiFormal;
-class UiSignature;
} } // namespace AST
diff --git a/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
index 8f51066e2a..0381388a30 100644
--- a/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
@@ -83,9 +83,6 @@ public:
virtual bool visit(UiObjectMemberList *) { return true; }
virtual bool visit(UiArrayMemberList *) { return true; }
virtual bool visit(UiQualifiedId *) { return true; }
- virtual bool visit(UiSignature *) { return true; }
- virtual bool visit(UiFormalList *) { return true; }
- virtual bool visit(UiFormal *) { return true; }
virtual void endVisit(UiProgram *) {}
virtual void endVisit(UiImportList *) {}
@@ -100,9 +97,6 @@ public:
virtual void endVisit(UiObjectMemberList *) {}
virtual void endVisit(UiArrayMemberList *) {}
virtual void endVisit(UiQualifiedId *) {}
- virtual void endVisit(UiSignature *) {}
- virtual void endVisit(UiFormalList *) {}
- virtual void endVisit(UiFormal *) {}
// QDeclarativeJS
virtual bool visit(ThisExpression *) { return true; }
diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp
index 4db8a104f2..5326feaae4 100644
--- a/src/declarative/qml/parser/qdeclarativejsparser.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp
@@ -378,6 +378,7 @@ case 46: {
case 47: {
AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
+ node->propertyTypeToken = loc(1);
node->identifierToken = loc(2);
sym(1).Node = node;
} break;
diff --git a/src/declarative/qml/parser/qdeclarativejsparser_p.h b/src/declarative/qml/parser/qdeclarativejsparser_p.h
index a3980151d3..f0dc25f461 100644
--- a/src/declarative/qml/parser/qdeclarativejsparser_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsparser_p.h
@@ -117,9 +117,6 @@ public:
AST::UiObjectMemberList *UiObjectMemberList;
AST::UiArrayMemberList *UiArrayMemberList;
AST::UiQualifiedId *UiQualifiedId;
- AST::UiSignature *UiSignature;
- AST::UiFormalList *UiFormalList;
- AST::UiFormal *UiFormal;
};
public:
diff --git a/src/declarative/qml/v4/qv4irbuilder.cpp b/src/declarative/qml/v4/qv4irbuilder.cpp
index c65b348c9f..389533eb60 100644
--- a/src/declarative/qml/v4/qv4irbuilder.cpp
+++ b/src/declarative/qml/v4/qv4irbuilder.cpp
@@ -314,24 +314,6 @@ bool QV4IRBuilder::visit(AST::UiQualifiedId *)
return false;
}
-bool QV4IRBuilder::visit(AST::UiSignature *)
-{
- Q_ASSERT(!"unreachable");
- return false;
-}
-
-bool QV4IRBuilder::visit(AST::UiFormalList *)
-{
- Q_ASSERT(!"unreachable");
- return false;
-}
-
-bool QV4IRBuilder::visit(AST::UiFormal *)
-{
- Q_ASSERT(!"unreachable");
- return false;
-}
-
// JS
bool QV4IRBuilder::visit(AST::Program *)
diff --git a/src/declarative/qml/v4/qv4irbuilder_p.h b/src/declarative/qml/v4/qv4irbuilder_p.h
index 28df5c4245..ed21fc9e99 100644
--- a/src/declarative/qml/v4/qv4irbuilder_p.h
+++ b/src/declarative/qml/v4/qv4irbuilder_p.h
@@ -131,9 +131,6 @@ protected:
virtual bool visit(QDeclarativeJS::AST::UiObjectMemberList *ast);
virtual bool visit(QDeclarativeJS::AST::UiArrayMemberList *ast);
virtual bool visit(QDeclarativeJS::AST::UiQualifiedId *ast);
- virtual bool visit(QDeclarativeJS::AST::UiSignature *ast);
- virtual bool visit(QDeclarativeJS::AST::UiFormalList *ast);
- virtual bool visit(QDeclarativeJS::AST::UiFormal *ast);
// JS
virtual bool visit(QDeclarativeJS::AST::Program *ast);