-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Simple enough example, from test/mri/ruby/test_call.rb's test_safe_call_block_*:
[] ~/projects/jruby $ ast -e '"a".sub! "b" do end&.foo 1'
AST:
RootNode 0
CallNode:foo 0
CallNode:sub! 0
StrNode 0
ArrayNode 0
StrNode 0
IterNode 0
ArgsNode 0
ListNode 0
ListNode 0
ListNode 0
ListNode 0
ArrayNode 0
FixnumNode 0
, null
Note that the curly form does get recognized as a lazy call:
[] ~/projects/jruby $ ast -e '"a".sub!("b"){}&.foo 1'
AST:
RootNode 0
CallNode[lazy]:foo 0
CallNode:sub! 0
StrNode 0
ArrayNode 0
StrNode 0
IterNode 0
ArgsNode 0
ListNode 0
ListNode 0
ListNode 0
ListNode 0
ArrayNode 0
FixnumNode 0
, null
Reactions are currently unavailable