]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
implement replace_expression
authorJuerg Billeter <j@bitron.ch>
Fri, 2 May 2008 20:58:00 +0000 (20:58 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 2 May 2008 20:58:00 +0000 (20:58 +0000)
2008-05-02  Juerg Billeter  <j@bitron.ch>

* vala/valainitializerlist.vala: implement replace_expression

svn path=/trunk/; revision=1335

ChangeLog
vala/valainitializerlist.vala

index 4939f6f53ddaf0309b7bbc5f5e5283b0fb81c59b..5f0848eb32f2cedceb006bc6dca8a5a30207487e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-02  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valainitializerlist.vala: implement replace_expression
+
 2008-05-02  Jürg Billeter  <j@bitron.ch>
 
        * vala/valacatchclause.vala:
index 84cf3709e314e1947dca8d2b3125830904458d1c..a87671652b40810f27f17883f422c0b99304cf2d 100644 (file)
@@ -1,6 +1,6 @@
 /* valainitializerlist.vala
  *
- * Copyright (C) 2006-2007  Jürg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2008  Jürg Billeter, Raffaele Sandrini
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@ public class Vala.InitializerList : Expression {
         */
        public void append (Expression expr) {
                initializers.add (expr);
+               expr.parent_node = this;
        }
        
        /**
@@ -83,4 +84,12 @@ public class Vala.InitializerList : Expression {
                }
                return true;
        }
+
+       public override void replace_expression (Expression old_node, Expression new_node) {
+               for (int i = 0; i < initializers.size; i++) {
+                       if (initializers[i] == old_node) {
+                               initializers[i] = new_node;
+                       }
+               }
+       }
 }