[vala/staging] vala: Implement CodeWriter.visit_foreach_statement()



commit 0a53d37ee12797944ffdf9fbd710f36d1ff64e39
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Oct 23 15:27:12 2021 +0200

    vala: Implement CodeWriter.visit_foreach_statement()

 vala/valacodewriter.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 2b9e19030..3e651fd72 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -1141,6 +1141,15 @@ public class Vala.CodeWriter : CodeVisitor {
        }
 
        public override void visit_foreach_statement (ForeachStatement stmt) {
+               write_indent ();
+               write_string ("foreach (");
+               write_type (stmt.type_reference);
+               write_string (" ");
+               write_string (stmt.variable_name);
+               write_string (" in ");
+               stmt.collection.accept (this);
+               write_string (")");
+               stmt.body.accept (this);
        }
 
        public override void visit_break_statement (BreakStatement stmt) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]