Message226903
Proposed patch fixes some issues in debugging output of the compiling of regular expression with the re.DEBUG flag.
1. Fixed the handling of the GROUPREF_EXISTS opcode.
Example:
>>> re.compile(r'(ab)(?(1)cd|ef)', re.DEBUG)
Before patch ("yes" and "no" branches are not separated):
subpattern 1
literal 97
literal 98
subpattern None
groupref_exists 1
literal 99
literal 100
literal 101
literal 102
After patch:
subpattern 1
literal 97
literal 98
subpattern None
groupref_exists 1
literal 99
literal 100
or
literal 101
literal 102
2. Got rid of trailing spaces in Python 3.
3. Used named opcode constants instead of inlined strings.
4. Simplified and modernized the code.
5. Updated test to cover more code. |
|
Date |
User |
Action |
Args |
2014-09-15 08:07:15 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, ezio.melotti, mrabarnett |
2014-09-15 08:07:14 | serhiy.storchaka | set | messageid: <1410768434.94.0.831625656606.issue22415@psf.upfronthosting.co.za> |
2014-09-15 08:07:14 | serhiy.storchaka | link | issue22415 messages |
2014-09-15 08:07:14 | serhiy.storchaka | create | |
|