[#442] Fix contracts' pretty-printer
Description
Problem: contracts that include PUSHing a lambda-typed expression are printed misaligned using morley's printer, causing tezos-client to refuse to accept them. The problem lies in printing instructions inside the PUSH on one line, but then encountering a nested expression (e.g. DIP) and recursively pretty-printing over several lines, causing the PUSH and, consequently, the contract to be misaligned.
Solution: disambiguated how to render PUSH expressions based on their type; short values are now printed in one line as before (e.g. PUSH int 5), values that might include further instructions (like lambdas and Some) are printed with all arguments hanging, like in LAMBDA instructions. Contracts for tests are fixed accordingly.
Related issue(s)
Resolves #442 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.