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

Tree: represent nodes as tagged unions with a packed representation #807

Merged
merged 12 commits into from
Dec 31, 2024

Conversation

Vexu
Copy link
Owner

@Vexu Vexu commented Dec 28, 2024

Working with the current AST is annoying and difficult with similar constructs having multiple representations and dealing with multiarray list access and @intFromEnum and different data being stored in different data structures.

The goal of this branch is to simplify the usage by having a tagged union containing all the information of that node.

@Vexu
Copy link
Owner Author

Vexu commented Dec 28, 2024

@ehaas do you think the Iterator will be necessary with these changes?

@ehaas
Copy link
Collaborator

ehaas commented Dec 28, 2024

I haven't had nearly as much time to work on things as I'd like, so I haven't even really started using the Tree iterator yet. So if you want to remove it I say go for it and we can reassess later if it's needed.

@Vexu Vexu force-pushed the rewrite-ast branch 2 times, most recently from e614345 to 3661e1e Compare December 29, 2024 00:29
Vexu added a commit that referenced this pull request Dec 29, 2024
Inspired by the similar changes to the AST (#807) this should
finally make Type less painful to use.
Vexu added 9 commits December 31, 2024 00:07
Working with the current AST is annoying and difficult
with similar constructs having multiple representations
and dealing with multiarray list access and `@intFromEnum`
and different data being stored in different data structures.

The goal of this branch is to simplify the usage by having
a tagged union containing all the information of that node.
Hopefully it won't be necessary with the new AST.
This change is massive enough as is.
Calls to implicitly declared functions can add to that list
making it invalid for storing the previous item tokens.

param_buf should be safe for this.
@Vexu Vexu marked this pull request as ready for review December 30, 2024 22:34
@Vexu Vexu merged commit ddf5c08 into master Dec 31, 2024
3 checks passed
Vexu added a commit that referenced this pull request Dec 31, 2024
Inspired by the similar changes to the AST (#807) this should
finally make Type less painful to use.
@Vexu Vexu deleted the rewrite-ast branch December 31, 2024 16:25
Vexu added a commit that referenced this pull request Jan 1, 2025
Inspired by the similar changes to the AST (#807) this should
finally make Type less painful to use.
Vexu added a commit that referenced this pull request Jan 1, 2025
Inspired by the similar changes to the AST (#807) this should
finally make Type less painful to use.
Vexu added a commit that referenced this pull request Jan 2, 2025
Inspired by the similar changes to the AST (#807) this should
finally make Type less painful to use.
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