yeslogic / fathom

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

Make it easier to distill/pretty print values #496

Closed brendanzab closed 1 year ago

brendanzab commented 1 year ago

In an attempt to address #488, this reduces some of the gymnasics we’ve needed to do whenever we want to pretty print something. We achieve this by cloning the name environment as opposed to taking it by mutable reference when constructing a distillation environment.

This means we can no longer reuse the existing allocation when temporarily pushing local names, but I think the savings we got from this was probably minor, and the increase in clarity is worth it.