lib/cucumber/parser/table.rb in cucumber-0.3.104 vs lib/cucumber/parser/table.rb in cucumber-0.4.0.rc1
- old
+ new
@@ -84,11 +84,11 @@
end
def build
row = cells.elements.map do |elt|
value = elt.cell.text_value.strip
- value.empty? ? nil : value
+ value
end
class << row
attr_accessor :line
end
@@ -263,12 +263,13 @@
r2 = instantiate_node(SyntaxNode,input, index...index)
end
s1 << r2
if r2
if index < input_length
- r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
+ next_character = index + input[index..-1].match(/\A(.)/um).end(1)
+ r6 = instantiate_node(SyntaxNode,input, index...next_character)
+ @index = next_character
else
terminal_parse_failure("any character")
r6 = nil
end
s1 << r6
@@ -300,12 +301,13 @@
@index = cached.interval.end if cached
return cached
end
if has_terminal?('\G[ \\t]', true, index)
- r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
+ next_character = index + input[index..-1].match(/\A(.)/um).end(1)
+ r0 = instantiate_node(SyntaxNode, input, index...next_character)
+ @index = next_character
else
r0 = nil
end
node_cache[:space][start_index] = r0
@@ -387,11 +389,12 @@
return cached
end
i0 = index
if index < input_length
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
+ next_character = index + input[index..-1].match(/\A(.)/um).end(1)
+ r1 = instantiate_node(SyntaxNode,input, index...next_character)
+ @index = next_character
else
terminal_parse_failure("any character")
r1 = nil
end
if r1
\ No newline at end of file