[vala/wip/transform: 1/2] Add more get_error_types



commit a1f19356f193107869766129762ac68b902801b0
Author: Luca Bruno <luca bruno immobiliare it>
Date:   Wed Feb 5 10:35:16 2014 +0100

    Add more get_error_types

 codegen/valaccodetransformer.vala   |    1 +
 vala/valabinaryexpression.vala      |    5 +++++
 vala/valacastexpression.vala        |    4 ++++
 vala/valaconditionalexpression.vala |    6 ++++++
 vala/valaelementaccess.vala         |    7 +++++++
 vala/valamemberaccess.vala          |    6 ++++++
 vala/valapointerindirection.vala    |    4 ++++
 vala/valaunaryexpression.vala       |    4 ++++
 8 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index aef6926..698723f 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -342,6 +342,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
                                var replacement = return_temp_access (local, expr.value_type, target_type, 
formal_target_type);
 
                                end_replace_expression (replacement);
+                               return;
                        }
                }
 
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 6589aa9..679f6c6 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -145,6 +145,11 @@ public class Vala.BinaryExpression : Expression {
                return left.is_accessible (sym) && right.is_accessible (sym);
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               left.get_error_types (collection, source_reference);
+               right.get_error_types (collection, source_reference);
+       }
+
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala
index 4fc4d38..785b142 100644
--- a/vala/valacastexpression.vala
+++ b/vala/valacastexpression.vala
@@ -123,6 +123,10 @@ public class Vala.CastExpression : Expression {
                }
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               inner.get_error_types (collection, source_reference);
+       }
+
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala
index f119a0e..b6a23ee 100644
--- a/vala/valaconditionalexpression.vala
+++ b/vala/valaconditionalexpression.vala
@@ -120,6 +120,12 @@ public class Vala.ConditionalExpression : Expression {
                }
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               condition.get_error_types (collection, source_reference);
+               true_expression.get_error_types (collection, source_reference);
+               false_expression.get_error_types (collection, source_reference);
+       }
+       
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala
index 94082bc..82237a9 100644
--- a/vala/valaelementaccess.vala
+++ b/vala/valaelementaccess.vala
@@ -120,6 +120,13 @@ public class Vala.ElementAccess : Expression {
                return container.is_accessible (sym);
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               container.get_error_types (collection, source_reference);
+               foreach (Expression e in indices) {
+                       e.get_error_types (collection, source_reference);
+               }
+       }
+
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 982a95f..49feb67 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -193,6 +193,12 @@ public class Vala.MemberAccess : Expression {
                }
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               if (inner != null) {
+                       inner.get_error_types (collection, source_reference);
+               }
+       }
+       
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valapointerindirection.vala b/vala/valapointerindirection.vala
index 1baec54..d24ee59 100644
--- a/vala/valapointerindirection.vala
+++ b/vala/valapointerindirection.vala
@@ -71,6 +71,10 @@ public class Vala.PointerIndirection : Expression {
                return inner.is_accessible (sym);
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               inner.get_error_types (collection, source_reference);
+       }
+
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index 4586d41..fc447f1 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -150,6 +150,10 @@ public class Vala.UnaryExpression : Expression {
                return null;
        }
 
+       public override void get_error_types (Collection<DataType> collection, SourceReference? 
source_reference = null) {
+               inner.get_error_types (collection, source_reference);
+       }
+       
        public override bool check (CodeContext context) {
                if (checked) {
                        return !error;


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