Reimplement Michelson pretty printer
The current printer is from lib_micheline
, which is not good to print comments:
DROP
/* free unit_165 */ ;
PUSH int 1
/* env: [ (_const_166 : int) ] */ ;
PUSH int 2
/* env: [ (_const_167 : int); (_const_166 : int) ] */ ;
PUSH int -1
/* env: [ (_const_168 : int); (_const_167 : int); (_const_166 : int) ] */ ;
ADD
/* call +, env: [ (_result_+_169 : int); (_const_166 : int) ] */ ;
- Comment using
#
, in the same line of the opcode, i.e.DROP; # free unit_165
- If an opcode has multiple comments, multiple
#
lines should be attached:OPCODE ; # comment1 # comment 2 # comment 3
- Closing
}
should be in a new line.