yeslogic / fathom

🚧 (Alpha stage software) A declarative data definition language for formally specifying binary data formats. 🚧
Apache License 2.0
259 stars 14 forks source link

Preserve name of default branch in `core::Term::ConstMatch` #419

Closed Kmeakin closed 1 year ago

Kmeakin commented 1 year ago

At the moment, we throw away the name of the binder when elaborating pattern matches to ConstMatch with a default branch

eg

match x {
    0 => 1,
    y => y,
}

elaborates to

match x {
    0 => 1,
    _ => _,
}

This patch preserves the name of the binding, making the elaborated core more readable

brendanzab commented 1 year ago

This is great, thanks!