[vala/wip/transform: 94/95] Add more get_error_types



commit e9ad01072f370c830cc6e5f9088a4002bfe1e97a
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 0357d4c..9693d97 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 44ae378..ce8f43a 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 87860a6..c4dc3f5 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 a684e40..c0e9597 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]