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-2.1.0 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.18 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.17 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.16 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.15 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.14 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.13 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.12 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.11 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.10 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.9 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.8 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.7 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.6 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.5 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.4 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.3 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.2 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.1 lib/ruby2js/converter/whilepost.rb
ruby2js-2.0.0 lib/ruby2js/converter/whilepost.rb