Commit 457053b1 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Separate visiting expressions from visiting expression statements

2008-11-30  Jürg Billeter  <j@bitron.ch>

	* vala/valaexpressionstatement.vala:
	* vala/valanullchecker.vala:
	* vala/valasymbolresolver.vala:
	* gobject/valaccodebasemodule.vala:

	Separate visiting expressions from visiting expression statements

svn path=/trunk/; revision=2095
parent deb47777
2008-11-30 Jürg Billeter <j@bitron.ch>
* vala/valaexpressionstatement.vala:
* vala/valanullchecker.vala:
* vala/valasymbolresolver.vala:
* gobject/valaccodebasemodule.vala:
Separate visiting expressions from visiting expression statements
2008-11-30 Jürg Billeter <j@bitron.ch>
* vala/valabinaryexpression.vala:
......
......@@ -1806,6 +1806,8 @@ public class Vala.CCodeBaseModule : CCodeModule {
}
public override void visit_expression_statement (ExpressionStatement stmt) {
stmt.accept_children (codegen);
if (stmt.expression.error) {
stmt.error = true;
return;
......
......@@ -53,13 +53,15 @@ public class Vala.ExpressionStatement : CodeNode, Statement {
this.source_reference = source_reference;
this.expression = expression;
}
public override void accept (CodeVisitor visitor) {
expression.accept (visitor);
public override void accept (CodeVisitor visitor) {
visitor.visit_expression_statement (this);
}
public override void accept_children (CodeVisitor visitor) {
expression.accept (visitor);
}
public override void replace_expression (Expression old_node, Expression new_node) {
if (expression == old_node) {
expression = new_node;
......
......@@ -134,6 +134,10 @@ public class Vala.NullChecker : CodeVisitor {
}
}
public override void visit_expression_statement (ExpressionStatement stmt) {
stmt.accept_children (this);
}
public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
......
......@@ -338,6 +338,10 @@ public class Vala.SymbolResolver : CodeVisitor {
list.accept_children (this);
}
public override void visit_expression_statement (ExpressionStatement stmt) {
stmt.accept_children (this);
}
public override void visit_if_statement (IfStatement stmt) {
stmt.accept_children (this);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment