Commits

Armin Rigo committed e857478 Merge

merge heads

Comments (0)

Files changed (2)

pypy/rlib/rsre/rsre_core.py

     subresult = None
 
     def move_to_next_result(self, ctx):
+        # returns either 'self' or None
         result = self.subresult
         if result is None:
             return
         if result.move_to_next_result(ctx):
-            return result
+            return self
         return self.find_next_result(ctx)
 
     def find_next_result(self, ctx):

pypy/rlib/rsre/test/test_match.py

     def test_match_bug2(self):
         r = get_code(r'(x??)??$')
         assert rsre_core.match(r, "x")
+
+    def test_match_bug3(self):
+        r = get_code(r'([ax]*?x*)?$')
+        assert rsre_core.match(r, "aaxaa")