From d2eae35c8c81425911e0b044323b292b35c6e34e Mon Sep 17 00:00:00 2001 From: lucyelle <35396043+lucyelle@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:17:53 +0200 Subject: [PATCH] Fixed child-parent reation of SyntaxList elements (#484) --- src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs | 2 +- src/Draco.Compiler/Api/Syntax/SyntaxList.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs b/src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs index 3f7223902..b2e2dcd54 100644 --- a/src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs +++ b/src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs @@ -75,7 +75,7 @@ private SyntaxNode GetNodeAt(int index) var prevWidth = this.GreenList .Take(index) .Sum(g => g.FullWidth); - return this.GreenList[index].ToRedNode(this.Tree, this.Parent, this.FullPosition + prevWidth); + return this.GreenList[index].ToRedNode(this.Tree, this, this.FullPosition + prevWidth); }); return existing; } diff --git a/src/Draco.Compiler/Api/Syntax/SyntaxList.cs b/src/Draco.Compiler/Api/Syntax/SyntaxList.cs index 33c16bf85..8d70112ad 100644 --- a/src/Draco.Compiler/Api/Syntax/SyntaxList.cs +++ b/src/Draco.Compiler/Api/Syntax/SyntaxList.cs @@ -41,7 +41,7 @@ public TNode this[int index] var prevWidth = this.GreenList .Take(index) .Sum(g => g.FullWidth); - return this.GreenList[index].ToRedNode(this.Tree, this.Parent, this.FullPosition + prevWidth); + return this.GreenList[index].ToRedNode(this.Tree, this, this.FullPosition + prevWidth); }); return (TNode)existing; }