Closed ghost closed 6 years ago
By the way, you probably want to still derive show
so you can have something to display the raw AST form. Maybe it would be better to name these functions something other than pp_
.
Also, if you aren't familiar with the weird box formatting notation there are some explanations here (scroll down to "Printing to stdout: using printf") along with an example. The docs for the Format
module also cover some of it in more detail.
This is really cool! I'm sorry that I didn't see this, now I appear to have created some merge conflicts 😦
I'm still not certain if I'm done moving the syntax around yet, btw. But I think it's at least in a better state than it was.
Yeah, no worries about the merge conflicts. If you want to wait a little while on this so you can experiment with the syntax more that's fine. Let me know when you think it's ready. Alternatively, you should have commit rights for this (on my repo I guess) so feel free to modify it.
Also some of this was kind of tentative anyway since I wasn't really sure how you wanted the concrete syntax to look.
Here is a quick and dirty pretty printer. It hasn't been tested much so it probably has some bugs.
Example session below: