Skip to content

Commit 68ff86f

Browse files
authored
correct printing of empty block inside ref (#34559)
1 parent 2d092a8 commit 68ff86f

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

base/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In
15901590
show_unquoted(io, ex.args[i], ind, -1, quote_level)
15911591
end
15921592
if length(ex.args) < 2
1593-
print(io, isempty(ex.args) ? "nothing;)" : ";)")
1593+
print(io, isempty(ex.args) ? ";;)" : ";)")
15941594
else
15951595
print(io, ')')
15961596
end

test/show.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,4 +1993,5 @@ end
19931993
@test repr(Base.remove_linenums!(:(a[begin, end, let x=1; (x+1;); end]))) ==
19941994
":(a[begin, end, let x = 1\n begin\n x + 1\n end\n end])"
19951995
@test_repr "a[(bla;)]"
1996+
@test_repr "a[(;;)]"
19961997
@weak_test_repr "a[x -> f(x)]"

test/syntax.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ macro test999_str(args...); args; end
172172
# blocks vs. tuples
173173
@test Meta.parse("()") == Expr(:tuple)
174174
@test_skip Meta.parse("(;)") == Expr(:tuple, Expr(:parameters))
175+
@test Meta.parse("(;;)") == Expr(:block)
175176
@test Meta.parse("(;;;;)") == Expr(:block)
176177
@test_throws ParseError Meta.parse("(,)")
177178
@test_throws ParseError Meta.parse("(;,)")

0 commit comments

Comments
 (0)