lib/code/parser/code.rb in code-ruby-0.2.4 vs lib/code/parser/code.rb in code-ruby-0.3.0
- old
+ new
@@ -6,14 +6,13 @@
rule(:space) { str(" ") }
rule(:newline) { str("\n") }
rule(:whitespace) { (space | newline).repeat(1) }
rule(:whitespace?) { whitespace.maybe }
- rule(:code) do
- (whitespace?.ignore >> statement >> whitespace?.ignore).repeat(1) |
- whitespace?.ignore
+ rule(:present) do
+ (whitespace?.ignore >> statement >> whitespace?.ignore).repeat(1)
end
-
+ rule(:code) { present | whitespace?.ignore }
root(:code)
end
end
end