Skip to content

Commit 89fdf02

Browse files
committed
Change printing of K"latestworld"
Parens are nice, but it wasn't consistent. Also make it a leaf (remaining non-leaves are deleted in the next commit.)
1 parent 8a52e0c commit 89fdf02

File tree

13 files changed

+266
-266
lines changed

13 files changed

+266
-266
lines changed

src/ast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function makeleaf(ctx, srcref, k::Kind, value; kws...)
150150
makeleaf(graph, srcref, k; id=value, kws...)
151151
elseif k == K"symbolic_label"
152152
makeleaf(graph, srcref, k; name_val=value, kws...)
153-
elseif k == K"TOMBSTONE" || k == K"SourceLocation"
153+
elseif k in KSet"TOMBSTONE SourceLocation latestworld latestworld_if_toplevel"
154154
makeleaf(graph, srcref, k; kws...)
155155
else
156156
val = k == K"Integer" ? convert(Int, value) :

src/closure_conversion.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function _convert_closures(ctx::ClosureConversionCtx, ex)
391391
type_for_closure(ctx, ex, name_str, field_syms, field_is_box)
392392
if !ctx.is_toplevel_seq_point
393393
push!(ctx.toplevel_stmts, closure_type_def)
394-
push!(ctx.toplevel_stmts, @ast ctx ex [K"latestworld_if_toplevel"])
394+
push!(ctx.toplevel_stmts, @ast ctx ex (::K"latestworld_if_toplevel"))
395395
closure_type_def = nothing
396396
end
397397
closure_info = ClosureInfo(closure_type_, field_syms, field_inds)
@@ -416,7 +416,7 @@ function _convert_closures(ctx::ClosureConversionCtx, ex)
416416
end
417417
@ast ctx ex [K"block"
418418
closure_type_def
419-
[K"latestworld_if_toplevel"]
419+
(::K"latestworld_if_toplevel")
420420
closure_type := if isempty(type_params)
421421
closure_type_
422422
else

src/desugaring.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ function expand_call(ctx, ex)
18531853
expand_forms_2(ctx, farg)
18541854
expand_forms_2(ctx, args)...
18551855
]]
1856-
[K"latestworld_if_toplevel"]
1856+
(::K"latestworld_if_toplevel")
18571857
r
18581858
]
18591859
else

src/syntax_graph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ function _value_string(ex)
431431
k == K"Symbol" ? ":$(ex.name_val)" :
432432
k == K"globalref" ? "$(ex.mod).$(ex.name_val)" :
433433
k == K"slot" ? "slot" :
434-
k == K"latestworld" ? "(latestworld)" :
434+
k == K"latestworld" ? "latestworld" :
435435
k == K"static_parameter" ? "static_parameter" :
436436
k == K"symbolic_label" ? "label:$(ex.name_val)" :
437437
k == K"symbolic_goto" ? "goto:$(ex.name_val)" :

test/assignments_ir.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ begin
4646
end
4747
#---------------------
4848
1 (method TestMod.b)
49-
2 (latestworld)
49+
2 latestworld
5050
3 TestMod.b
5151
4 (call core.Typeof %₃)
5252
5 (call core.svec %₄)
@@ -58,7 +58,7 @@ end
5858
1 TestMod.d
5959
2 (= slot₂/c %₁)
6060
3 (return %₁)
61-
10 (latestworld)
61+
10 latestworld
6262
11 TestMod.b
6363
12 (= slot₁/a %₁₁)
6464
13 (return %₁₁)
@@ -143,7 +143,7 @@ X{T} = Y{T,T}
143143
7 (call core.apply_type %%%₆)
144144
8 (call core.UnionAll %%₇)
145145
9 (constdecl TestMod.X %₈)
146-
10 (latestworld)
146+
10 latestworld
147147
11 (return %₈)
148148

149149
########################################
@@ -161,7 +161,7 @@ end
161161
7 (call core.apply_type %%%₆)
162162
8 (call core.UnionAll %%₇)
163163
9 (= slot₁/X %₈)
164-
10 (latestworld)
164+
10 latestworld
165165
11 (return %₈)
166166

167167
########################################

0 commit comments

Comments
 (0)