Skip to content

Use an Arena for AST nodes#31

Merged
Hugobros3 merged 8 commits intomasterfrom
refactor/arena
Aug 8, 2025
Merged

Use an Arena for AST nodes#31
Hugobros3 merged 8 commits intomasterfrom
refactor/arena

Conversation

@Hugobros3
Copy link
Contributor

This PR replaces unique_ptr usage in the AST with arena_ptr, a like-behaved alternative backed by an arena.

This solves difficulties with the unique ownership model, for example allowing an expression to be used in two places without requiring deep copies, or having to risk lifetime issues with weak references.

The main entry point was modified so that the arena owns every node, including the top-level ModDecl. Additionally, the TypeTable was lifted out as well, fixing crashes when printing the AST after a failed implicit substitution.

@Hugobros3 Hugobros3 merged commit 8ecc88b into master Aug 8, 2025
6 of 12 checks passed
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.

1 participant

Comments