Sha256: a355b3961cb5e410825ae85ae9c1eaaa03b6a5adb5712b9b63b03dcde3982b4c

Contents?: true

Size: 492 Bytes

Versions: 69

Compression:

Stored size: 492 Bytes

Contents

module RubyToBlock
  module Block
    class ControlLoop < Base
      blocknize '^\s*loop\s+do\s*$', statement: true, indent: true

      def self.process_match_data(md, context)
        return false unless context.receiver

        do_block = Block.new('null')
        block = new(statements: { DO: do_block })
        context.statement_stack.push([type, block])
        context.current_block.sibling = block
        context.current_block = do_block

        true
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
smalruby-editor-0.4.1-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.4.2-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.4.2 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.4.1 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.4.0-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.4.0 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.5-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.5 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.4-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.4 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.3-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.3 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.2-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.2 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.1-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.1 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.0-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.3.0 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.2.7-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.2.7 app/models/concerns/ruby_to_block/block/control_loop.rb