forked from qt-creator/qt-creator
QMLJS: update to qmljsparser from Qt 5.6
Change-Id: I29a8e07b0b34aa5e8466021cbb71450687f7e11c Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -94,11 +94,11 @@ namespace QmlJS {
|
||||
|
||||
namespace AST {
|
||||
|
||||
template <typename _T1, typename _T2>
|
||||
_T1 cast(_T2 *ast)
|
||||
template <typename T1, typename T2>
|
||||
T1 cast(T2 *ast)
|
||||
{
|
||||
if (ast && ast->kind == static_cast<_T1>(0)->K)
|
||||
return static_cast<_T1>(ast);
|
||||
if (ast && ast->kind == static_cast<T1>(0)->K)
|
||||
return static_cast<T1>(ast);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -586,6 +586,8 @@ public:
|
||||
virtual SourceLocation lastSourceLocation() const
|
||||
{ return propertyNameToken; }
|
||||
|
||||
virtual QString asString() const = 0;
|
||||
|
||||
// attributes
|
||||
SourceLocation propertyNameToken;
|
||||
};
|
||||
@@ -593,7 +595,11 @@ public:
|
||||
class QML_PARSER_EXPORT PropertyAssignment: public Node
|
||||
{
|
||||
public:
|
||||
PropertyAssignment() {}
|
||||
PropertyAssignment(PropertyName *n)
|
||||
: name(n)
|
||||
{}
|
||||
// attributes
|
||||
PropertyName *name;
|
||||
};
|
||||
|
||||
class QML_PARSER_EXPORT PropertyAssignmentList: public Node
|
||||
@@ -641,7 +647,7 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(PropertyNameAndValue)
|
||||
|
||||
PropertyNameAndValue(PropertyName *n, ExpressionNode *v)
|
||||
: name(n), value(v)
|
||||
: PropertyAssignment(n), value(v)
|
||||
{ kind = K; }
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
@@ -653,7 +659,6 @@ public:
|
||||
{ return value->lastSourceLocation(); }
|
||||
|
||||
// attributes
|
||||
PropertyName *name;
|
||||
SourceLocation colonToken;
|
||||
ExpressionNode *value;
|
||||
SourceLocation commaToken;
|
||||
@@ -670,11 +675,11 @@ public:
|
||||
};
|
||||
|
||||
PropertyGetterSetter(PropertyName *n, FunctionBody *b)
|
||||
: type(Getter), name(n), formals(0), functionBody (b)
|
||||
: PropertyAssignment(n), type(Getter), formals(0), functionBody (b)
|
||||
{ kind = K; }
|
||||
|
||||
PropertyGetterSetter(PropertyName *n, FormalParameterList *f, FunctionBody *b)
|
||||
: type(Setter), name(n), formals(f), functionBody (b)
|
||||
: PropertyAssignment(n), type(Setter), formals(f), functionBody (b)
|
||||
{ kind = K; }
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
@@ -688,7 +693,6 @@ public:
|
||||
// attributes
|
||||
Type type;
|
||||
SourceLocation getSetToken;
|
||||
PropertyName *name;
|
||||
SourceLocation lparenToken;
|
||||
FormalParameterList *formals;
|
||||
SourceLocation rparenToken;
|
||||
@@ -707,6 +711,8 @@ public:
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual QString asString() const { return id.toString(); }
|
||||
|
||||
// attributes
|
||||
QStringRef id;
|
||||
};
|
||||
@@ -721,6 +727,8 @@ public:
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual QString asString() const { return id.toString(); }
|
||||
|
||||
// attributes
|
||||
QStringRef id;
|
||||
};
|
||||
@@ -735,6 +743,8 @@ public:
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual QString asString() const { return QString::number(id, 'g', 16); }
|
||||
|
||||
// attributes
|
||||
double id;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user