]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Separate visiting switch sections from visiting switch statements
authorJürg Billeter <j@bitron.ch>
Sun, 30 Nov 2008 13:34:47 +0000 (13:34 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 30 Nov 2008 13:34:47 +0000 (13:34 +0000)
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

svn path=/trunk/; revision=2098

ChangeLog
gobject/valaccodecontrolflowmodule.vala
gobject/valaccodegenerator.vala
gobject/valaccodemodule.vala
vala/valanullchecker.vala
vala/valaswitchlabel.vala
vala/valaswitchstatement.vala
vala/valasymbolresolver.vala

index 4fc34f67ade0340c7589783e97d16f0f8a8cba9c..74e90ba93fedef2b7b30cd82b81e3dde3915a080 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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:
index bad51c28d825fff91b7d5474f3e41d7f6bb11970..82621e9d300633e78acb0c6c1453b4aef4e59b20 100644 (file)
@@ -177,6 +177,8 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
        }
 
        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;
@@ -212,6 +214,10 @@ public class Vala.CCodeControlFlowModule : CCodeMethodModule {
                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);
 
index ca9f8a1b1b30ee7e30d9d4419a9b675382066361..0f535d2cf1a1524d32424393695d5e2b3515a9a0 100644 (file)
@@ -175,6 +175,10 @@ public class Vala.CCodeGenerator : CodeGenerator {
                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);
        }
index bc49962d40233ad14eefee62d5e3b506314818fa..a4adeb956004b88be9f6793a9b0e1b137b9ff9bb 100644 (file)
@@ -172,6 +172,10 @@ public abstract class Vala.CCodeModule {
                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);
        }
index 81c3b9e5ca0d0a6ae286a5be5a338535c2d7f763..d2ba8245d5b4748b4c33ddacacf3f6b34ea9e378 100644 (file)
@@ -144,6 +144,10 @@ public class Vala.NullChecker : CodeVisitor {
                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);
        }
index 34f2ae6778e83dcdc1f1dfc0cc7edb6fceae592e..a778ce258d8e8b8bd54d09392f4fc338d75e1e43 100644 (file)
@@ -54,13 +54,15 @@ public class Vala.SwitchLabel : CodeNode {
        }
        
        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) {
index 559c94259772ff78cd2314eb5ea7786a60da5653..e3c272752044519cb4a9aa93dbcd6d1ef6fe859c 100644 (file)
@@ -73,8 +73,12 @@ public class Vala.SwitchStatement : CodeNode, Statement {
        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);
@@ -82,8 +86,6 @@ public class Vala.SwitchStatement : CodeNode, Statement {
                foreach (SwitchSection section in sections) {
                        section.accept (visitor);
                }
-
-               visitor.visit_switch_statement (this);
        }
 
        public override void replace_expression (Expression old_node, Expression new_node) {
index 2197df0020fb04ccbf7e60a2724179de25f0f849..ff0cb9346392adfd0e4084d7249063dbc0d5e7d0 100644 (file)
@@ -346,6 +346,10 @@ public class Vala.SymbolResolver : CodeVisitor {
                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);
        }