[vala] Add some missing get_used_variables methods



commit 04b75631493860315e7245148c201179516a2831
Author: Simon Werbeck <simon werbeck gmail com>
Date:   Tue Aug 5 21:36:56 2014 +0200

    Add some missing get_used_variables methods
    
    Fixes bug 734315

 vala/valaarraycreationexpression.vala  |   10 ++++++++++
 vala/valainitializerlist.vala          |    6 ++++++
 vala/valamemberinitializer.vala        |    4 ++++
 vala/valaobjectcreationexpression.vala |    4 ++++
 4 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala
index 3b52748..ec29ce8 100644
--- a/vala/valaarraycreationexpression.vala
+++ b/vala/valaarraycreationexpression.vala
@@ -260,4 +260,14 @@ public class Vala.ArrayCreationExpression : Expression {
 
                codegen.visit_expression (this);
        }
+
+       public override void get_used_variables (Collection<Variable> collection) {
+               foreach (Expression e in sizes) {
+                       e.get_used_variables (collection);
+               }
+
+               if (initializer_list != null) {
+                       initializer_list.get_used_variables (collection);
+               }
+       }
 }
diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala
index edd9857..6955aad 100644
--- a/vala/valainitializerlist.vala
+++ b/vala/valainitializerlist.vala
@@ -224,4 +224,10 @@ public class Vala.InitializerList : Expression {
 
                codegen.visit_expression (this);
        }
+
+       public override void get_used_variables (Collection<Variable> collection) {
+               foreach (Expression expr in initializers) {
+                       expr.get_used_variables (collection);
+               }
+       }
 }
diff --git a/vala/valamemberinitializer.vala b/vala/valamemberinitializer.vala
index c5e5d82..352b1ff 100644
--- a/vala/valamemberinitializer.vala
+++ b/vala/valamemberinitializer.vala
@@ -76,6 +76,10 @@ public class Vala.MemberInitializer : CodeNode {
                initializer.emit (codegen);
        }
 
+       public override void get_used_variables (Collection<Variable> collection) {
+               initializer.get_used_variables (collection);
+       }
+
        public override void replace_expression (Expression old_node, Expression new_node) {
                if (initializer == old_node) {
                        initializer = new_node;
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index e64b852..daf3113 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -479,5 +479,9 @@ public class Vala.ObjectCreationExpression : Expression {
                foreach (Expression arg in argument_list) {
                        arg.get_used_variables (collection);
                }
+
+               foreach (MemberInitializer init in object_initializer) {
+                       init.get_used_variables (collection);
+               }
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]