Skip to content

Commit 1888bb4

Browse files
committed
symboliclabel, symbolicgoto
1 parent 7a7abc6 commit 1888bb4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/compat.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,12 @@ function _insert_convert_expr(@nospecialize(e), graph::SyntaxGraph, src::SourceA
247247
# Existing behaviour appears to just ignore any extra args
248248
return _insert_convert_expr(e.args[1], graph, src)
249249
elseif e.head === :meta
250+
# Messy and undocumented. Sometimes we want a K"meta".
250251
@assert e.args[1] isa Symbol
251252
if e.args[1] === :nospecialize
252253
if nargs > 2
253254
st_k = K"block"
254-
# Kick the can down the road
255+
# Kick the can down the road (should only be simple atoms?)
255256
child_exprs = map(c->Expr(:meta, :nospecialize, c), child_exprs[2:end])
256257
else
257258
st_id, src = _insert_convert_expr(e.args[2], graph, src)
@@ -374,6 +375,12 @@ function _insert_convert_expr(@nospecialize(e), graph::SyntaxGraph, src::SourceA
374375
st_k = K"="
375376
elseif e.head === Symbol("latestworld-if-toplevel")
376377
st_k = K"latestworld_if_toplevel"
378+
elseif e.head === :symbolicgoto || e.head === :symboliclabel
379+
@assert nargs === 1
380+
st_k = e.head === :symbolicgoto ? K"symbolic_label" : K"symbolic_goto"
381+
st_id = _insert_tree_node(graph, st_k, src)
382+
setattr!(graph, st_id, name_val=string(e.args[1]))
383+
return (st_id, src)
377384
end
378385

379386
# Temporary heads introduced by converting the parent expr

0 commit comments

Comments
 (0)