mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
- fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags - fixed group/octal code parsing in sub/subn templates
This commit is contained in:
parent
5d6ae76c09
commit
01016fe972
4 changed files with 55 additions and 42 deletions
|
@ -61,9 +61,9 @@ def _compile(code, pattern, flags):
|
|||
elif op is CATEGORY:
|
||||
emit(OPCODES[op])
|
||||
if flags & SRE_FLAG_LOCALE:
|
||||
emit(CH_LOCALE[CHCODES[av]])
|
||||
emit(CHCODES[CH_LOCALE[av]])
|
||||
elif flags & SRE_FLAG_UNICODE:
|
||||
emit(CH_UNICODE[CHCODES[av]])
|
||||
emit(CHCODES[CH_UNICODE[av]])
|
||||
else:
|
||||
emit(CHCODES[av])
|
||||
elif op is GROUP:
|
||||
|
@ -92,9 +92,9 @@ def _compile(code, pattern, flags):
|
|||
emit(fixup(av[1]))
|
||||
elif op is CATEGORY:
|
||||
if flags & SRE_FLAG_LOCALE:
|
||||
emit(CH_LOCALE[CHCODES[av]])
|
||||
emit(CHCODES[CH_LOCALE[av]])
|
||||
elif flags & SRE_FLAG_UNICODE:
|
||||
emit(CH_UNICODE[CHCODES[av]])
|
||||
emit(CHCODES[CH_UNICODE[av]])
|
||||
else:
|
||||
emit(CHCODES[av])
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue