+2008-11-30 Jürg Billeter <j@bitron.ch>
+
+ * vala/valanullchecker.vala:
+ * vala/valaswitchlabel.vala:
+ * vala/valaswitchstatement.vala:
+ * vala/valasymbolresolver.vala:
+ * gobject/valaccodecontrolflowmodule.vala:
+ * gobject/valaccodegenerator.vala:
+ * gobject/valaccodemodule.vala:
+
+ Separate visiting switch sections from visiting switch statements
+
2008-11-30 Jürg Billeter <j@bitron.ch>
* vala/valamemberaccess.vala:
}
public override void visit_switch_statement (SwitchStatement stmt) {
+ stmt.accept_children (codegen);
+
if (stmt.expression.value_type.compatible (string_type)) {
visit_string_switch_statement (stmt);
return;
visit_block (section);
}
+ public override void visit_switch_label (SwitchLabel label) {
+ label.accept_children (codegen);
+ }
+
public override void visit_while_statement (WhileStatement stmt) {
stmt.accept_children (codegen);
head.visit_switch_section (section);
}
+ public override void visit_switch_label (SwitchLabel label) {
+ head.visit_switch_label (label);
+ }
+
public override void visit_while_statement (WhileStatement stmt) {
head.visit_while_statement (stmt);
}
next.visit_switch_section (section);
}
+ public virtual void visit_switch_label (SwitchLabel label) {
+ next.visit_switch_label (label);
+ }
+
public virtual void visit_while_statement (WhileStatement stmt) {
next.visit_while_statement (stmt);
}
check_non_null (stmt.condition);
}
+ public override void visit_switch_statement (SwitchStatement stmt) {
+ stmt.accept_children (this);
+ }
+
public override void visit_switch_section (SwitchSection section) {
section.accept_children (this);
}
}
public override void accept (CodeVisitor visitor) {
+ visitor.visit_switch_label (this);
+ }
+
+ public override void accept_children (CodeVisitor visitor) {
if (expression != null) {
expression.accept (visitor);
visitor.visit_end_full_expression (expression);
}
-
- visitor.visit_switch_label (this);
}
public override bool check (SemanticAnalyzer analyzer) {
public Gee.List<SwitchSection> get_sections () {
return new ReadOnlyList<SwitchSection> (sections);
}
-
+
public override void accept (CodeVisitor visitor) {
+ visitor.visit_switch_statement (this);
+ }
+
+ public override void accept_children (CodeVisitor visitor) {
expression.accept (visitor);
visitor.visit_end_full_expression (expression);
foreach (SwitchSection section in sections) {
section.accept (visitor);
}
-
- visitor.visit_switch_statement (this);
}
public override void replace_expression (Expression old_node, Expression new_node) {
stmt.accept_children (this);
}
+ public override void visit_switch_statement (SwitchStatement stmt) {
+ stmt.accept_children (this);
+ }
+
public override void visit_switch_section (SwitchSection section) {
section.accept_children (this);
}