Skip to content

Commit

Permalink
Merge pull request #8190 from JuliaLang/jcb/fixfkeyshow
Browse files Browse the repository at this point in the history
keyword function args were not getting displayed properly
  • Loading branch information
jakebolewski committed Sep 2, 2014
2 parents 5b960a7 + 370b640 commit d69c193
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,15 @@ function show_call(io::IO, head, func, func_args, indent)
show_unquoted(io, func, indent)
print(io, ')')
end
show_enclosed_list(io, op, func_args, ",", cl, indent)
if !isempty(func_args) && isa(func_args[1], Expr) && func_args[1].head === :parameters
print(io, op)
show_list(io, func_args[2:end], ',', indent, 0)
print(io, "; ")
show_list(io, func_args[1].args, ',', indent, 0)
print(io, cl)
else
show_enclosed_list(io, op, func_args, ",", cl, indent)
end
end

## AST printing ##
Expand Down
4 changes: 4 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ end"""
# unicode operator printing
@test sprint(show, :(1 (2 3))) == ":(1 ⊕ 2 ⊗ 3)"
@test sprint(show, :((1 2) 3)) == ":((1 ⊕ 2) ⊗ 3)"

# issue #8155
@test_repr "foo(x,y; z=bar)"
@test_repr "foo(x,y,z=bar)"

0 comments on commit d69c193

Please sign in to comment.