Skip to content

Commit ffe50e9

Browse files
committed
show: print var"ccall" correctly
1 parent 3812880 commit ffe50e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

base/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,10 +1779,10 @@ function show_enclosed_list(io::IO, op, items, sep, cl, indent, prec=0, quote_le
17791779
end
17801780

17811781
const keyword_syms = Set([
1782-
:baremodule, :begin, :break, :catch, :const, :continue, :do, :else, :elseif,
1782+
:baremodule, :begin, :break, :catch, :ccall, :const, :continue, :do, :else, :elseif,
17831783
:end, :export, :var"false", :finally, :for, :function, :global, :if, :import,
17841784
:let, :local, :macro, :module, :public, :quote, :return, :struct, :var"true",
1785-
:try, :using, :while ])
1785+
:try, :using, :while])
17861786

17871787
function is_valid_identifier(sym)
17881788
return (isidentifier(sym) && !(sym in keyword_syms)) ||

test/show.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,6 +2876,7 @@ end
28762876
# Issue 56936
28772877
@testset "code printing of var\"keyword\" identifiers" begin
28782878
@test_repr """:(var"do" = 1)"""
2879+
@test_repl """:(var"ccall" = 1)"""
28792880
@weak_test_repr """:(let var"let" = 1; var"let"; end)"""
28802881
end
28812882

0 commit comments

Comments
 (0)