Sha256: 562866511e63faa87e49f29fce6aa429e3f3e1cab274303070767ac3c10d1ddb

Contents?: true

Size: 327 Bytes

Versions: 22

Compression:

Stored size: 327 Bytes

Contents

module Ruby2JS
  class Converter

    # (while
    #   (true)
    #   (...))

    handle :while do |condition, block|
      begin
        next_token, @next_token = @next_token, :continue
        "while (#{ parse condition }) {#@nl#{ scope block }#@nl}"
      ensure
        @next_token = next_token
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruby2js-1.15.1 lib/ruby2js/converter/while.rb
ruby2js-1.15.0 lib/ruby2js/converter/while.rb
ruby2js-1.14.1 lib/ruby2js/converter/while.rb
ruby2js-1.14.0 lib/ruby2js/converter/while.rb
ruby2js-1.13.1 lib/ruby2js/converter/while.rb
ruby2js-1.13.0 lib/ruby2js/converter/while.rb
ruby2js-1.12.2 lib/ruby2js/converter/while.rb
ruby2js-1.12.1 lib/ruby2js/converter/while.rb
ruby2js-1.12.0 lib/ruby2js/converter/while.rb
ruby2js-1.11.1 lib/ruby2js/converter/while.rb
ruby2js-1.11.0 lib/ruby2js/converter/while.rb
ruby2js-1.10.0 lib/ruby2js/converter/while.rb
ruby2js-1.9.3 lib/ruby2js/converter/while.rb
ruby2js-1.9.2 lib/ruby2js/converter/while.rb
ruby2js-1.9.1 lib/ruby2js/converter/while.rb
ruby2js-1.9.0 lib/ruby2js/converter/while.rb
ruby2js-1.8.0 lib/ruby2js/converter/while.rb
ruby2js-1.7.0 lib/ruby2js/converter/while.rb
ruby2js-1.6.0 lib/ruby2js/converter/while.rb
ruby2js-1.5.0 lib/ruby2js/converter/while.rb