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

Format for-in loops. #1314

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Format for-in loops. #1314

merged 2 commits into from
Nov 9, 2023

Conversation

munificent
Copy link
Member

I ended up refactoring the code for handling the for parts and inlining it all into visitForStatement() because it turns out that there isn't as much sharing between C-style for loops and for-in loops as I was expecting.

Thanks to the magic of pattern matching and shared case bodies, I was still able to get it all into a single flattened switch statement for all the kinds of for parts.

I ended up refactoring the code for handling the for parts and inlining
it all into visitForStatement() because it turns out that there isn't
as much sharing between C-style for loops and for-in loops as I was
expecting.

Thanks to the magic of pattern matching and shared case bodies, I was
still able to get it all into a single flattened switch statement for
all the kinds of for parts.
Copy link
Member

@kallentu kallentu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall :D
Thanks for also adding the await-fors.

lib/src/front_end/ast_node_visitor.dart Show resolved Hide resolved
@munificent munificent merged commit 029f9d3 into main Nov 9, 2023
7 checks passed
@munificent munificent deleted the format-for-in branch November 9, 2023 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants