Skip to content

gh-152026: Track mark-saving contexts with a counter#153160

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:save-marks-counter
Jul 6, 2026
Merged

gh-152026: Track mark-saving contexts with a counter#153160
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:save-marks-counter

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 6, 2026

Copy link
Copy Markdown
Member

Replace the state->repeat checks that guard mark saving and restoring with an explicit save_marks counter maintained where repeat and possessive contexts are entered and left. Each push is now paired with a pop decided by the same condition. As a side effect, POSSESSIVE_REPEAT no longer allocates the placeholder repeat context introduced in gh-101955.

Extracted from #152027, which needs mark saving outside of any repeat context and will be rebased on top of this.

Replace the state->repeat checks that guard mark saving and restoring
with an explicit save_marks counter maintained where repeat and
possessive contexts are entered and left.  Each push is now paired
with a pop decided by the same condition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 6, 2026 04:54
@serhiy-storchaka serhiy-storchaka merged commit b175621 into python:main Jul 6, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant