Skip to content

Commit d541446

Browse files
committed
Fix setattr!
1 parent 1888bb4 commit d541446

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/syntax_graph.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,13 @@ function copy_node(ex::SyntaxTree)
252252
if !is_leaf(ex)
253253
setchildren!(graph, id, _node_ids(graph, children(ex)...))
254254
end
255-
SyntaxTree(graph, id)
255+
ex2 = SyntaxTree(graph, id)
256+
copy_attrs!(ex2, ex, true)
257+
ex2
256258
end
257259

258260
function setattr(ex::SyntaxTree; extra_attrs...)
259261
ex2 = copy_node(ex)
260-
copy_attrs!(ex2, ex, true)
261262
setattr!(ex2; extra_attrs...)
262263
ex2
263264
end

0 commit comments

Comments
 (0)