Skip to content

Commit 067fa53

Browse files
authored
Tweak JuliaSyntax import to allow being in Base (#58)
Changes I've been using for experiments. If we ever need to do anything more complex, it's worth looking at [what Compiler.jl does](https://github.com/JuliaLang/julia/blob/339656293405169c8021ea88615049a428413c2d/Compiler/src/Compiler.jl#L3)
1 parent f6227bd commit 067fa53

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/JuliaLowering.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ using Base
77
const _include = Base.IncludeInto(JuliaLowering)
88
using Core: eval
99

10-
using JuliaSyntax
11-
12-
using JuliaSyntax: highlight, Kind, @KSet_str
13-
using JuliaSyntax: is_leaf, children, numchildren, head, kind, flags, has_flags, numeric_flags
14-
using JuliaSyntax: filename, first_byte, last_byte, byte_range, sourcefile, source_location, span, sourcetext
10+
if parentmodule(JuliaLowering) === Base
11+
using Base.JuliaSyntax
12+
else
13+
using JuliaSyntax
14+
end
1515

16-
using JuliaSyntax: is_literal, is_number, is_operator, is_prec_assignment, is_prefix_call, is_infix_op_call, is_postfix_op_call, is_error
16+
using .JuliaSyntax: highlight, Kind, @KSet_str, is_leaf, children, numchildren,
17+
head, kind, flags, has_flags, numeric_flags, filename, first_byte,
18+
last_byte, byte_range, sourcefile, source_location, span, sourcetext,
19+
is_literal, is_number, is_operator, is_prec_assignment, is_prefix_call,
20+
is_infix_op_call, is_postfix_op_call, is_error
1721

1822
_include("kinds.jl")
1923
_register_kinds()

0 commit comments

Comments
 (0)