@@ -247,6 +247,7 @@ const uni_ops = Set{Symbol}([:(+), :(-), :(!), :(¬), :(~), :(<:), :(>:), :(√)
247
247
const expr_infix_wide = Set ([:(= ), :(+= ), :(-= ), :(*= ), :(/= ), :(\= ), :(&= ),
248
248
:(|= ), :($= ), :(>>>= ), :(>>= ), :(<<= ), :(&& ), :(|| ), :(< :), :(=> )])
249
249
const expr_infix = Set ([:(:), :(-> ), symbol (" ::" )])
250
+ const expr_infix_any = union (expr_infix, expr_infix_wide)
250
251
const expr_calls = Dict (:call => (' (' ,' )' ), :calldecl => (' (' ,' )' ), :ref => (' [' ,' ]' ), :curly => (' {' ,' }' ))
251
252
const expr_parens = Dict (:tuple => (' (' ,' )' ), :vcat => (' [' ,' ]' ), :cell1d => (" Any[" ," ]" ),
252
253
:hcat => (' [' ,' ]' ), :row => (' [' ,' ]' ))
@@ -423,15 +424,13 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
423
424
end
424
425
425
426
# infix (i.e. "x<:y" or "x = y")
426
- elseif (head in expr_infix && nargs== 2 ) || (is (head,:(:)) && nargs== 3 )
427
- show_list (io, args, head, indent, 0 , true )
428
-
429
- elseif head in expr_infix_wide && nargs == 2
427
+ elseif (head in expr_infix_any && nargs== 2 ) || (is (head,:(:)) && nargs== 3 )
430
428
func_prec = operator_precedence (head)
429
+ head_ = head in expr_infix_wide ? " $head " : head
431
430
if func_prec < prec
432
- show_enclosed_list (io, ' (' , args, " $head " , ' )' , indent, func_prec, true )
431
+ show_enclosed_list (io, ' (' , args, head_ , ' )' , indent, func_prec, true )
433
432
else
434
- show_list (io, args, " $head " , indent, func_prec, true )
433
+ show_list (io, args, head_ , indent, func_prec, true )
435
434
end
436
435
437
436
# list (i.e. "(1,2,3)" or "[1,2,3]")
0 commit comments