Like Enumerable#filter_map
, but chains operation to be lazy-evaluated.
(1..).lazy.filter_map { |i| i * 2 if i.even? }.first(5) #=> [4, 8, 12, 16, 20]
Compile a IntegerNode
node
attr_reader binary_operator_loc
: Location
attr_reader binary_operator_loc
: Location
Dispatch enter and leave events for IntegerNode
nodes and continue walking the tree.
Inspect a IntegerNode
node.
attr_reader call_operator_loc
: Location
?
When a call node has the attribute_write flag set, it means that the call is using the attribute write syntax. This is either a method call to []= or a method call to a method that ends with =. Either way, the = sign is present in the source.
Prism
returns the message_loc
without the = sign attached, because there can be any amount of space between the message and the = sign. However, sometimes you want the location of the full message including the inner space and the = sign. This method provides that.