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



commit ad6f41b6a947dfe341981630a1035f3d4d35259d
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 61dd5c780..6051009e7 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -1220,6 +1220,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 (" (");
 
@@ -1276,6 +1280,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]