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

Use an Arena for AST nodes #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Use an Arena for AST nodes #31

wants to merge 7 commits into from

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.

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