We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ae4022 commit 84e5776Copy full SHA for 84e5776
src/types.jl
@@ -359,14 +359,15 @@ end
359
setargs(t, args) = Term{symtype(t)}(operation(t), args)
360
cdrargs(args) = setargs(t, cdr(args))
361
362
-print_arg(io, f, n::Union{Complex, Rational}) = print(io, "(", n, ")")
363
-print_arg(io, f::typeof(^), n) = print(IOContext(io, :paren=>true), n)
364
-function print_arg(io, f, n)
365
- f !== (*) && return print(io, n)
366
- if istree(n) && Base.isbinaryoperator(nameof(operation(n)))
367
- print(IOContext(io, :paren=>true), n)
+print_arg(io, x::Union{Complex, Rational}) = print(io, "(", x, ")")
+print_arg(io, x) = print(io, x)
+print_arg(io, f::typeof(^), x) = print_arg(IOContext(io, :paren=>true), x)
+function print_arg(io, f, x)
+ f !== (*) && return print_arg(io, x)
+ if istree(x) && Base.isbinaryoperator(nameof(operation(x)))
368
+ print_arg(IOContext(io, :paren=>true), x)
369
else
- print(io, n)
370
+ print_arg(io, x)
371
end
372
373
0 commit comments