Skip to content

Commit

Permalink
fix #30303, escaping $ when showing Symbols (#30304)
Browse files Browse the repository at this point in the history
* fix #30303, escaping $ when showing Symbols

* use repr instead of escape_string
  • Loading branch information
JeffBezanson authored and ararslan committed Dec 8, 2018
1 parent 4fc446f commit f0b9499
Show file tree
Hide file tree
Showing 2 changed files with 4 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 @@ -1031,7 +1031,7 @@ function show_unquoted_quote_expr(io::IO, @nospecialize(value), indent::Int, pre
print(io, ":")
print(io, value)
else
print(io, "Symbol(\"", escape_string(s), "\")")
print(io, "Symbol(", repr(s), ")")
end
else
if isa(value,Expr) && value.head === :block
Expand Down
3 changes: 3 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1416,3 +1416,6 @@ end
replstrcolor(x) = sprint((io, x) -> show(IOContext(io, :limit => true, :color => true),
MIME("text/plain"), x), x)
@test occursin("\e[", replstrcolor(`curl abc`))

# issue #30303
@test repr(Symbol("a\$")) == "Symbol(\"a\\\$\")"

2 comments on commit f0b9499

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.