[vala/wip/transform: 167/237] Let the transformer handle recursive transformations



commit 4e307f2d4aae39699c5e14d4056fa9aad0cee56a
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue Jan 3 13:09:20 2012 +0100

    Let the transformer handle recursive transformations

 codegen/valagvarianttransformer.vala |    7 ++-----
 vala/valaconditionalexpression.vala  |    2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valagvarianttransformer.vala b/codegen/valagvarianttransformer.vala
index 4ccd767..d738ce7 100644
--- a/codegen/valagvarianttransformer.vala
+++ b/codegen/valagvarianttransformer.vala
@@ -225,7 +225,7 @@ public class Vala.GVariantTransformer : CodeTransformer {
                        for (int i=0; i < dim; i++) {
                                element_expr.append_index (expression (indices[i]));
                        }
-                       element_variant = serialize_expression (copy_type (array_type.element_type, false), 
element_expr);
+                       element_variant = element_expr;
                }
 
                var builder_add = (MethodCall) expression (builder+".add_value ()");
@@ -262,10 +262,7 @@ public class Vala.GVariantTransformer : CodeTransformer {
                                        continue;
                                }
 
-                               var serialized_field = serialize_expression (copy_type (f.variable_type, 
false), expression (@"st.$(f.name)"));
-                               MethodCall call = (MethodCall) expression (@"$builder.add_value ()");
-                               call.add_argument (serialized_field);
-                               b.add_expression (call);
+                               b.add_expression (expression (@"$builder.add_value (st.$(f.name))"));
                        }
                        b.add_return (expression (@"$builder.end ()"));
 
diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala
index 9bc1639..a1bbe8c 100644
--- a/vala/valaconditionalexpression.vala
+++ b/vala/valaconditionalexpression.vala
@@ -123,7 +123,7 @@ public class Vala.ConditionalExpression : Expression {
        }
 
        public override string to_string () {
-               return "%s ? %s : %s".printf (condition.to_string, true_expression.to_string (), 
false_expression.to_string ());
+               return "%s ? %s : %s".printf (condition.to_string (), true_expression.to_string (), 
false_expression.to_string ());
        }
 
        public override void replace_expression (Expression old_node, Expression new_node) {


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