[vala/staging] Revert "semanticanalyzer: Transform replaced_nodes field into method"



commit 48c0658f4875faeb3bb13314d331c915f1860156
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jan 29 17:31:21 2018 +0100

    Revert "semanticanalyzer: Transform replaced_nodes field into method"
    
    This reverts commit c81d1f941e06a656deef48d11e795739c94dc8c4.

 vala/valaassignment.vala       |    2 +-
 vala/valamethodcall.vala       |    2 +-
 vala/valasemanticanalyzer.vala |    8 +-------
 vala/valatemplate.vala         |    2 +-
 vala/valaunaryexpression.vala  |    2 +-
 5 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala
index ffeffe7..1c62fcd 100644
--- a/vala/valaassignment.vala
+++ b/vala/valaassignment.vala
@@ -133,7 +133,7 @@ public class Vala.Assignment : Expression {
                                i++;
                        }
 
-                       context.analyzer.add_replaced_node (this);
+                       context.analyzer.replaced_nodes.add (this);
                        parent_node.replace_expression (this, stmt.expression);
                        return stmt.expression.check (context);
                }
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index 3080ae5..76f2403 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -295,7 +295,7 @@ public class Vala.MethodCall : Expression {
                                struct_creation_expression.add_argument (arg);
                        }
                        struct_creation_expression.target_type = target_type;
-                       context.analyzer.add_replaced_node (this);
+                       context.analyzer.replaced_nodes.add (this);
                        parent_node.replace_expression (this, struct_creation_expression);
                        struct_creation_expression.check (context);
                        return true;
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 20e68eb..5424d7f 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -165,7 +165,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
        // keep replaced alive to make sure they remain valid
        // for the whole execution of CodeNode.accept
-       List<CodeNode> replaced_nodes;
+       public List<CodeNode> replaced_nodes = new ArrayList<CodeNode> ();
 
        public SemanticAnalyzer () {
        }
@@ -177,7 +177,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
         */
        public void analyze (CodeContext context) {
                this.context = context;
-               replaced_nodes = new ArrayList<CodeNode> ();
 
                var root_symbol = context.root;
 
@@ -223,14 +222,9 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                context.root.check (context);
                context.accept (this);
 
-               replaced_nodes = null;
                this.context = null;
        }
 
-       public void add_replaced_node (CodeNode node) {
-               replaced_nodes.add (node);
-       }
-
        public override void visit_source_file (SourceFile file) {
                current_source_file = file;
 
diff --git a/vala/valatemplate.vala b/vala/valatemplate.vala
index 514e716..5e27a7b 100644
--- a/vala/valatemplate.vala
+++ b/vala/valatemplate.vala
@@ -81,7 +81,7 @@ public class Vala.Template : Expression {
                }
                expr.target_type = target_type;
 
-               context.analyzer.add_replaced_node (this);
+               context.analyzer.replaced_nodes.add (this);
                parent_node.replace_expression (this, expr);
                return expr.check (context);
        }
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index 650e41c..95b0d4f 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -224,7 +224,7 @@ public class Vala.UnaryExpression : Expression {
 
                        var assignment = new Assignment (ma, bin, AssignmentOperator.SIMPLE, 
source_reference);
                        assignment.target_type = target_type;
-                       context.analyzer.add_replaced_node (this);
+                       context.analyzer.replaced_nodes.add (this);
                        parent_node.replace_expression (this, assignment);
                        assignment.check (context);
                        return true;


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