Skip to content

Commit c137f41

Browse files
committed
Allow more types to pass through core_lowerer_hook
1 parent 23a5d78 commit c137f41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hooks.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ using JuliaSyntax
22
using JuliaLowering
33

44
# Becomes `Core._lower()` upon activating JuliaLowering. Returns an svec with
5-
# the lowered expr or linenode as its first element, and whatever we want after
6-
# it, until the API stabilizes
5+
# the lowered code (usually expr) as its first element, and whatever we want
6+
# after it, until the API stabilizes
77
function core_lowerer_hook(code, mod::Module, file="none", line=0, world=typemax(Csize_t), warn=false)
88
if Base.isexpr(code, :syntaxtree)
99
# Getting toplevel.c to check for types it doesn't know about is hard.
@@ -18,7 +18,8 @@ function core_lowerer_hook(code, mod::Module, file="none", line=0, world=typemax
1818
Falling back to flisp...""",
1919
code=code, file=file, line=line, mod=mod)
2020
return Base.fl_lower(code, mod, file, line, world, warn)
21-
elseif code isa LineNumberNode
21+
elseif !(code isa SyntaxTree)
22+
# LineNumberNode, Symbol, probably others...
2223
return Core.svec(code)
2324
end
2425
try

0 commit comments

Comments
 (0)