Skip to content

Commit

Permalink
correct printing of empty block inside ref (JuliaLang#34559)
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Jan 29, 2020
1 parent 2d092a8 commit 68ff86f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In
show_unquoted(io, ex.args[i], ind, -1, quote_level)
end
if length(ex.args) < 2
print(io, isempty(ex.args) ? "nothing;)" : ";)")
print(io, isempty(ex.args) ? ";;)" : ";)")
else
print(io, ')')
end
Expand Down
1 change: 1 addition & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1993,4 +1993,5 @@ end
@test repr(Base.remove_linenums!(:(a[begin, end, let x=1; (x+1;); end]))) ==
":(a[begin, end, let x = 1\n begin\n x + 1\n end\n end])"
@test_repr "a[(bla;)]"
@test_repr "a[(;;)]"
@weak_test_repr "a[x -> f(x)]"
1 change: 1 addition & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ macro test999_str(args...); args; end
# blocks vs. tuples
@test Meta.parse("()") == Expr(:tuple)
@test_skip Meta.parse("(;)") == Expr(:tuple, Expr(:parameters))
@test Meta.parse("(;;)") == Expr(:block)
@test Meta.parse("(;;;;)") == Expr(:block)
@test_throws ParseError Meta.parse("(,)")
@test_throws ParseError Meta.parse("(;,)")
Expand Down

0 comments on commit 68ff86f

Please sign in to comment.