Lines Matching refs:checkPatternError
49 def checkPatternError(self, pattern, errmsg, pos=None):
259 self.checkPatternError(r'(?P<a>)(?P<a>)',
262 self.checkPatternError(r'(?P<a>(?P=a))',
264 self.checkPatternError(r'(?Pxy)', 'unknown extension ?Px')
265 self.checkPatternError(r'(?P<a>)(?P=a', 'missing ), unterminated name', 11)
266 self.checkPatternError(r'(?P=', 'missing group name', 4)
267 self.checkPatternError(r'(?P=)', 'missing group name', 4)
268 self.checkPatternError(r'(?P=1)', "bad character in group name '1'", 4)
269 self.checkPatternError(r'(?P=a)', "unknown group name 'a'")
270 self.checkPatternError(r'(?P=a1)', "unknown group name 'a1'")
271 self.checkPatternError(r'(?P=a.)', "bad character in group name 'a.'", 4)
272 self.checkPatternError(r'(?P<)', 'missing >, unterminated name', 4)
273 self.checkPatternError(r'(?P<a', 'missing >, unterminated name', 4)
274 self.checkPatternError(r'(?P<', 'missing group name', 4)
275 self.checkPatternError(r'(?P<>)', 'missing group name', 4)
276 self.checkPatternError(r'(?P<1>)', "bad character in group name '1'", 4)
277 self.checkPatternError(r'(?P<a.>)', "bad character in group name 'a.'", 4)
278 self.checkPatternError(r'(?(', 'missing group name', 3)
279 self.checkPatternError(r'(?())', 'missing group name', 3)
280 self.checkPatternError(r'(?(a))', "unknown group name 'a'", 3)
281 self.checkPatternError(r'(?(-1))', "bad character in group name '-1'", 3)
282 self.checkPatternError(r'(?(1a))', "bad character in group name '1a'", 3)
283 self.checkPatternError(r'(?(a.))', "bad character in group name 'a.'", 3)
284 self.checkPatternError('(?P<©>x)', "bad character in group name '©'", 4)
285 self.checkPatternError('(?P=©)', "bad character in group name '©'", 4)
286 self.checkPatternError('(?(©)y)', "bad character in group name '©'", 3)
295 self.checkPatternError(b'(?P=\xc2\xb5)',
300 self.checkPatternError(b'(?(\xc2\xb5)y)',
625 self.checkPatternError(r'(?P<a>)(?(0)a|b)', 'bad group number', 10)
626 self.checkPatternError(r'()(?(-1)a|b)',
641 self.checkPatternError(r'()(?(㊀)a|b)',
643 self.checkPatternError(r'()(?(¹)a|b)',
649 self.checkPatternError(r'()(?(1',
651 self.checkPatternError(r'()(?(1)a',
653 self.checkPatternError(r'()(?(1)a|b',
655 self.checkPatternError(r'()(?(1)a|b|c',
658 self.checkPatternError(r'()(?(1)a|b|c)',
661 self.checkPatternError(r'()(?(2)a)',
673 self.checkPatternError(r'(?P<a>)(?(%d))' % MAXGROUPS,
688 self.checkPatternError(r'(abc\1)', 'cannot refer to an open group', 4)
738 self.checkPatternError(r'x{2,1}',
796 self.checkPatternError("\\", 'bad escape (end of pattern)', 0)
829 self.checkPatternError(r'\N', 'missing {', 2)
830 self.checkPatternError(r'[\N]', 'missing {', 3)
831 self.checkPatternError(r'\N{', 'missing character name', 3)
832 self.checkPatternError(r'[\N{', 'missing character name', 4)
833 self.checkPatternError(r'\N{}', 'missing character name', 3)
834 self.checkPatternError(r'[\N{}]', 'missing character name', 4)
835 self.checkPatternError(r'\NSNAKE}', 'missing {', 2)
836 self.checkPatternError(r'[\NSNAKE}]', 'missing {', 3)
837 self.checkPatternError(r'\N{SNAKE',
839 self.checkPatternError(r'[\N{SNAKE]',
841 self.checkPatternError(r'[\N{SNAKE]}',
843 self.checkPatternError(r'\N{SPAM}',
845 self.checkPatternError(r'[\N{SPAM}]',
847 self.checkPatternError(r'\N{KEYCAP NUMBER SIGN}',
849 self.checkPatternError(r'[\N{KEYCAP NUMBER SIGN}]',
851 self.checkPatternError(br'\N{LESS-THAN SIGN}', r'bad escape \N', 0)
852 self.checkPatternError(br'[\N{LESS-THAN SIGN}]', r'bad escape \N', 1)
1270 self.checkPatternError(r"\567",
1273 self.checkPatternError(r"\911", 'invalid group reference 91', 1)
1274 self.checkPatternError(r"\x1", r'incomplete escape \x1', 0)
1275 self.checkPatternError(r"\x1z", r'incomplete escape \x1', 0)
1276 self.checkPatternError(r"\u123", r'incomplete escape \u123', 0)
1277 self.checkPatternError(r"\u123z", r'incomplete escape \u123', 0)
1278 self.checkPatternError(r"\U0001234", r'incomplete escape \U0001234', 0)
1279 self.checkPatternError(r"\U0001234z", r'incomplete escape \U0001234', 0)
1280 self.checkPatternError(r"\U00110000", r'bad escape \U00110000', 0)
1300 self.checkPatternError(r"[\567]",
1303 self.checkPatternError(r"[\911]", r'bad escape \9', 1)
1304 self.checkPatternError(r"[\x1z]", r'incomplete escape \x1', 1)
1305 self.checkPatternError(r"[\u123z]", r'incomplete escape \u123', 1)
1306 self.checkPatternError(r"[\U0001234z]", r'incomplete escape \U0001234', 1)
1307 self.checkPatternError(r"[\U00110000]", r'bad escape \U00110000', 1)
1324 self.checkPatternError(br"\567",
1327 self.checkPatternError(br"\911", 'invalid group reference 91', 1)
1328 self.checkPatternError(br"\x1", r'incomplete escape \x1', 0)
1329 self.checkPatternError(br"\x1z", r'incomplete escape \x1', 0)
1343 self.checkPatternError(br"[\567]",
1346 self.checkPatternError(br"[\911]", r'bad escape \9', 1)
1347 self.checkPatternError(br"[\x1z]", r'incomplete escape \x1', 1)
1350 self.checkPatternError(r'[', 'unterminated character set', 0)
1351 self.checkPatternError(r'[^', 'unterminated character set', 0)
1352 self.checkPatternError(r'[a', 'unterminated character set', 0)
1355 self.checkPatternError(r"[a-", 'unterminated character set', 0)
1356 self.checkPatternError(r"[\w-b]", r'bad character range \w-b', 1)
1357 self.checkPatternError(r"[a-\w]", r'bad character range a-\w', 1)
1358 self.checkPatternError(r"[b-a]", 'bad character range b-a', 1)
1399 self.checkPatternError('%s%s' % (reps, mod),
1401 self.checkPatternError('(?:%s%s)' % (reps, mod),
1413 self.checkPatternError(r'x%s%s' % (inner_op, outer_op),
1608 self.checkPatternError(upper_char + '(?i)', msg, 1)
1613 self.checkPatternError(b'A(?i)', msg, 1)
1615 self.checkPatternError('(?s).(?i)' + upper_char, msg, 5)
1616 self.checkPatternError('(?i) ' + upper_char + ' (?x)', msg, 7)
1617 self.checkPatternError(' (?x) (?i) ' + upper_char, msg, 1)
1618 self.checkPatternError('^(?i)' + upper_char, msg, 1)
1619 self.checkPatternError('$|(?i)' + upper_char, msg, 2)
1620 self.checkPatternError('(?:(?i)' + upper_char + ')', msg, 3)
1621 self.checkPatternError('(^)?(?(1)(?i)' + upper_char + ')', msg, 9)
1622 self.checkPatternError('($)?(?(1)|(?i)' + upper_char + ')', msg, 10)
1737 self.checkPatternError(r'(?a)(?-a:\w)',
1739 self.checkPatternError(r'(?i-i:a)',
1741 self.checkPatternError(r'(?au:a)',
1743 self.checkPatternError(br'(?aL:a)',
1746 self.checkPatternError(r'(?-', 'missing flag', 3)
1747 self.checkPatternError(r'(?-+', 'missing flag', 3)
1748 self.checkPatternError(r'(?-z', 'unknown flag', 3)
1749 self.checkPatternError(r'(?-i', 'missing :', 4)
1750 self.checkPatternError(r'(?-i)', 'missing :', 4)
1751 self.checkPatternError(r'(?-i+', 'missing :', 4)
1752 self.checkPatternError(r'(?-iz', 'unknown flag', 4)
1753 self.checkPatternError(r'(?i:', 'missing ), unterminated subpattern', 0)
1754 self.checkPatternError(r'(?i', 'missing -, : or )', 3)
1755 self.checkPatternError(r'(?i+', 'missing -, : or )', 3)
1756 self.checkPatternError(r'(?iz', 'unknown flag', 3)
1891 self.checkPatternError('(?P=<foo>)',
1896 self.checkPatternError('(?P<?foo>)',
2101 self.checkPatternError(r'(', 'missing ), unterminated subpattern', 0)
2102 self.checkPatternError(r'((a|b)', 'missing ), unterminated subpattern', 0)
2103 self.checkPatternError(r'(a|b))', 'unbalanced parenthesis', 5)
2104 self.checkPatternError(r'(?P', 'unexpected end of pattern', 3)
2105 self.checkPatternError(r'(?z)', 'unknown extension ?z', 1)
2106 self.checkPatternError(r'(?iz)', 'unknown flag', 3)
2107 self.checkPatternError(r'(?i', 'missing -, : or )', 3)
2108 self.checkPatternError(r'(?#abc', 'missing ), unterminated comment', 0)
2109 self.checkPatternError(r'(?<', 'unexpected end of pattern', 3)
2110 self.checkPatternError(r'(?<>)', 'unknown extension ?<>', 1)
2111 self.checkPatternError(r'(?', 'unexpected end of pattern', 2)