Skip to content

Commit 66f7eba

Browse files
Liozouc42f
andcommitted
Simplify test and rename startsym to funcname
Co-authored-by: Claire Foster <aka.c42f@gmail.com>
1 parent 438b060 commit 66f7eba

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/expr.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,16 @@ function _internal_node_to_Expr(source, srcrange, head, childranges, childheads,
266266
# Move parameters blocks to args[2]
267267
_reorder_parameters!(args, 2)
268268
if headsym === :dotcall
269-
startsym = args[1]
269+
funcname = args[1]
270270
if is_prefix_call(head)
271271
headsym = :.
272-
args = Any[startsym, Expr(:tuple, args[2:end]...)]
272+
args = Any[funcname, Expr(:tuple, args[2:end]...)]
273273
else
274274
# operator calls
275275
headsym = :call
276-
if startsym isa Symbol
277-
args[1] = Symbol(:., startsym)
278-
end # else startsym could be an Expr(:error), just propagate it
276+
if funcname isa Symbol
277+
args[1] = Symbol(:., funcname)
278+
end # else funcname could be an Expr(:error), just propagate it
279279
end
280280
end
281281
if do_lambda isa Expr

test/expr.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,7 @@
465465
@test parsestmt("A.:.+") == Expr(:., :A, QuoteNode(Symbol(".+")))
466466

467467
# Issue #341
468-
@test parsestmt("f(./x)", ignore_errors=true) == Expr(:call, :f,
469-
Expr(:call,
470-
Expr(:error, Expr(:., :/)),
471-
:x))
468+
@test parsestmt("./x", ignore_errors=true) == Expr(:call, Expr(:error, Expr(:., :/)), :x)
472469
end
473470

474471
@testset "let" begin

0 commit comments

Comments
 (0)