lib/cucumber/parser/table.rb in kosmas58-cucumber-0.3.92 vs lib/cucumber/parser/table.rb in kosmas58-cucumber-0.3.93.1

- old
+ new

@@ -47,20 +47,20 @@ else break end end if s0.empty? - self.index = i0 + @index = i0 r0 = nil else r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Table0) end node_cache[:table][start_index] = r0 - return r0 + r0 end module TableRow0 def cell elements[0] @@ -114,11 +114,11 @@ end end r1 = instantiate_node(SyntaxNode,input, i1...index, s1) s0 << r1 if r1 - if input.index('|', index) == index + if has_terminal?('|', false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('|') r3 = nil @@ -129,11 +129,11 @@ loop do i5, s5 = index, [] r6 = _nt_cell s5 << r6 if r6 - if input.index('|', index) == index + if has_terminal?('|', false, index) r7 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('|') r7 = nil @@ -142,21 +142,21 @@ end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(TableRow0) else - self.index = i5 + @index = i5 r5 = nil end if r5 s4 << r5 else break end end if s4.empty? - self.index = i4 + @index = i4 r4 = nil else r4 = instantiate_node(SyntaxNode,input, i4...index, s4) end s0 << r4 @@ -182,11 +182,11 @@ else break end end if s11.empty? - self.index = i11 + @index = i11 r11 = nil else r11 = instantiate_node(SyntaxNode,input, i11...index, s11) end if r11 @@ -194,11 +194,11 @@ else r13 = _nt_eof if r13 r10 = r13 else - self.index = i10 + @index = i10 r10 = nil end end s0 << r10 end @@ -208,17 +208,17 @@ if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(TableRow1) r0.extend(TableRow2) else - self.index = i0 + @index = i0 r0 = nil end node_cache[:table_row][start_index] = r0 - return r0 + r0 end module Cell0 end @@ -233,11 +233,11 @@ s0, i0 = [], index loop do i1, s1 = index, [] i2 = index i3 = index - if input.index('|', index) == index + if has_terminal?('|', false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('|') r4 = nil @@ -247,18 +247,18 @@ else r5 = _nt_eol if r5 r3 = r5 else - self.index = i3 + @index = i3 r3 = nil end end if r3 r2 = nil else - self.index = i2 + @index = i2 r2 = instantiate_node(SyntaxNode,input, index...index) end s1 << r2 if r2 if index < input_length @@ -272,11 +272,11 @@ end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Cell0) else - self.index = i1 + @index = i1 r1 = nil end if r1 s0 << r1 else @@ -285,31 +285,31 @@ end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:cell][start_index] = r0 - return r0 + r0 end def _nt_space start_index = index if node_cache[:space].has_key?(index) cached = node_cache[:space][index] @index = cached.interval.end if cached return cached end - if input.index(Regexp.new('[ \\t]'), index) == index + if has_terminal?('\G[ \\t]', true, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else r0 = nil end node_cache[:space][start_index] = r0 - return r0 + r0 end module Eol0 end @@ -320,31 +320,31 @@ @index = cached.interval.end if cached return cached end i0 = index - if input.index("\n", index) == index + if has_terminal?("\n", false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("\n") r1 = nil end if r1 r0 = r1 else i2, s2 = index, [] - if input.index("\r", index) == index + if has_terminal?("\r", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("\r") r3 = nil end s2 << r3 if r3 - if input.index("\n", index) == index + if has_terminal?("\n", false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("\n") r5 = nil @@ -358,24 +358,24 @@ end if s2.last r2 = instantiate_node(SyntaxNode,input, i2...index, s2) r2.extend(Eol0) else - self.index = i2 + @index = i2 r2 = nil end if r2 r0 = r2 else - self.index = i0 + @index = i0 r0 = nil end end node_cache[:eol][start_index] = r0 - return r0 + r0 end def _nt_eof start_index = index if node_cache[:eof].has_key?(index) @@ -393,16 +393,16 @@ r1 = nil end if r1 r0 = nil else - self.index = i0 + @index = i0 r0 = instantiate_node(SyntaxNode,input, index...index) end node_cache[:eof][start_index] = r0 - return r0 + r0 end end class TableParser < Treetop::Runtime::CompiledParser \ No newline at end of file