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

Do not loose information about definition groups #4368

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

giacomocavalieri
Copy link
Member

This will be needed to implement mutual recursion TCO on the JS target. At the moment we throw away the different definitions groupings after analysis by flattening all the groups when storing those in the typed module. In this PR I change the internal module representation to make sure we store each group separately; this way code generation will be able to work with groups of related functions!

As a side note I've also done quite some renaming here: the codebase was calling a module's definitions statements despite those being definitions (and their type is indeed Un/TypedDefinition). And the Statement type and statement name is already widely used to refer to the statements that are part of a function's body, so now we use distinct names to refer to module definitions and statements

@lpil
Copy link
Member

lpil commented Mar 17, 2025

Heya! How come this PR doesn't have the feature itself in it?

@giacomocavalieri
Copy link
Member Author

I was afraid it would turn up to be huge so I was thinking of splitting this into its own PR

@lpil
Copy link
Member

lpil commented Mar 18, 2025

It's no trouble, this PR isn't large, and one can read the commit history.

@lpil lpil marked this pull request as draft March 18, 2025 10:31
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.

2 participants