Sha256: f3162fcf1c25c29435d5b65bb360ab91824c86104991e9edf614e8292ecabc29

Contents?: true

Size: 336 Bytes

Versions: 44

Compression:

Stored size: 336 Bytes

Contents

module Ruby2JS
  class Converter

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

    handle :while do |condition, block|
      begin
        next_token, @next_token = @next_token, :continue

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

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
ruby2js-2.1.24 lib/ruby2js/converter/while.rb
ruby2js-2.1.23 lib/ruby2js/converter/while.rb
ruby2js-2.1.22 lib/ruby2js/converter/while.rb
ruby2js-2.1.21 lib/ruby2js/converter/while.rb
ruby2js-2.1.20 lib/ruby2js/converter/while.rb
ruby2js-2.1.19 lib/ruby2js/converter/while.rb
ruby2js-2.1.18 lib/ruby2js/converter/while.rb
ruby2js-2.1.17 lib/ruby2js/converter/while.rb
ruby2js-2.1.16 lib/ruby2js/converter/while.rb
ruby2js-2.1.15 lib/ruby2js/converter/while.rb
ruby2js-2.1.14 lib/ruby2js/converter/while.rb
ruby2js-2.1.13 lib/ruby2js/converter/while.rb
ruby2js-2.1.12 lib/ruby2js/converter/while.rb
ruby2js-2.1.11 lib/ruby2js/converter/while.rb
ruby2js-2.1.10 lib/ruby2js/converter/while.rb
ruby2js-2.1.9 lib/ruby2js/converter/while.rb
ruby2js-2.1.8 lib/ruby2js/converter/while.rb
ruby2js-2.1.7 lib/ruby2js/converter/while.rb
ruby2js-2.1.6 lib/ruby2js/converter/while.rb
ruby2js-2.1.5 lib/ruby2js/converter/while.rb