# Autogenerated from a Treetop grammar. Edits may be lost. require "hemingway/block/center/center_nodes" module Hemingway module Block module Center include Treetop::Runtime def root @root ||= :center end module Center0 def block_end elements[0] end def center_type elements[1] end end module Center1 def content elements[1] end end def _nt_center start_index = index if node_cache[:center].has_key?(index) cached = node_cache[:center][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end s0, i0 = [], index loop do i1 = index i2, s2 = index, [] i3 = index i4, s4 = index, [] r5 = _nt_block_end s4 << r5 if r5 r6 = _nt_center_type s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(Center0) else @index = i4 r4 = nil end if r4 r3 = nil else @index = i3 r3 = instantiate_node(SyntaxNode,input, index...index) end s2 << r3 if r3 r7 = _nt_content s2 << r7 end if s2.last r2 = instantiate_node(SyntaxNode,input, i2...index, s2) r2.extend(Center1) else @index = i2 r2 = nil end if r2 r1 = r2 else r8 = _nt_newline if r8 r1 = r8 else @index = i1 r1 = nil end end if r1 s0 << r1 else break end end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:center][start_index] = r0 r0 end def _nt_center_type start_index = index if node_cache[:center_type].has_key?(index) cached = node_cache[:center_type][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?("center", false, index) r0 = instantiate_node(CenterNode,input, index...(index + 6)) @index += 6 else terminal_parse_failure("center") r0 = nil end node_cache[:center_type][start_index] = r0 r0 end end class CenterParser < Treetop::Runtime::CompiledParser include Center end end end