Skip to content

Commit bea7bae

Browse files
committed
Change return Expr to Expr(:error, Expr(:., ...))
1 parent fc047f0 commit bea7bae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/expr.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,13 @@ function _internal_node_to_Expr(source, srcrange, head, childranges, childheads,
270270
if is_prefix_call(head)
271271
headsym = :.
272272
args = Any[startsym, Expr(:tuple, args[2:end]...)]
273-
elseif startsym isa Symbol
273+
else
274274
# operator calls
275275
headsym = :call
276-
args[1] = Symbol(:., startsym)
277-
end # else startsym could be an Expr(:error), just propagate it
276+
if startsym isa Symbol
277+
args[1] = Symbol(:., startsym)
278+
end # else startsym could be an Expr(:error), just propagate it
279+
end
278280
end
279281
if do_lambda isa Expr
280282
return Expr(:do, Expr(headsym, args...), do_lambda)

test/expr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466

467467
# Issue #341
468468
@test parsestmt("f(./x)", ignore_errors=true) == Expr(:call, :f,
469-
Expr(:dotcall,
469+
Expr(:call,
470470
Expr(:error, Expr(:., :/)),
471471
:x))
472472
end

0 commit comments

Comments
 (0)