Executing non-recursive nodes #367
Labels
discussion
Issues needing more discussion
enhancement
New feature or request
help wanted
Extra attention is needed
Milestone
We currently implement the return of a function with a
is_return
flag in the interpreter, and we don't implementbreak
. 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
andyield
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.
The text was updated successfully, but these errors were encountered: