Class: Opal::Rewriters::BlockToIter

Inherits:
Base
  • Object
show all
Defined in:
opal/lib/opal/rewriters/block_to_iter.rb

Constant Summary

Constants inherited from Base

Opal::Rewriters::Base::DUMMY_LOCATION

Instance Attribute Summary

Attributes inherited from Base

#current_node

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #prepend_to_body, #process, #s, s

Instance Method Details

#on_block(node) ⇒ Object



7
8
9
10
11
12
13
14
# File 'opal/lib/opal/rewriters/block_to_iter.rb', line 7

def on_block(node)
  recvr, args, body = *super
  iter_node = s(:iter, args, body)
  recvr.updated(
    nil,
    recvr.children + [iter_node]
  )
end