Sha256: 483beb0d84cd7ce6991606915527c5923635a9c5881b54688b1eb3de83fc7408

Contents?: true

Size: 466 Bytes

Versions: 12

Compression:

Stored size: 466 Bytes

Contents

require 'polyglot'
require 'byebug'
require 'treetop'
require 'indented_blocks'

parser = IndentedBlocksParser.new

input = <<END
def foo
  here is some indented text
    here it's further indented
    and here the same
      but here it's further again
      and some more like that
    before going back to here
      down again
  back twice
and start from the beginning again
  with only a small block this time
END

parse_tree = parser.parse input

p parse_tree

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
treetop-1.6.12 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.11 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.10 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.9 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.8 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.7 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.6 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.5 examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.4 examples/indented_blocks/indented_blocks_test.rb
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/indented_blocks/indented_blocks_test.rb
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/indented_blocks/indented_blocks_test.rb
treetop-1.6.3 examples/indented_blocks/indented_blocks_test.rb