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

Write CanonicalizeCase pass and allow fall-through default cases #28

Open
rrnewton opened this issue Jan 3, 2017 · 3 comments
Open

Comments

@rrnewton
Copy link
Member

rrnewton commented Jan 3, 2017

Right now the #lang gibbon case expressions are very fragile. They require exhaustive pattern matches and I think they even require the same order as in the data definition.

This can be relaxed by adding a pass early in the compiler pipeline which:

  • puts the cases in a canonical order (if that's really needed... but in any case it doesn't hurt)
  • replaces all missing cases with errors
@rrnewton
Copy link
Member Author

rrnewton commented Jan 3, 2017

Ah, right, it's SourceInterp that's making the lame assumption about ordering.

test25c is there to tickle this.

@rrnewton
Copy link
Member Author

rrnewton commented Jan 3, 2017

There's still the issue of handling incomplete pattern matches.

rrnewton added a commit that referenced this issue Jan 3, 2017
@rrnewton rrnewton added this to the after_paper1 milestone Jan 9, 2017
@rrnewton rrnewton changed the title Write CanonicalizeCase pass Write CanonicalizeCase pass and allow fall-through default cases May 11, 2017
@ckoparkar
Copy link
Member

ckoparkar commented Sep 5, 2021

There's still the issue of handling incomplete pattern matches.

This can be accomplished by an L0->L0 pass that inspects case expressions and adds appropriate MISSING_PATTERN -> error alternatives and prints a warning during compilation.

@ckoparkar ckoparkar removed this from the ecoop_camera milestone Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants