[vala/0.40] codewriter: Prepend "yield" if is_yield_expression is set on MethodCall/ObjectCreationExpression



commit da7ab84f193069cac817bd27e42d86e550e2a756
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 22 14:49:33 2018 +0200

    codewriter: Prepend "yield" if is_yield_expression is set on MethodCall/ObjectCreationExpression

 vala/valacodewriter.vala | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index cc63f5d8a..ff38630f6 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -1237,6 +1237,10 @@ public class Vala.CodeWriter : CodeVisitor {
        }
 
        public override void visit_method_call (MethodCall expr) {
+               if (expr.is_yield_expression) {
+                       write_string ("yield ");
+               }
+
                expr.call.accept (this);
                write_string (" (");
 
@@ -1293,6 +1297,10 @@ public class Vala.CodeWriter : CodeVisitor {
        }
 
        public override void visit_object_creation_expression (ObjectCreationExpression expr) {
+               if (expr.is_yield_expression) {
+                       write_string ("yield ");
+               }
+
                if (!expr.struct_creation) {
                        write_string ("new ");
                }


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