julia
d2af9685 - Tweak SyntaxList constructor to accept tree elements (#61133)

Commit
52 days ago
Tweak SyntaxList constructor to accept tree elements (#61133) It should be easy to create known-length lists of trees without repeated `push!`ing, but it isn't, and desugaring is full of `x = SyntaxList(ctx); push!(x, st1); push!(x, st2)`. This change adds a `SyntaxList(::SyntaxTree...)` method. Previously, we had `SyntaxList(::SyntaxTree)` create an empty list in that tree's graph (but that method was mostly unused). This also matches other utilities where we'll often have one function taking SyntaxGraph+NodeId(s) and one taking SyntaxTree(s). We could also consider using `Vector{SyntaxTree}` instead (I'm not sure how much performance benefit there is to `SyntaxList` in the first place), though that would require some refactoring of all the existing stuff that takes SyntaxList.
Author
Parents
Loading