File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,8 @@ function _incomplete_tag(n::SyntaxNode, codelen)
4545 return :none
4646 end
4747 end
48- if kind (c) == K " error" && begin
49- cs = children (c)
50- length (cs) > 0
51- end
52- for cc in cs
48+ if kind (c) == K " error" && numchildren (c) > 0
49+ for cc in children (c)
5350 if kind (cc) == K " error"
5451 return :other
5552 end
Original file line number Diff line number Diff line change @@ -223,10 +223,12 @@ function Base.copy(node::TreeNode)
223223 # copy the container but not the data (ie, deep copy the tree, shallow copy the data). copy(::Expr) is similar
224224 # copy "un-parents" the top-level `node` that you're copying
225225 newnode = typeof (node)(nothing , is_leaf (node) ? nothing : typeof (node)[], copy (node. data))
226- for child in children (node)
227- newchild = copy (child)
228- newchild. parent = newnode
229- push! (newnode, newchild)
226+ if ! is_leaf (node)
227+ for child in children (node)
228+ newchild = copy (child)
229+ newchild. parent = newnode
230+ push! (newnode, newchild)
231+ end
230232 end
231233 return newnode
232234end
You can’t perform that action at this time.
0 commit comments