Skip to content

Commit

Permalink
Fixed child-parent reation of SyntaxList elements (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyelle authored Sep 20, 2024
1 parent 8a74a46 commit d2eae35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Draco.Compiler/Api/Syntax/SeparatedSyntaxList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.Compiler/Api/Syntax/SyntaxList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d2eae35

Please sign in to comment.