Proto/Michelson: Extract unparsing functions from Script_typed_ir.
Context
Another step towards #1374.
This MR extracts unparsing functions from Script_ir_translator
into their own module Script_ir_unparser
. Unfortunately the most important function in the latter module, parse_data
depends on a couple of functions from Script_ir_translator
. For the moment the dependency is broken using a functor, whose output is included (and re-exported from) Script_ir_translator
. This could perhaps be resolved in a better way, but for the moment I have no good idea how to do it. Alternatively, functions from the functor could be moved to yet another module, depending on Script_ir_translator
(in which case the functor wouldn't be needed anymore).
There might also be performance concerns if the functor isn't inlined during compilation (is there a way to force this?).
As a bonus, some docstrings are added to the interface of Script_ir_unparsing
.
Manually testing the MR
There are no semantic changes, only code being moved around, so type-checking + CI.
Checklist
-
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR