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 processing of nested entities (fixes #613) #654

Merged
merged 4 commits into from Oct 17, 2022

Conversation

hartwork
Copy link
Member

Fixes #613

@RMJ10
Copy link
Contributor

RMJ10 commented Oct 17, 2022

@hartwork asked for a review again.

The first commit simplifying the control flow looks like it is just for human readability. A competent compiler doing any optimisation at all ought to be making the same decisions. Still, improving human readability is a good thing, so that gets a 👍 from me.

The fix itself makes perfect sense, and is nicely commented. I'm a little surprised that this hasn't come up before, but I suppose that suspending the parse is relatively uncommon.

@hartwork
Copy link
Member Author

@RMJ10 thank you!

The key is that all branches but the last ended in `return`.

```
BEFORE              |   AFTER
--------------------+--------------------
if (..a..) {        | if (..a..) {
    ..b..;          |     ..b..;
    return ..c..;   |     return ..c..;
                    | }
} else if (..d..) { | if (..d..) {
    ..e..;          |     ..e..;
    return ..f..;   |     return ..f..;
} else {            | }
    ..g..;          | ..g..;
}                   |
```
@hartwork hartwork force-pushed the issue-613-fix-processing-of-nested-entities branch from fb4fb6f to 6acab0a Compare October 17, 2022 21:12
@hartwork hartwork merged commit 9192010 into master Oct 17, 2022
@hartwork hartwork deleted the issue-613-fix-processing-of-nested-entities branch October 17, 2022 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suspend in nested entity context forgets about entity stack on resume
2 participants