lib/arugula.rb in arugula-0.2.0 vs lib/arugula.rb in arugula-0.2.1
- old
+ new
@@ -6,11 +6,10 @@
def initialize(pattern)
@root = Parser.new(pattern).parse!
end
- def match?(str)
- index = 0
+ def match?(str, index = 0)
loop do
match, = @root.match(str, index)
return index if match
index += 1
return if index > str.size