Sha256: c16caff2af4710cab4cb8222bee45ffe43d66a53243cbffcf9dbcf777be08f59

Contents?: true

Size: 337 Bytes

Versions: 7

Compression:

Stored size: 337 Bytes

Contents

# frozen_string_literal: true
require 'opal/rewriters/base'

module Opal
  module Rewriters
    class BlockToIter < Base
      def on_block(node)
        recvr, args, body = *super
        iter_node = s(:iter, args, body)
        recvr.updated(
          nil,
          recvr.children + [iter_node]
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opal-0.11.4 lib/opal/rewriters/block_to_iter.rb
opal-0.11.3 lib/opal/rewriters/block_to_iter.rb
opal-0.11.2 lib/opal/rewriters/block_to_iter.rb
opal-0.11.1 lib/opal/rewriters/block_to_iter.rb
opal-0.11.1.pre lib/opal/rewriters/block_to_iter.rb
opal-0.11.0 lib/opal/rewriters/block_to_iter.rb
opal-0.11.0.rc1 lib/opal/rewriters/block_to_iter.rb