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

vine: ast validation #35

Merged
merged 6 commits into from
Oct 7, 2024
Merged

vine: ast validation #35

merged 6 commits into from
Oct 7, 2024

Conversation

tjjfvi
Copy link
Member

@tjjfvi tjjfvi commented Oct 6, 2024

Adds an ast validation pass, between name resolution and desugaring. Currently, it checks that expressions and pattern have the proper form (value/place/expr) and that non-match patterns are irrefutable.

The Term node in the AST has been split into Expr and Pat; having them combined was saving a little bit of parser code, but was ultimately making the rest of the code more complicated.

The AST now makes form coercions explicit (these are inserted in the validation pass), which simplifies the compiler code a bit.

_ is now just a space expression; () can be used instead to create a nilary value. (Or, I suppose, ~_.)

@tjjfvi tjjfvi linked an issue Oct 6, 2024 that may be closed by this pull request
@tjjfvi tjjfvi mentioned this pull request Oct 6, 2024
Base automatically changed from error-reporting to main October 6, 2024 21:05
@tjjfvi tjjfvi added this pull request to the merge queue Oct 7, 2024
Merged via the queue into main with commit 484c87f Oct 7, 2024
5 checks passed
@tjjfvi tjjfvi deleted the ast-validation branch October 7, 2024 14:28
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.

vine: ast validation
2 participants