[vala/wip/transform: 16/97] Several transformer fixes
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 16/97] Several transformer fixes
- Date: Mon, 21 Jan 2019 18:39:59 +0000 (UTC)
commit 6fce62b4d02812f00a24f78307736052b1303544
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Dec 29 12:39:15 2011 +0100
Several transformer fixes
vala/valacodetransformer.vala | 6 ++++++
vala/valaconditionalexpression.vala | 6 ++----
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index eaff508b4..8727c8e7e 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -196,6 +196,7 @@ public class Vala.CodeTransformer : CodeVisitor {
var loop = new Loop (stmt.body, stmt.source_reference);
var parent_block = (Block) stmt.parent_node;
+ context.analyzer.replaced_nodes.add (stmt);
parent_block.replace_statement (stmt, loop);
stmt.body.checked = false;
@@ -210,6 +211,7 @@ public class Vala.CodeTransformer : CodeVisitor {
var loop = new Loop (stmt.body, stmt.source_reference);
var parent_block = (Block) stmt.parent_node;
+ context.analyzer.replaced_nodes.add (stmt);
parent_block.replace_statement (stmt, loop);
check (loop);
@@ -237,6 +239,7 @@ public class Vala.CodeTransformer : CodeVisitor {
block.add_statement (new Loop (stmt.body, stmt.source_reference));
var parent_block = (Block) stmt.parent_node;
+ context.analyzer.replaced_nodes.add (stmt);
parent_block.replace_statement (stmt, block);
stmt.body.checked = false;
@@ -283,6 +286,7 @@ public class Vala.CodeTransformer : CodeVisitor {
block.add_statement (new Loop (stmt.body, stmt.source_reference));
var parent_block = (Block) stmt.parent_node;
+ context.analyzer.replaced_nodes.add (stmt);
parent_block.replace_statement (stmt, block);
stmt.body.checked = false;
@@ -366,6 +370,7 @@ public class Vala.CodeTransformer : CodeVisitor {
block.remove_local_variable (local);
context.analyzer.get_insert_block (expr).add_local_variable (local);
+ context.analyzer.replaced_nodes.add (expr);
old_parent_node.replace_expression (expr, temp_access);
check (temp_access);
}
@@ -396,6 +401,7 @@ public class Vala.CodeTransformer : CodeVisitor {
ma.formal_target_type = expr.formal_target_type;
ma.target_type = expr.target_type;
+ context.analyzer.replaced_nodes.add (expr);
expr.parent_node.replace_expression (expr, ma);
check (ma);
}
diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala
index be317b1c7..4a0ceb45b 100644
--- a/vala/valaconditionalexpression.vala
+++ b/vala/valaconditionalexpression.vala
@@ -85,11 +85,9 @@ public class Vala.ConditionalExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
- // FIXME: temporary workaround to keep alive the object
- var self = this;
- visitor.visit_conditional_expression (self);
+ visitor.visit_conditional_expression (this);
- visitor.visit_expression (self);
+ visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]