Sha256: 0c6a9b26734eab374e0c8701e55f91398e2699d11e9ea7224af9a7593f643a5b

Contents?: true

Size: 434 Bytes

Versions: 19

Compression:

Stored size: 434 Bytes

Contents

module Ruby2JS
  class Converter

    # (while-post
    #   (true)
    #   (kwbegin
    #     (...)))

    handle :while_post do |condition, block|
      block = block.updated(:begin) if block.type == :kwbegin
      begin
        next_token, @next_token = @next_token, :continue

        puts 'do {'; redoable block; sput '} while ('; parse condition; put ')'
      ensure
        @next_token = next_token
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ruby2js-5.1.1 lib/ruby2js/converter/whilepost.rb
ruby2js-5.1.0 lib/ruby2js/converter/whilepost.rb
ruby2js-5.0.1 lib/ruby2js/converter/whilepost.rb
ruby2js-5.0.0 lib/ruby2js/converter/whilepost.rb
ruby2js-4.2.2 lib/ruby2js/converter/whilepost.rb
ruby2js-4.2.1 lib/ruby2js/converter/whilepost.rb
ruby2js-4.2.0 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.7 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.6 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.5 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.4 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.3 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.2 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.1 lib/ruby2js/converter/whilepost.rb
ruby2js-4.1.0 lib/ruby2js/converter/whilepost.rb
ruby2js-4.0.5 lib/ruby2js/converter/whilepost.rb
ruby2js-4.0.4 lib/ruby2js/converter/whilepost.rb
ruby2js-4.0.3 lib/ruby2js/converter/whilepost.rb
ruby2js-4.0.2 lib/ruby2js/converter/whilepost.rb