Add the getter/setter type to PropertyGetterSetter
authorLars Knoll <lars.knoll@digia.com>
Thu, 3 Jan 2013 16:13:38 +0000 (17:13 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 4 Jan 2013 05:53:31 +0000 (06:53 +0100)
Required to differentiatate between getters and
setters.

Change-Id: I48b2fb911192a8cc5840ff11e31b885f62ac6179
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/parser/qqmljsast_p.h

index ddab613..261067d 100644 (file)
@@ -679,12 +679,17 @@ class QML_PARSER_EXPORT PropertyGetterSetter: public PropertyAssignment
 public:
     QQMLJS_DECLARE_AST_NODE(PropertyGetterSetter)
 
+    enum Type {
+        Getter,
+        Setter
+    };
+
     PropertyGetterSetter(PropertyName *n, FunctionBody *b)
-        : name(n), formals(0), functionBody (b)
+        : type(Getter), name(n), formals(0), functionBody (b)
     { kind = K; }
 
     PropertyGetterSetter(PropertyName *n, FormalParameterList *f, FunctionBody *b)
-        : name(n), formals(f), functionBody (b)
+        : type(Setter), name(n), formals(f), functionBody (b)
     { kind = K; }
 
     virtual void accept0(Visitor *visitor);
@@ -696,6 +701,7 @@ public:
     { return rbraceToken; }
 
 // attributes
+    Type type;
     SourceLocation getSetToken;
     PropertyName *name;
     SourceLocation lparenToken;