Sha256: 46b31f7f6724adb301aa2174bbfca67258740e1753bf7797091ea08d69281801
Contents?: true
Size: 650 Bytes
Versions: 19
Compression:
Stored size: 650 Bytes
Contents
# -*- coding: utf-8 -*- module RubyToBlock module Block class End < Base blocknize '^\s*end$', 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
19 entries across 19 versions & 1 rubygems