Skip to content

Commit 6a113fc

Browse files
authored
Fix lowering of @. to @__dot__ in using A: @. (#178)
1 parent 7c29bc2 commit 6a113fc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/expr.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
4848
return GlobalRef(Core, :var"@doc")
4949
elseif kind(node) == K"core_@cmd"
5050
return GlobalRef(Core, :var"@cmd")
51+
elseif kind(node) == K"MacroName" && val === Symbol("@.")
52+
return Symbol("@__dot__")
5153
else
5254
return val
5355
end
@@ -152,9 +154,6 @@ function _to_expr(node::SyntaxNode; iteration_spec=false, need_linenodes=true,
152154
# Special cases for various expression heads
153155
loc = source_location(LineNumberNode, node.source, node.position)
154156
if headsym === :macrocall
155-
if args[1] == Symbol("@.")
156-
args[1] = Symbol("@__dot__")
157-
end
158157
reorder_parameters!(args, 2)
159158
insert!(args, 2, loc)
160159
elseif headsym in (:dotcall, :call)

test/expr.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,6 @@
261261
Expr(:parameters, Expr(:kw, :b, 2)), Expr(:(=), :a, 1))
262262
# @__dot__
263263
@test parse(Expr, "@.") == Expr(:macrocall, Symbol("@__dot__"), LineNumberNode(1))
264+
@test parse(Expr, "using A: @.") == Expr(:using, Expr(Symbol(":"), Expr(:., :A), Expr(:., Symbol("@__dot__"))))
264265
end
265266
end

0 commit comments

Comments
 (0)