ssm-lang / sslang

A language built atop the Sparse Synchronous Model
BSD 3-Clause "New" or "Revised" License
18 stars 0 forks source link

Desugar recursive pattern matching #97

Closed leoqiao18 closed 2 years ago

leoqiao18 commented 2 years ago

Desugar recursive pattern matches to non-recursive pattern matches in AST. Algorithm is referenced from Chapter 5 (by Phil Wadler) "Efficient Compilation of Pattern-matching" of "The Implementation of Functional Programming Languages" by Simon Peyton Jones.

leoqiao18 commented 2 years ago

Not fully implemented at the moment. Initial version should be done within the next few days. Will add the pass to compiler pipeline once initial version is completed.

leoqiao18 commented 2 years ago

Pattern matching stuff are all implemented now, including:

All test cases are passing except for "drop inference in pattern matching" in the DropInference suite. I don't know why it's failing, but I am inclined to believe that it is some problem with the test case itself. @j-hui