ssm-lang / sslang

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

Allow recursive patterns in the IR #126

Closed yiming-fang closed 1 year ago

yiming-fang commented 1 year ago

This PR adds recursive pattern matching in the IR and also fixes the later passes that are affected by this change. All passes after type checking will assume that the patterns are non-recursive even though recursive patterns are expressible.

Recursive patterns in the IR are a prerequisite for moving the desugaring and exhaustion-checking to the IR, i.e., after type checking.

leoqiao18 commented 1 year ago

@j-hui I am not super familiar with the PatDef and PatFn; in particular, how are the patterns in these data types actually being used by the AST? Are the patterns used in definitions like the following?

foo [] = ...
foo (x:xs) = ...

Or are these patterns something else entirely.