New submission from Serhiy Storchaka: 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. ---------- components: Library (Lib), Regular Expressions files: re_debug.patch keywords: patch messages: 226903 nosy: ezio.melotti, mrabarnett, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fix re debugging output type: behavior versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36620/re_debug.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22415> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com