Skip to content

Commit 3459901

Browse files
committed
foo::(1)
1 parent 2a5c4a2 commit 3459901

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

lib/syntax_tree/parser.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,14 @@ def on_break(arguments)
761761
# (:call | Backtick | Const | Ident | Op) message
762762
# ) -> Call
763763
def on_call(receiver, operator, message)
764-
ending = message
765-
ending = operator if message == :call
764+
ending =
765+
if message != :call
766+
message
767+
elsif operator != :"::"
768+
operator
769+
else
770+
receiver
771+
end
766772

767773
Call.new(
768774
receiver: receiver,

test/fixtures/call.rb

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
%
2+
foo.bar
3+
%
4+
foo.()
5+
%
6+
foo::()
7+
-
8+
foo.()
9+
%
10+
foo.(1)
11+
%
12+
foo::(1)
13+
-
14+
foo.(1)

0 commit comments

Comments
 (0)