Sha256: b2ab2cfea5a342854b313e3cbe6607bb36e85d0d1422a90b5ff405c35299727c

Contents?: true

Size: 431 Bytes

Versions: 80

Compression:

Stored size: 431 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 {'; scope block; sput '} while ('; parse condition; put ')'
      ensure
        @next_token = next_token
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
ruby2js-4.0.1 lib/ruby2js/converter/whilepost.rb
ruby2js-4.0.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.6.1 lib/ruby2js/converter/whilepost.rb
ruby2js-3.6.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.5.3 lib/ruby2js/converter/whilepost.rb
ruby2js-3.5.2 lib/ruby2js/converter/whilepost.rb
ruby2js-3.5.1 lib/ruby2js/converter/whilepost.rb
ruby2js-3.5.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.4.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.6 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.5 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.4 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.3 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.2 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.1 lib/ruby2js/converter/whilepost.rb
ruby2js-3.3.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.2.0 lib/ruby2js/converter/whilepost.rb
ruby2js-3.1.2 lib/ruby2js/converter/whilepost.rb
ruby2js-3.1.1 lib/ruby2js/converter/whilepost.rb
ruby2js-3.1.0 lib/ruby2js/converter/whilepost.rb