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

Executing non-recursive nodes #367

Closed
Razican opened this issue May 2, 2020 · 1 comment
Closed

Executing non-recursive nodes #367

Razican opened this issue May 2, 2020 · 1 comment
Labels
discussion Issues needing more discussion enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@Razican
Copy link
Member

Razican commented May 2, 2020

We currently implement the return of a function with a is_return flag in the interpreter, and we don't implement break. There are other nodes that don't execute code recursively, such as post-increment/decrement operators.

This needs to be taken into account for #365, #366 and #321. How could we implement this in an extensible way? Note that we will have to implement await and yield in the future, too.

One option would be to have those flags in the interpreter, and to be easy to check by the executors, if we do something like #366, so that a function can for example end fast if an early return is found, or a loop can finish if a break is found.

For the case of increment/decrement operators, this could be more difficult, as we need to take one value into account when executing the outer node, but return a different one once it gets out of the parent execution. In that particular case, it might make sense to just generate different nodes for the case, and subdivide the operation in the parser directly.

@Razican Razican added enhancement New feature or request help wanted Extra attention is needed discussion Issues needing more discussion labels May 2, 2020
@Razican Razican added this to the v0.9.0 milestone May 14, 2020
@Razican Razican linked a pull request May 14, 2020 that will close this issue
32 tasks
@Razican Razican self-assigned this May 14, 2020
@Razican Razican removed a link to a pull request May 23, 2020
32 tasks
@Razican Razican removed their assignment May 31, 2020
@jasonwilliams jasonwilliams modified the milestones: v0.9.0, v0.10.0 Jun 25, 2020
@jasonwilliams jasonwilliams modified the milestones: v0.10.0, v0.11.0 Sep 28, 2020
This was referenced Oct 8, 2020
@Razican
Copy link
Member Author

Razican commented Jan 11, 2021

Everything mentioned in this issue has already been implemented.

@Razican Razican closed this as completed Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issues needing more discussion enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants