From: Juerg Billeter Date: Mon, 3 Dec 2007 20:40:58 +0000 (+0000) Subject: implement replace_type for sizeof and typeof expressions X-Git-Tag: VALA_0_1_6~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab2c0b7f052fcd94a19a3af81d8bca48c5368dd9;p=platform%2Fupstream%2Fvala.git implement replace_type for sizeof and typeof expressions 2007-12-03 Juerg Billeter * vala/valasizeofexpression.vala, vala/valatypeofexpression.vala: implement replace_type for sizeof and typeof expressions svn path=/trunk/; revision=750 --- diff --git a/ChangeLog b/ChangeLog index 528bd74..b04be84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-03 Jürg Billeter + + * vala/valasizeofexpression.vala, vala/valatypeofexpression.vala: + implement replace_type for sizeof and typeof expressions + 2007-12-02 Jürg Billeter * vala/Makefile.am, vala/parser.y, vala/vala.h, diff --git a/vala/valasizeofexpression.vala b/vala/valasizeofexpression.vala index aadbbc2..63e06c3 100644 --- a/vala/valasizeofexpression.vala +++ b/vala/valasizeofexpression.vala @@ -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; + } + } } diff --git a/vala/valatypeofexpression.vala b/vala/valatypeofexpression.vala index 55dcf70..83ee16d 100644 --- a/vala/valatypeofexpression.vala +++ b/vala/valatypeofexpression.vala @@ -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; + } + } }