Skip to content

Commit fcdb960

Browse files
committed
Fully recurse into calls
1 parent 9e46ed6 commit fcdb960

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/utils.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ function _readable_code(ex)
9090
if ex.head === :call
9191
f, args = ex.args[1], ex.args[2:end]
9292
if f isa Function && (nf = nameof(f); Base.isoperator(nf))
93-
return Expr(:call, nf, args...)
93+
expr = Expr(:call, nf)
94+
for a in args
95+
push!(expr.args, _readable_code(a))
96+
end
97+
return expr
9498
end
9599
end
96100
expr = Expr(ex.head)
97-
expr.args = map(_readable_code, ex.args)
98-
Base.remove_linenums!(expr)
101+
for a in ex.args
102+
push!(expr.args, _readable_code(a))
103+
end
104+
expr
99105
end
100-
readable_code(expr) = JuliaFormatter.format_text(string(_readable_code(expr)))
106+
readable_code(expr) = JuliaFormatter.format_text(string(Base.remove_linenums!(_readable_code(expr))))

0 commit comments

Comments
 (0)