From 097c5ca0fb17a3d0d93629487837b90c83c51974 Mon Sep 17 00:00:00 2001 From: Galfour Date: Tue, 23 Apr 2019 07:30:43 +0000 Subject: [PATCH] change bin display --- src/lib_utils/x_tezos_micheline.ml | 8 ++++++++ src/ligo/main/contract.ml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib_utils/x_tezos_micheline.ml b/src/lib_utils/x_tezos_micheline.ml index ff497414f..1f2656c03 100644 --- a/src/lib_utils/x_tezos_micheline.ml +++ b/src/lib_utils/x_tezos_micheline.ml @@ -54,6 +54,7 @@ module Michelson = struct let i_if a b = prim ~children:[a;b] I_IF let i_if_none a b = prim ~children:[a;b] I_IF_NONE + let i_if_left a b = prim ~children:[a;b] I_IF_LEFT let i_failwith = prim I_FAILWITH let i_assert_some = i_if_none (seq [i_failwith]) (seq []) @@ -78,6 +79,13 @@ module Michelson = struct let node = printable string_of_prim canonical in print_expr ppf node + let pp_stripped ppf (michelson:michelson) = + let open Micheline_printer in + let michelson' = strip_nops @@ strip_annots michelson in + let canonical = strip_locations michelson' in + let node = printable string_of_prim canonical in + print_expr ppf node + let pp_naked ppf m = let naked = strip_annots m in pp ppf naked diff --git a/src/ligo/main/contract.ml b/src/ligo/main/contract.ml index ac35890d1..98d673483 100644 --- a/src/ligo/main/contract.ml +++ b/src/ligo/main/contract.ml @@ -81,7 +81,7 @@ let compile_contract_file : string -> string -> string result = fun source entry trace (simple_error "compiling") @@ Compiler.translate_contract mini_c entry_point in let str = - Format.asprintf "%a" Micheline.Michelson.pp michelson in + Format.asprintf "%a" Micheline.Michelson.pp_stripped michelson in ok str let compile_contract_parameter : string -> string -> string -> string result = fun source entry_point expression -> @@ -126,7 +126,7 @@ let compile_contract_parameter : string -> string -> string -> string result = f trace (simple_error "compiling expression") @@ Compiler.translate_value mini_c in let str = - Format.asprintf "%a" Micheline.Michelson.pp michelson in + Format.asprintf "%a" Micheline.Michelson.pp_stripped michelson in ok str in ok expr