Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DEBUG output for atomic group #106510

Closed
serhiy-storchaka opened this issue Jul 7, 2023 · 0 comments
Closed

Fix DEBUG output for atomic group #106510

serhiy-storchaka opened this issue Jul 7, 2023 · 0 comments
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes topic-regex type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jul 7, 2023

It missed my attention that DEBUG output is not specialized for atomic groups (added in #34627). For example:

>>> re.compile('(?>ab?)', re.DEBUG)
ATOMIC_GROUP [(LITERAL, 97), (MAX_REPEAT, (0, 1, [(LITERAL, 98)]))]

...

The correct output should show the decoded structure of the subpattern:

>>> re.compile('(?>ab?)', re.DEBUG)
ATOMIC_GROUP
  LITERAL 97
  MAX_REPEAT 0 1
    LITERAL 98

...

Linked PRs

@serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement topic-regex 3.12 bugs and security fixes 3.13 new features, bugs and security fixes labels Jul 7, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jul 7, 2023
@serhiy-storchaka serhiy-storchaka added the 3.11 only security fixes label Jul 7, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 8, 2023
(cherry picked from commit 74ec02e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Jul 8, 2023
…06548)

(cherry picked from commit 74ec02e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes topic-regex type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant