uncapitalize micheslon_or's %-annotations

This commit is contained in:
Lesenechal Remi 2020-05-04 18:22:26 +02:00
parent 29de1278b4
commit 7bbfa9ff97
2 changed files with 4 additions and 3 deletions

View File

@ -106,7 +106,7 @@ let%expect_test _ =
( LIST_EMPTY() , Baz4("eq") ) |}] ;
run_ligo_good [ "compile-contract" ; contract "michelson_converter_or.mligo" ; "main_r" ] ;
[%expect {|
{ parameter (or (int %Foo4) (or (nat %Bar4) (or (string %Baz4) (bool %Boz4)))) ;
{ parameter (or (int %foo4) (or (nat %bar4) (or (string %baz4) (bool %boz4)))) ;
storage (or (or (nat %bar4) (string %baz4)) (or (bool %boz4) (int %foo4))) ;
code { PUSH string "eq" ;
LEFT bool ;
@ -139,7 +139,7 @@ let%expect_test _ =
( LIST_EMPTY() , Baz4("eq") ) |}] ;
run_ligo_good [ "compile-contract" ; contract "michelson_converter_or.mligo" ; "main_l" ] ;
[%expect {|
{ parameter (or (or (or (int %Foo4) (nat %Bar4)) (string %Baz4)) (bool %Boz4)) ;
{ parameter (or (or (or (int %foo4) (nat %bar4)) (string %baz4)) (bool %boz4)) ;
storage (or (or (nat %bar4) (string %baz4)) (or (bool %boz4) (int %foo4))) ;
code { PUSH string "eq" ;
LEFT bool ;

View File

@ -163,7 +163,8 @@ let kv_list_of_record_or_tuple (m: _ LMap.t) =
let remove_empty_annotation (ann : string option) : string option =
match ann with
| Some "" -> None
| _ -> ann
| Some ann -> Some (String.uncapitalize_ascii ann)
| None -> None
let is_michelson_or (t: _ constructor_map) =
CMap.cardinal t = 2 &&