diff --git a/src/syntax_tree.jl b/src/syntax_tree.jl index 608b9ce4..12db89dd 100644 --- a/src/syntax_tree.jl +++ b/src/syntax_tree.jl @@ -108,6 +108,7 @@ end haschildren(node::TreeNode) = node.children !== nothing children(node::TreeNode) = (c = node.children; return c === nothing ? () : c) +numchildren(node::TreeNode) = (isnothing(node.children) ? 0 : length(node.children)) """