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



commit 25bd224334f7d7d84a155753b5920a360bf8f10e
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 a65956133..b80e99b6c 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]