Open grosu opened 8 years ago
Yes, we could.
Should #prettyPrint
be hooked to the meta or ground-level unparsing? I.e., should it print #token("foo", Id)
or foo
? From the example, it seems it should be the latter.
Yes, I think the latter. And this should be the naive prettyPrinter, not the smart unparser. We will probably have an unparser hook, too, but no need to worry about it right now. Thanks.
I will say I have no objection to having a #prettyPrint function but I am strongly opposed to using it to implement more basic conversions between types. This is both a performance issue and an issue with compatibility because supporting the pretty-printer from within the OCAML backend would be highly nontrivial.
Do we? If we do, then wouldn't it be nice to use it when defining the
Id2String
function? That is, instead of using a hook, like we do now,to have something like this