Less dippy application

This commit is contained in:
Tom Jack 2020-01-11 19:37:38 -06:00 committed by Pierre-Emmanuel Wulfman
parent 8e34c4a678
commit 0895467f74
2 changed files with 11 additions and 7 deletions

View File

@ -10,10 +10,10 @@ let%expect_test _ =
[%expect {| 1874 bytes |}] ;
run_ligo_good [ "measure-contract" ; contract "multisig.ligo" ; "main" ] ;
[%expect {| 1163 bytes |}] ;
[%expect {| 1169 bytes |}] ;
run_ligo_good [ "measure-contract" ; contract "multisig-v2.ligo" ; "main" ] ;
[%expect {| 2867 bytes |}] ;
[%expect {| 2862 bytes |}] ;
run_ligo_good [ "measure-contract" ; contract "vote.mligo" ; "main" ] ;
[%expect {| 617 bytes |}] ;
@ -431,9 +431,10 @@ let%expect_test _ =
DIP { DUP } ;
SWAP ;
DIP { DROP 4 } } ;
DIP { DUP } ;
SWAP ;
UNIT ;
DIP 2 { DUP } ;
DIG 2 ;
SWAP ;
EXEC ;
DIP { DUP } ;
PAIR ;
@ -621,7 +622,9 @@ let%expect_test _ =
CDR ;
CAR ;
CDR ;
DIP { DIP 12 { DUP } ; DIG 12 } ;
DIP 13 { DUP } ;
DIG 13 ;
SWAP ;
EXEC ;
DIP { DUP } ;
SWAP ;

View File

@ -251,11 +251,12 @@ and translate_expression (expr:expression) (env:environment) : michelson result
)
| E_application (f , arg) -> (
trace (simple_error "Compiling quote application") @@
let%bind f = translate_expression f env in
let%bind f = translate_expression f (Environment.add (Var.fresh (), arg.type_value) env) in
let%bind arg = translate_expression arg env in
return @@ seq [
arg ;
dip f ;
f ;
i_swap ;
prim I_EXEC ;
]
)