@@ -412,18 +412,27 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
412
412
413
413
# binary operator (i.e. "x + y")
414
414
elseif func in bin_ops
415
- sep = func_prec >= bin_op_precs[:(^ )] ? " $func " : " $func "
416
- if func_prec <= prec
417
- show_enclosed_list (io, ' (' , func_args, sep, ' )' , indent, func_prec)
415
+ if length (func_args) > 1
416
+ sep = func_prec >= bin_op_precs[:(^ )] ? " $func " : " $func "
417
+ if func_prec <= prec
418
+ show_enclosed_list (io, ' (' , func_args, sep, ' )' , indent, func_prec)
419
+ else
420
+ show_list (io, func_args, sep, indent, func_prec)
421
+ end
418
422
else
419
- show_list (io, func_args, sep, indent, func_prec)
423
+ # 1-argument call to normally-binary operator
424
+ op, cl = expr_calls[head]
425
+ print (io, " (" )
426
+ show_unquoted (io, func, indent)
427
+ print (io, " )" )
428
+ show_enclosed_list (io, op, func_args, " ," , cl, indent)
420
429
end
421
430
422
431
# normal function (i.e. "f(x,y)")
423
432
else
424
433
op, cl = expr_calls[head]
425
- show_unquoted (io, args[ 1 ] , indent)
426
- show_enclosed_list (io, op, args[ 2 : end ] , " ," , cl, indent)
434
+ show_unquoted (io, func , indent)
435
+ show_enclosed_list (io, op, func_args , " ," , cl, indent)
427
436
end
428
437
elseif is (head, :ccall )
429
438
show_unquoted (io, :ccall , indent)
0 commit comments