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.1.21-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.21 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.20-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.20 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.19-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.19 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.18-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.18 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.17-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.17 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.16-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.16 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.15-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.15 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.14-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.14 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.13-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.13 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.12-x86-mingw32 app/models/concerns/ruby_to_block/block/control_loop.rb
smalruby-editor-0.1.12 app/models/concerns/ruby_to_block/block/control_loop.rb