Skip to content

Commit 408dfac

Browse files
committed
fix import parsing again
1 parent 0f2212a commit 408dfac

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/components/internals.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ function parse_dot_mod(ps::ParseState, is_colon=false, allow_as=false)
415415
if kindof(ps.nt) === Tokens.DOT
416416
pushtotrivia!(ret, EXPR(next(ps)))
417417
if kindof(ps.nt) === Tokens.COLON
418-
next(ps)
419-
push!(ret, INSTANCE(next(ps)))
418+
u = parse_unary_colon(ps, EXPR(:IDENTIFIER, next(ps)))
419+
push!(ret, u)
420420
return ret
421421
end
422422
elseif isoperator(ps.nt) && (ps.nt.dotop || kindof(ps.nt) === Tokens.DOT)

src/conversion.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,15 @@ function to_codeobject(x::EXPR)
176176
elseif x.head isa EXPR
177177
Expr(to_codeobject(x.head), to_codeobject.(x.args)...)
178178
elseif x.head === :quotenode
179-
QuoteNode(to_codeobject(x.args[1]))
179+
# quote nodes in import/using are unwrapped by the Julia parser
180+
if x.parent isa EXPR &&
181+
x.parent.parent isa EXPR &&
182+
is_dot(x.parent.head) &&
183+
x.parent.parent.head in (:import, :using)
184+
to_codeobject(x.args[1])
185+
else
186+
QuoteNode(to_codeobject(x.args[1]))
187+
end
180188
elseif x.head === :globalrefdoc
181189
GlobalRef(Core, Symbol("@doc"))
182190
elseif x.head === :globalrefcmd

0 commit comments

Comments
 (0)