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

Refactor exhaustiveness checking #4303

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

giacomocavalieri
Copy link
Member

@giacomocavalieri giacomocavalieri commented Mar 5, 2025

This is quite big change refactoring the pattern matching compilation code.

  • I've changed a lot of names here and there to be a bit more descriptive and hopefully help understand what is going on in the code
  • I've also added quite a few of documentation comments to try and explain all the terminology used and hopefully make things clearer to skim through
  • After removing unused code, a couple of files were small enough to be deleted and just be made part of the exhaustiveness.rs one. Most notably, Pattern was moved there
  • While the decision tree has changed in its shape, the Match data structure hasn't changed much. The code consuming the result of the compilation hasn't been touched by this refactoring. However, I've tried to make the public facing api easier to use; as a result, I think that now the code in type_/expression.rs is a lot nicer

After this refactoring gets merged I will move on to deal with compilation of string patterns (and maybe bit arrays as well!), and finally we could start using the tree for code generation on the js target

@giacomocavalieri giacomocavalieri marked this pull request as ready for review March 7, 2025 15:47
@giacomocavalieri giacomocavalieri changed the title wip: refactor exhaustiveness checking Refactor exhaustiveness checking Mar 7, 2025
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