Sha256: 37db903df735e8c2f507bfcd3897882dcbc7e31896ba246cadb9068f54a6e6ed
Contents?: true
Size: 653 Bytes
Versions: 50
Compression:
Stored size: 653 Bytes
Contents
# -*- coding: utf-8 -*- module RubyToBlock module Block class End < Base blocknize '^\s*end\s*$', statement: true def self.process_match_data(md, context) ends_num = 1 context.lines.each do |l| md2 = Block.statement_regexp.match(l) type = md2.names.find { |n| md2[n.to_sym] } if type == 'end' ends_num += 1 elsif Block[type].indent? ends_num -= 1 end end if context.statement && ends_num <= context.statement_stack.length Block.process_end(context) else false end end end end end
Version data entries
50 entries across 50 versions & 1 rubygems