Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,10 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In
# scalar multiplication (i.e. "100x")
elseif (func === :* &&
length(func_args) == 2 && isa(func_args[1], Union{Int, Int64, Float32, Float64}) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
length(func_args) == 2 && isa(func_args[1], Union{Int, Int64, Float32, Float64}) &&
length(func_args) == 2 && isa(func_args[1], Union{Int32, Int64, Float32, Float64}) &&

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, I assume this might have been intentional

isa(func_args[2], Symbol) && !in(string(func_args[2]::Symbol)[1], ('e', 'E', 'f')))
isa(func_args[2], Symbol) &&
!in(string(func_args[2]::Symbol)[1], ('e', 'E', 'f', (func_args[1] == 0 && func_args[1] isa Integer ?
# don't juxtapose 0 with b, o, x
('b', 'o', 'x') : ())...)))
if func_prec <= prec
show_enclosed_list(io, '(', func_args, "", ')', indent, func_prec, quote_level)
else
Expand Down
5 changes: 4 additions & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ for ex in [Expr(:call, :f, Expr(:(=), :x, 1)),
Expr(:call, :+, :n, Expr(:kw, :x, 1)),
:((a=1,; $(Expr(:(=), :x, 2)))),
:(($(Expr(:(=), :a, 1)),; x = 2)),
Expr(:tuple, Expr(:parameters))]
Expr(:tuple, Expr(:parameters)),
Expr(:call, :*, 0, :x01),
Expr(:call, :*, 0, :b01),
Expr(:call, :*, 0, :o01)]
@test eval(Meta.parse(repr(ex))) == ex
end

Expand Down