@@ -407,7 +407,8 @@ const expr_infix_wide = Set{Symbol}([
407
407
const expr_infix = Set {Symbol} ([:(:), :(-> ), Symbol (" ::" )])
408
408
const expr_infix_any = union (expr_infix, expr_infix_wide)
409
409
const all_ops = union (quoted_syms, uni_ops, expr_infix_any)
410
- const expr_calls = Dict (:call => (' (' ,' )' ), :calldecl => (' (' ,' )' ), :ref => (' [' ,' ]' ), :curly => (' {' ,' }' ))
410
+ const expr_calls = Dict (:call => (' (' ,' )' ), :calldecl => (' (' ,' )' ),
411
+ :ref => (' [' ,' ]' ), :curly => (' {' ,' }' ), :(.) => (' (' ,' )' ))
411
412
const expr_parens = Dict (:tuple => (' (' ,' )' ), :vcat => (' [' ,' ]' ),
412
413
:hcat => (' [' ,' ]' ), :row => (' [' ,' ]' ), :vect => (' [' ,' ]' ))
413
414
@@ -538,6 +539,9 @@ function show_call(io::IO, head, func, func_args, indent)
538
539
show_unquoted (io, func, indent)
539
540
print (io, ' )' )
540
541
end
542
+ if head == :(.)
543
+ print (io, ' .' )
544
+ end
541
545
if ! isempty (func_args) && isa (func_args[1 ], Expr) && func_args[1 ]. head === :parameters
542
546
print (io, op)
543
547
show_list (io, func_args[2 : end ], ' ,' , indent)
@@ -648,8 +652,8 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
648
652
if ! emphstate && ex. typ === Any
649
653
show_type = false
650
654
end
651
- # dot (i.e. "x.y")
652
- if is (head, :(.))
655
+ # dot (i.e. "x.y"), but not compact broadcast exps
656
+ if is (head, :(.)) && ! is_expr (args[ 2 ], :tuple )
653
657
show_unquoted (io, args[1 ], indent + indent_width)
654
658
print (io, ' .' )
655
659
if is_quoted (args[2 ])
@@ -750,9 +754,10 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
750
754
show_call (io, head, func, func_args, indent)
751
755
end
752
756
753
- # other call-like expressions ("A[1,2]", "T{X,Y}")
754
- elseif haskey (expr_calls, head) && nargs >= 1 # :ref/:curly/:calldecl
755
- show_call (io, head, ex. args[1 ], ex. args[2 : end ], indent)
757
+ # other call-like expressions ("A[1,2]", "T{X,Y}", "f.(X,Y)")
758
+ elseif haskey (expr_calls, head) && nargs >= 1 # :ref/:curly/:calldecl/:(.)
759
+ funcargslike = head == :(.) ? ex. args[2 ]. args : ex. args[2 : end ]
760
+ show_call (io, head, ex. args[1 ], funcargslike, indent)
756
761
757
762
# comprehensions
758
763
elseif (head === :typed_comprehension || head === :typed_dict_comprehension ) && length (args) == 2
0 commit comments