Commit 6ecef926 authored by Luca Bruno's avatar Luca Bruno Committed by Jürg Billeter

Port remaining code nodes to use accept_children for visiting children

Fixes bug 566870.
parent 7312f71d
......@@ -53,13 +53,15 @@ public class Vala.AddressofExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_addressof_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
inner.accept (visitor);
}
public override void replace_expression (Expression old_node, Expression new_node) {
if (inner == old_node) {
inner = new_node;
......
......@@ -81,14 +81,16 @@ public class Vala.CastExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
visitor.visit_cast_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
inner.accept (visitor);
if (!is_non_null_cast) {
type_reference.accept (visitor);
}
visitor.visit_cast_expression (this);
visitor.visit_expression (this);
}
public override void replace_expression (Expression old_node, Expression new_node) {
......
......@@ -85,15 +85,17 @@ public class Vala.ConditionalExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
condition.accept (visitor);
true_expression.accept (visitor);
false_expression.accept (visitor);
visitor.visit_conditional_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
condition.accept (visitor);
true_expression.accept (visitor);
false_expression.accept (visitor);
}
public override bool is_pure () {
return condition.is_pure () && true_expression.is_pure () && false_expression.is_pure ();
}
......
......@@ -51,13 +51,15 @@ public class Vala.PostfixExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
inner.accept (visitor);
visitor.visit_postfix_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
inner.accept (visitor);
}
public override bool is_pure () {
return false;
}
......
......@@ -52,13 +52,15 @@ public class Vala.SizeofExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
type_reference.accept (visitor);
visitor.visit_sizeof_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
}
public override bool is_pure () {
return true;
}
......
......@@ -509,14 +509,34 @@ public class Vala.SymbolResolver : CodeVisitor {
expr.accept_children (this);
}
public override void visit_postfix_expression (PostfixExpression expr) {
expr.accept_children (this);
}
public override void visit_object_creation_expression (ObjectCreationExpression expr) {
expr.accept_children (this);
}
public override void visit_sizeof_expression (SizeofExpression expr) {
expr.accept_children (this);
}
public override void visit_typeof_expression (TypeofExpression expr) {
expr.accept_children (this);
}
public override void visit_unary_expression (UnaryExpression expr) {
expr.accept_children (this);
}
public override void visit_cast_expression (CastExpression expr) {
expr.accept_children (this);
}
public override void visit_addressof_expression (AddressofExpression expr) {
expr.accept_children (this);
}
public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
expr.accept_children (this);
}
......@@ -525,6 +545,14 @@ public class Vala.SymbolResolver : CodeVisitor {
expr.accept_children (this);
}
public override void visit_type_check (TypeCheck expr) {
expr.accept_children (this);
}
public override void visit_conditional_expression (ConditionalExpression expr) {
expr.accept_children (this);
}
public override void visit_lambda_expression (LambdaExpression l) {
l.accept_children (this);
}
......
......@@ -66,15 +66,17 @@ public class Vala.TypeCheck : Expression {
}
public override void accept (CodeVisitor visitor) {
expression.accept (visitor);
type_reference.accept (visitor);
visitor.visit_type_check (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
expression.accept (visitor);
type_reference.accept (visitor);
}
public override bool is_pure () {
return expression.is_pure ();
}
......
......@@ -52,13 +52,15 @@ public class Vala.TypeofExpression : Expression {
}
public override void accept (CodeVisitor visitor) {
type_reference.accept (visitor);
visitor.visit_typeof_expression (this);
visitor.visit_expression (this);
}
public override void accept_children (CodeVisitor visitor) {
type_reference.accept (visitor);
}
public override bool is_pure () {
return true;
}
......
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