Use ppx_deriving.show for AST pretty-printers
AST printers are currently implemented manually. This is quite tedious to maintain and extend.
To address this, we would like to replace the existing pretty-printers with ones that are generated using ppx_deriving.show. This involves removing the Ast_printers module as much as possible. All uses of Ast_printer shall use the generated pretty-printers instead. To see where the printers are used, you can comment each printer out in the existing module.
You can find almost all AST elements which we like to pretty-print in lib_webassembly's Ast module. Generating the printers is as easy as annotating the data types we need.
To make the ppx_deriving.show in lib_webassembly, you have to modify the manifest.
- Manifest for lib_webassembly: https://gitlab.com/tezos/tezos/-/blob/master/manifest/main.ml#L1114-1123
- Manifest example for
ppx_deriving.show: https://gitlab.com/tezos/tezos/-/blob/master/manifest/main.ml#L1154 - The command
make -C manifestgenerates the new manifest
See previous notes on this thread.
Edited by Ole Krüger