-
Notifications
You must be signed in to change notification settings - Fork 260
Bugfix #778: Flag for entry into for loop after range has been processed #795
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
The approach looks correct to me.
Can you add these tests for confirmation?
issue_778: (args) = {
for :() args$;() do (i) _ = i;
for :(x) x;(args) do (j) _ = j;
for :(x) x;(args) next _ = :() args$;() do (k) _ = k;
for :(x) x;(args) next _ = :(x) x;(args) do (l) _ = l;
}
I added the tests. The output was compileable and looked reasonable to me. Then I merged the new state of the main branch and ran the tests again. All tests are green, so it seems to work and not break anything. |
Thank you for this. This is definitely the right approach. |
I'm not 100% sure I agree that flags like this one are the correct way to handle parsing context like this, but it seemed like the least invasive way to handle it. In a new design I'd maybe consider encoding information like this in the parse tree so that the safety of the expression becomes an S-attribute. |
(Catching up with PRs, sorry for the delay) Thanks for your pull request! It looks like this may be your first contribution to cppfront. I've sent the Contributor License Agreement (CLA) to your email, and once it's signed I can look at your pull request. Thanks again for your contribution. |
For better or worse, I've been using `_tag` types instead of adding to the `start`/`end` names, so just staying consistent for now.
Thanks! I just made a minor style tweak to follow the style I was already using for such so-far-very-occasional extra information. |
Fixes #778, and it's possibly relevant for #432.
I ran the regression tests and spotted no differences in output. I also have a bash script now to run the tests on a Linux machine, should I put that in here as well?