diff options
author | Jürg Billeter <j@bitron.ch> | 2010-08-07 16:50:40 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-08-10 09:02:53 +0200 |
commit | 8b57dfaf55208cad985cb6ff023aed0c3841d876 (patch) | |
tree | 9fce3b9ba6d9b9b6d7adb6b853656273ba908908 /vala/valaforeachstatement.vala | |
parent | 92cb97f4f806fb6362834bf218e8021453c22f07 (diff) | |
download | vala-8b57dfaf55208cad985cb6ff023aed0c3841d876.tar.gz |
Use emit instead of accept and accept_children in code generator
Diffstat (limited to 'vala/valaforeachstatement.vala')
-rw-r--r-- | vala/valaforeachstatement.vala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index 07a38dbec..bc0cf3d07 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -348,6 +348,24 @@ public class Vala.ForeachStatement : Block { return !error; } + public override void emit (CodeGenerator codegen) { + if (use_iterator) { + base.emit (codegen); + return; + } + + collection.emit (codegen); + codegen.visit_end_full_expression (collection); + + element_variable.active = true; + collection_variable.active = true; + if (iterator_variable != null) { + iterator_variable.active = true; + } + + codegen.visit_foreach_statement (this); + } + public override void get_defined_variables (Collection<LocalVariable> collection) { collection.add (element_variable); } |