def _simple(av):
# check if av is a "simple" operator
lo, hi = av[2].getwidth()
- if lo == 0:
+ if lo == 0 and hi == MAXREPEAT:
raise error, "nothing to repeat"
return lo == hi == 1 and av[2][0][0] != SUBPATTERN
# bug 112468: various expected syntax errors
('(', '', SYNTAX_ERROR),
('[\\41]', '!', SUCCEED, 'found', '!'),
+ # bug 114033: nothing to repeat
+ (r'(x?)?', 'x', SUCCEED, 'found', 'x'),
# bug 115040: rescan if flags are modified inside pattern
(r' (?x)foo ', 'foo', SUCCEED, 'found', 'foo'),
# bug 115618: negative lookahead
(r'(?<!abc)(d.f)', 'abcdefdof', SUCCEED, 'found', 'dof'),
# bug 116251: character class bug
(r'[\w-]+', 'laser_beam', SUCCEED, 'found', 'laser_beam'),
+
]