Skip to content

[DO NOT LAND] Experiment with using pops in the current interpreter #7762

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

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
work
  • Loading branch information
kripken committed Jul 24, 2025
commit 4db30300529f307a47f8d7a95abe11b8e33287d9
20 changes: 17 additions & 3 deletions a.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,23 @@
# Flow flow = self()->visit(expression);
if ' = visit(' in line or ' = self()->visit(' in line:
print(line.rstrip())
parts = line.split(' ')
parts[-1] = 'pop();'
line = ' '.join(parts) + '\n'
# next, we should see
#
# if (flow.breaking()) {
# return flow;
# }
#
next = lines[i + 1]
if '.breaking()) {' in next:
next = lines[i + 2]
if 'return ' in next:
next = lines[i + 3]
if '}' in next:
# success! turn it all into a pop
parts = line.split(' ')
parts[-1] = 'pop();'
line = ' '.join(parts) + '\n'
i += 3

new.append(line)
i += 1
Expand Down