diff --git a/base/show.jl b/base/show.jl index ccdcdcc2d1c47..0bcac890f9c9c 100644 --- a/base/show.jl +++ b/base/show.jl @@ -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 diff --git a/test/show.jl b/test/show.jl index bbd3874f0350c..b0025663d538e 100644 --- a/test/show.jl +++ b/test/show.jl @@ -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)]" diff --git a/test/syntax.jl b/test/syntax.jl index f807415ce5cbd..ddc1e8c915fd8 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -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("(;,)")