implement replace_type for sizeof and typeof expressions
authorJuerg Billeter <j@bitron.ch>
Mon, 3 Dec 2007 20:40:58 +0000 (20:40 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 3 Dec 2007 20:40:58 +0000 (20:40 +0000)
2007-12-03  Juerg Billeter  <j@bitron.ch>

* vala/valasizeofexpression.vala, vala/valatypeofexpression.vala:
  implement replace_type for sizeof and typeof expressions

svn path=/trunk/; revision=750

ChangeLog
vala/valasizeofexpression.vala
vala/valatypeofexpression.vala

index 528bd74..b04be84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-03  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valasizeofexpression.vala, vala/valatypeofexpression.vala:
+         implement replace_type for sizeof and typeof expressions
+
 2007-12-02  Jürg Billeter  <j@bitron.ch>
 
        * vala/Makefile.am, vala/parser.y, vala/vala.h,
index aadbbc2..63e06c3 100644 (file)
@@ -29,7 +29,15 @@ public class Vala.SizeofExpression : Expression {
        /**
         * The type whose size to be retrieved.
         */
-       public DataType! type_reference { get; set construct; }
+       public DataType! type_reference {
+               get { return _data_type; }
+               set {
+                       _data_type = value;
+                       _data_type.parent_node = this;
+               }
+       }
+
+       private DataType _data_type;
 
        /**
         * Creates a new sizeof expression.
@@ -52,4 +60,10 @@ public class Vala.SizeofExpression : Expression {
        public override bool is_pure () {
                return true;
        }
+
+       public override void replace_type (DataType! old_type, DataType! new_type) {
+               if (type_reference == old_type) {
+                       type_reference = new_type;
+               }
+       }
 }
index 55dcf70..83ee16d 100644 (file)
@@ -29,7 +29,15 @@ public class Vala.TypeofExpression : Expression {
        /**
         * The type to be retrieved.
         */
-       public DataType! type_reference { get; set construct; }
+       public DataType! type_reference {
+               get { return _data_type; }
+               set {
+                       _data_type = value;
+                       _data_type.parent_node = this;
+               }
+       }
+
+       private DataType _data_type;
 
        /**
         * Creates a new typeof expression.
@@ -52,4 +60,10 @@ public class Vala.TypeofExpression : Expression {
        public override bool is_pure () {
                return true;
        }
+
+       public override void replace_type (DataType! old_type, DataType! new_type) {
+               if (type_reference == old_type) {
+                       type_reference = new_type;
+               }
+       }
 }