[vala/0.48] vala: Set parent_node for child nodes of lambda-expression
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [vala/0.48] vala: Set parent_node for child nodes of lambda-expression
- Date: Sat, 29 Aug 2020 18:47:25 +0000 (UTC)
commit 2f718d3c27c7bdf74433ad0b23783504ac3eb4d8
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Aug 13 23:00:44 2020 +0200
    vala: Set parent_node for child nodes of lambda-expression
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/1062
 vala/valalambdaexpression.vala | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index f1c4ff803..f0ecd4ecc 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -34,13 +34,29 @@ public class Vala.LambdaExpression : Expression {
         * The expression body of this lambda expression. Only one of
         * expression_body or statement_body may be set.
         */
-       public Expression expression_body { get; set; }
+       public Expression expression_body {
+               get { return _expression_body; }
+               set {
+                       _expression_body = value;
+                       if (_expression_body != null) {
+                               _expression_body.parent_node = this;
+                       }
+               }
+       }
 
        /**
         * The statement body of this lambda expression. Only one of
         * expression_body or statement_body may be set.
         */
-       public Block statement_body { get; set; }
+       public Block statement_body {
+               get { return _statement_body; }
+               set {
+                       _statement_body = value;
+                       if (_statement_body != null) {
+                               _statement_body.parent_node = this;
+                       }
+               }
+       }
 
        /**
         * The generated method.
@@ -48,6 +64,8 @@ public class Vala.LambdaExpression : Expression {
        public Method method { get; set; }
 
        private List<Parameter> parameters = new ArrayList<Parameter> ();
+       Block _statement_body;
+       Expression _expression_body;
 
        /**
         * Creates a new lambda expression.
@@ -168,6 +186,7 @@ public class Vala.LambdaExpression : Expression {
                        }
                }
                method.owner = context.analyzer.current_symbol.scope;
+               method.parent_node = this;
 
                var lambda_params = get_parameters ();
                Iterator<Parameter> lambda_param_it = lambda_params.iterator ();
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]