This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
Date 2014-09-15.08:07:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410768434.94.0.831625656606.issue22415@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-15 08:07:15serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, ezio.melotti, mrabarnett
2014-09-15 08:07:14serhiy.storchakasetmessageid: <1410768434.94.0.831625656606.issue22415@psf.upfronthosting.co.za>
2014-09-15 08:07:14serhiy.storchakalinkissue22415 messages
2014-09-15 08:07:14serhiy.storchakacreate