Skip to content

Commit 46ee307

Browse files
committed
More tiny fixes
1 parent 4667714 commit 46ee307

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/compat.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,21 @@ a pair (my_node_id, last_srcloc). Should not mutate `e`.
143143
number node to be associated with `e`.
144144
"""
145145
function _insert_convert_expr(@nospecialize(e), graph::SyntaxGraph, src::SourceAttrType)
146-
if e isa Symbol
147-
estr = String(e)
148-
st_k = K"Identifier"
149-
st_id = _insert_tree_node(graph, st_k, src)
150-
setattr!(graph, st_id, name_val=estr)
146+
if isnothing(e)
147+
st_id = _insert_tree_node(graph, K"core", src)
148+
setattr!(graph, st_id, name_val="nothing")
149+
return (st_id, src)
150+
elseif e isa Symbol
151+
st_id = _insert_tree_node(graph, K"Identifier", src)
152+
setattr!(graph, st_id, name_val=String(e))
151153
if !Base.isoperator(e) && !Base.is_valid_identifier(e)
152154
return _insert_var_str(st_id, graph, src)
153155
end
154156
return (st_id, src)
155157
elseif e isa LineNumberNode
156158
return (nothing, e)
157159
# elseif e isa QuoteNode
158-
# st_id = _insert_tree_node(graph, K"quote", src)
160+
# st_id = _insert_tree_node(graph, K"inert", src)
159161
# quote_child, _ = _insert_convert_expr(e.value, graph, src)
160162
# setchildren!(graph, st_id, NodeId[quote_child])
161163
# return (st_id, src)
@@ -353,6 +355,8 @@ function _insert_convert_expr(@nospecialize(e), graph::SyntaxGraph, src::SourceA
353355
(e)->(e.head = :importpath))
354356
elseif e.head === :kw
355357
st_k = K"="
358+
elseif e.head === Symbol("latestworld-if-toplevel")
359+
st_k = K"latestworld_if_toplevel"
356360
end
357361

358362
# Temporary heads introduced by converting the parent expr

0 commit comments

Comments
 (0)