diff --git a/src/passes/1-parser/reasonligo/Parser.mly b/src/passes/1-parser/reasonligo/Parser.mly index 2b257d80c..88c01af3b 100644 --- a/src/passes/1-parser/reasonligo/Parser.mly +++ b/src/passes/1-parser/reasonligo/Parser.mly @@ -278,6 +278,7 @@ let_binding: } | par(closed_irrefutable) type_annotation? "=" expr { wild_error $4; + Scoping.check_pattern $1.value.inside; {binders = $1.value.inside, []; lhs_type=$2; eq=$3; let_rhs=$4} } | tuple(sub_irrefutable) type_annotation? "=" expr { diff --git a/src/passes/1-parser/reasonligo/Pretty.ml b/src/passes/1-parser/reasonligo/Pretty.ml index c4cec4c65..634e4d5a4 100644 --- a/src/passes/1-parser/reasonligo/Pretty.ml +++ b/src/passes/1-parser/reasonligo/Pretty.ml @@ -98,7 +98,10 @@ and pp_bytes {value; _} = string ("0x" ^ Hex.show (snd value)) and pp_ppar {value; _} = - string "(" ^^ nest 1 (pp_pattern value.inside) ^^ string ")" + if value.lpar = Region.ghost then + nest 1 (pp_pattern value.inside) + else + string "(" ^^ nest 1 (pp_pattern value.inside) ^^ string ")" and pp_plist = function PListComp cmp -> pp_list_comp cmp @@ -475,9 +478,10 @@ and pp_fun_args {value; _} = and pp_fun_type {value; _} = let lhs, _, rhs = value in - match rhs with - | TFun tf -> string "(" ^^ pp_type_expr lhs ^^ string ", " ^^ pp_fun_args tf - | _ -> group (string "(" ^^ pp_type_expr lhs ^^ string " =>" ^/^ pp_type_expr rhs ^^ string ")") + match lhs, rhs with + | _, TFun tf -> string "(" ^^ pp_type_expr lhs ^^ string ", " ^^ pp_fun_args tf + | TVar _ , _ -> group (pp_type_expr lhs ^^ string " =>" ^/^ pp_type_expr rhs) + | _ -> group (string "(" ^^ pp_type_expr lhs ^^ string ")" ^^ string " =>" ^/^ pp_type_expr rhs) (* group (string "(" ^^ pp_type_expr lhs ^^ string ")" ^^ string " =>" ^/^ pp_type_expr rhs) *) diff --git a/src/test/contracts/dune b/src/test/contracts/dune index 748a48f1a..586fdf5e5 100644 --- a/src/test/contracts/dune +++ b/src/test/contracts/dune @@ -1,3 +1,4 @@ +;; pretty print contracts to an output file (rule (targets address.output) (action (with-stdout-to address.output (run ligo "pretty-print" "address.religo"))) (deps address.religo)) (rule (targets amount.output) (action (with-stdout-to amount.output (run ligo "pretty-print" "amount.religo"))) (deps amount.religo)) (rule (targets arithmetic.output) (action (with-stdout-to arithmetic.output (run ligo "pretty-print" "arithmetic.religo"))) (deps arithmetic.religo)) @@ -53,7 +54,7 @@ (rule (targets variant.output) (action (with-stdout-to variant.output (run ligo "pretty-print" "variant.religo"))) (deps variant.religo)) (rule (targets website2.output) (action (with-stdout-to website2.output (run ligo "pretty-print" "website2.religo"))) (deps website2.religo)) - +;; compare the output with the expected result (alias (name runtest) (action (diff expected/address.religo address.output))) (alias (name runtest) (action (diff expected/amount.religo amount.output))) (alias (name runtest) (action (diff expected/arithmetic.religo arithmetic.output))) @@ -109,6 +110,7 @@ (alias (name runtest) (action (diff expected/variant.religo variant.output))) (alias (name runtest) (action (diff expected/website2.religo website2.output))) +;; try to parse the generated contracts (alias (name runtest) (action (ignore-stdout (run ligo print-cst address.output -s reasonligo))) (deps address.output)) (alias (name runtest) (action (ignore-stdout (run ligo print-cst amount.output -s reasonligo))) (deps amount.output)) (alias (name runtest) (action (ignore-stdout (run ligo print-cst arithmetic.output -s reasonligo))) (deps arithmetic.output)) @@ -163,3 +165,276 @@ (alias (name runtest) (action (ignore-stdout (run ligo print-cst tuples_sequences_functions.output -s reasonligo))) (deps tuples_sequences_functions.output)) (alias (name runtest) (action (ignore-stdout (run ligo print-cst variant.output -s reasonligo))) (deps variant.output)) (alias (name runtest) (action (ignore-stdout (run ligo print-cst website2.output -s reasonligo))) (deps website2.output)) + +;; pretty print with the former pretty printed contracts as input +(rule (targets address.output2) (action (with-stdout-to address.output2 (run ligo pretty-print address.output -s reasonligo))) (deps address.output)) +(rule (targets amount.output2) (action (with-stdout-to amount.output2 (run ligo pretty-print amount.output -s reasonligo))) (deps amount.output)) +(rule (targets arithmetic.output2) (action (with-stdout-to arithmetic.output2 (run ligo pretty-print arithmetic.output -s reasonligo))) (deps arithmetic.output)) +(rule (targets bad_address_format.output2) (action (with-stdout-to bad_address_format.output2 (run ligo pretty-print bad_address_format.output -s reasonligo))) (deps bad_address_format.output)) +(rule (targets balance_constant.output2) (action (with-stdout-to balance_constant.output2 (run ligo pretty-print balance_constant.output -s reasonligo))) (deps balance_constant.output)) +(rule (targets bitwise_arithmetic.output2) (action (with-stdout-to bitwise_arithmetic.output2 (run ligo pretty-print bitwise_arithmetic.output -s reasonligo))) (deps bitwise_arithmetic.output)) +(rule (targets boolean_operators.output2) (action (with-stdout-to boolean_operators.output2 (run ligo pretty-print boolean_operators.output -s reasonligo))) (deps boolean_operators.output)) +(rule (targets bytes_arithmetic.output2) (action (with-stdout-to bytes_arithmetic.output2 (run ligo pretty-print bytes_arithmetic.output -s reasonligo))) (deps bytes_arithmetic.output)) +(rule (targets bytes_unpack.output2) (action (with-stdout-to bytes_unpack.output2 (run ligo pretty-print bytes_unpack.output -s reasonligo))) (deps bytes_unpack.output)) +(rule (targets check_signature.output2) (action (with-stdout-to check_signature.output2 (run ligo pretty-print check_signature.output -s reasonligo))) (deps check_signature.output)) +(rule (targets closure.output2) (action (with-stdout-to closure.output2 (run ligo pretty-print closure.output -s reasonligo))) (deps closure.output)) +(rule (targets condition-shadowing.output2) (action (with-stdout-to condition-shadowing.output2 (run ligo pretty-print condition-shadowing.output -s reasonligo))) (deps condition-shadowing.output)) +(rule (targets condition.output2) (action (with-stdout-to condition.output2 (run ligo pretty-print condition.output -s reasonligo))) (deps condition.output)) +(rule (targets counter.output2) (action (with-stdout-to counter.output2 (run ligo pretty-print counter.output -s reasonligo))) (deps counter.output)) +(rule (targets crypto.output2) (action (with-stdout-to crypto.output2 (run ligo pretty-print crypto.output -s reasonligo))) (deps crypto.output)) +(rule (targets empty_case.output2) (action (with-stdout-to empty_case.output2 (run ligo pretty-print empty_case.output -s reasonligo))) (deps empty_case.output)) +(rule (targets eq_bool.output2) (action (with-stdout-to eq_bool.output2 (run ligo pretty-print eq_bool.output -s reasonligo))) (deps eq_bool.output)) +(rule (targets failwith.output2) (action (with-stdout-to failwith.output2 (run ligo pretty-print failwith.output -s reasonligo))) (deps failwith.output)) +(rule (targets function-shared.output2) (action (with-stdout-to function-shared.output2 (run ligo pretty-print function-shared.output -s reasonligo))) (deps function-shared.output)) +(rule (targets high-order.output2) (action (with-stdout-to high-order.output2 (run ligo pretty-print high-order.output -s reasonligo))) (deps high-order.output)) +(rule (targets implicit_account.output2) (action (with-stdout-to implicit_account.output2 (run ligo pretty-print implicit_account.output -s reasonligo))) (deps implicit_account.output)) +(rule (targets included.output2) (action (with-stdout-to included.output2 (run ligo pretty-print included.output -s reasonligo))) (deps included.output)) + +(rule (targets includer.output2) (action (with-stdout-to includer.output2 (run ligo pretty-print includer.output -s reasonligo))) (deps includer.output)) +(rule (targets key_hash.output2) (action (with-stdout-to key_hash.output2 (run ligo pretty-print key_hash.output -s reasonligo))) (deps key_hash.output)) +(rule (targets lambda.output2) (action (with-stdout-to lambda.output2 (run ligo pretty-print lambda.output -s reasonligo))) (deps lambda.output)) +(rule (targets lambda2.output2) (action (with-stdout-to lambda2.output2 (run ligo pretty-print lambda2.output -s reasonligo))) (deps lambda2.output)) +(rule (targets let_multiple.output2) (action (with-stdout-to let_multiple.output2 (run ligo pretty-print let_multiple.output -s reasonligo))) (deps let_multiple.output)) +(rule (targets letin.output2) (action (with-stdout-to letin.output2 (run ligo pretty-print letin.output -s reasonligo))) (deps letin.output)) +(rule (targets list.output2) (action (with-stdout-to list.output2 (run ligo pretty-print list.output -s reasonligo))) (deps list.output)) +(rule (targets loop.output2) (action (with-stdout-to loop.output2 (run ligo pretty-print loop.output -s reasonligo))) (deps loop.output)) +(rule (targets map.output2) (action (with-stdout-to map.output2 (run ligo pretty-print map.output -s reasonligo))) (deps map.output)) +(rule (targets match_bis.output2) (action (with-stdout-to match_bis.output2 (run ligo pretty-print match_bis.output -s reasonligo))) (deps match_bis.output)) +(rule (targets match.output2) (action (with-stdout-to match.output2 (run ligo pretty-print match.output -s reasonligo))) (deps match.output)) +(rule (targets michelson_pair_tree.output2) (action (with-stdout-to michelson_pair_tree.output2 (run ligo pretty-print michelson_pair_tree.output -s reasonligo))) (deps michelson_pair_tree.output)) +(rule (targets multiple-parameters.output2) (action (with-stdout-to multiple-parameters.output2 (run ligo pretty-print multiple-parameters.output -s reasonligo))) (deps multiple-parameters.output)) +(rule (targets multisig.output2) (action (with-stdout-to multisig.output2 (run ligo pretty-print multisig.output -s reasonligo))) (deps multisig.output)) +(rule (targets no_semicolon.output2) (action (with-stdout-to no_semicolon.output2 (run ligo pretty-print no_semicolon.output -s reasonligo))) (deps no_semicolon.output)) +(rule (targets pledge.output2) (action (with-stdout-to pledge.output2 (run ligo pretty-print pledge.output -s reasonligo))) (deps pledge.output)) +(rule (targets record.output2) (action (with-stdout-to record.output2 (run ligo pretty-print record.output -s reasonligo))) (deps record.output)) +(rule (targets recursion.output2) (action (with-stdout-to recursion.output2 (run ligo pretty-print recursion.output -s reasonligo))) (deps recursion.output)) +(rule (targets self_address.output2) (action (with-stdout-to self_address.output2 (run ligo pretty-print self_address.output -s reasonligo))) (deps self_address.output)) +(rule (targets set_arithmetic.output2) (action (with-stdout-to set_arithmetic.output2 (run ligo pretty-print set_arithmetic.output -s reasonligo))) (deps set_arithmetic.output)) +(rule (targets set_delegate.output2) (action (with-stdout-to set_delegate.output2 (run ligo pretty-print set_delegate.output -s reasonligo))) (deps set_delegate.output)) +(rule (targets single_record_item.output2) (action (with-stdout-to single_record_item.output2 (run ligo pretty-print single_record_item.output -s reasonligo))) (deps single_record_item.output)) +(rule (targets string_arithmetic.output2) (action (with-stdout-to string_arithmetic.output2 (run ligo pretty-print string_arithmetic.output -s reasonligo))) (deps string_arithmetic.output)) +(rule (targets super-counter.output2) (action (with-stdout-to super-counter.output2 (run ligo pretty-print super-counter.output -s reasonligo))) (deps super-counter.output)) +(rule (targets tuple_list.output2) (action (with-stdout-to tuple_list.output2 (run ligo pretty-print tuple_list.output -s reasonligo))) (deps tuple_list.output)) +(rule (targets tuple_param_destruct.output2) (action (with-stdout-to tuple_param_destruct.output2 (run ligo pretty-print tuple_param_destruct.output -s reasonligo))) (deps tuple_param_destruct.output)) +(rule (targets tuple_type.output2) (action (with-stdout-to tuple_type.output2 (run ligo pretty-print tuple_type.output -s reasonligo))) (deps tuple_type.output)) +(rule (targets tuple.output2) (action (with-stdout-to tuple.output2 (run ligo pretty-print tuple.output -s reasonligo))) (deps tuple.output)) +(rule (targets tuples_no_annotation.output2) (action (with-stdout-to tuples_no_annotation.output2 (run ligo pretty-print tuples_no_annotation.output -s reasonligo))) (deps tuples_no_annotation.output)) +(rule (targets tuples_sequences_functions.output2) (action (with-stdout-to tuples_sequences_functions.output2 (run ligo pretty-print tuples_sequences_functions.output -s reasonligo))) (deps tuples_sequences_functions.output)) +(rule (targets variant.output2) (action (with-stdout-to variant.output2 (run ligo pretty-print variant.output -s reasonligo))) (deps variant.output)) +(rule (targets website2.output2) (action (with-stdout-to website2.output2 (run ligo pretty-print website2.output -s reasonligo))) (deps website2.output)) + +;; diff the pretty printed contract with the pretty printed pretty printed contract +(alias (name runtest) (action (diff address.output address.output2)) (deps address.output address.output2)) +(alias (name runtest) (action (diff amount.output amount.output2)) (deps amount.output amount.output2)) +(alias (name runtest) (action (diff arithmetic.output arithmetic.output2)) (deps arithmetic.output arithmetic.output2)) +(alias (name runtest) (action (diff bad_address_format.output bad_address_format.output2)) (deps bad_address_format.output bad_address_format.output2)) +(alias (name runtest) (action (diff balance_constant.output balance_constant.output2)) (deps balance_constant.output balance_constant.output2)) +(alias (name runtest) (action (diff bitwise_arithmetic.output bitwise_arithmetic.output2)) (deps bitwise_arithmetic.output bitwise_arithmetic.output2)) +(alias (name runtest) (action (diff boolean_operators.output boolean_operators.output2)) (deps boolean_operators.output boolean_operators.output2)) +(alias (name runtest) (action (diff bytes_arithmetic.output bytes_arithmetic.output2)) (deps bytes_arithmetic.output bytes_arithmetic.output2)) +(alias (name runtest) (action (diff bytes_unpack.output bytes_unpack.output2)) (deps bytes_unpack.output bytes_unpack.output2)) +(alias (name runtest) (action (diff check_signature.output check_signature.output2)) (deps check_signature.output check_signature.output2)) +(alias (name runtest) (action (diff closure.output closure.output2)) (deps closure.output closure.output2)) +(alias (name runtest) (action (diff condition-shadowing.output condition-shadowing.output2)) (deps condition-shadowing.output condition-shadowing.output2)) +(alias (name runtest) (action (diff condition.output condition.output2)) (deps condition.output condition.output2)) +(alias (name runtest) (action (diff counter.output counter.output2)) (deps counter.output counter.output2)) +(alias (name runtest) (action (diff crypto.output crypto.output2)) (deps crypto.output crypto.output2)) +(alias (name runtest) (action (diff empty_case.output empty_case.output2)) (deps empty_case.output empty_case.output2)) +(alias (name runtest) (action (diff eq_bool.output eq_bool.output2)) (deps eq_bool.output eq_bool.output2)) +(alias (name runtest) (action (diff failwith.output failwith.output2)) (deps failwith.output failwith.output2)) +(alias (name runtest) (action (diff function-shared.output function-shared.output2)) (deps function-shared.output function-shared.output2)) +(alias (name runtest) (action (diff high-order.output high-order.output2)) (deps high-order.output high-order.output2)) +(alias (name runtest) (action (diff implicit_account.output implicit_account.output2)) (deps implicit_account.output implicit_account.output2)) +(alias (name runtest) (action (diff included.output included.output2)) (deps included.output included.output2)) +(alias (name runtest) (action (diff includer.output includer.output2)) (deps includer.output includer.output2)) +(alias (name runtest) (action (diff key_hash.output key_hash.output2)) (deps key_hash.output key_hash.output2)) +(alias (name runtest) (action (diff lambda.output lambda.output2)) (deps lambda.output lambda.output2)) +(alias (name runtest) (action (diff lambda2.output lambda2.output2)) (deps lambda2.output lambda2.output2)) +(alias (name runtest) (action (diff let_multiple.output let_multiple.output2)) (deps let_multiple.output let_multiple.output2)) +(alias (name runtest) (action (diff letin.output letin.output2)) (deps letin.output letin.output2)) +(alias (name runtest) (action (diff list.output list.output2)) (deps list.output list.output2)) +(alias (name runtest) (action (diff loop.output loop.output2)) (deps loop.output loop.output2)) +(alias (name runtest) (action (diff map.output map.output2)) (deps map.output map.output2)) +(alias (name runtest) (action (diff match_bis.output match_bis.output2)) (deps match_bis.output match_bis.output2)) +(alias (name runtest) (action (diff match.output match.output2)) (deps match.output match.output2)) +(alias (name runtest) (action (diff michelson_pair_tree.output michelson_pair_tree.output2)) (deps michelson_pair_tree.output michelson_pair_tree.output2)) +(alias (name runtest) (action (diff multiple-parameters.output multiple-parameters.output2)) (deps multiple-parameters.output multiple-parameters.output2)) +(alias (name runtest) (action (diff multisig.output multisig.output2)) (deps multisig.output multisig.output2)) +(alias (name runtest) (action (diff no_semicolon.output no_semicolon.output2)) (deps no_semicolon.output no_semicolon.output2)) +(alias (name runtest) (action (diff pledge.output pledge.output2)) (deps pledge.output pledge.output2)) +(alias (name runtest) (action (diff record.output record.output2)) (deps record.output record.output2)) +(alias (name runtest) (action (diff recursion.output recursion.output2)) (deps recursion.output recursion.output2)) +(alias (name runtest) (action (diff self_address.output self_address.output2)) (deps self_address.output self_address.output2)) +(alias (name runtest) (action (diff set_arithmetic.output set_arithmetic.output2)) (deps set_arithmetic.output set_arithmetic.output2)) +(alias (name runtest) (action (diff set_delegate.output set_delegate.output2)) (deps set_delegate.output set_delegate.output2)) +(alias (name runtest) (action (diff single_record_item.output single_record_item.output2)) (deps single_record_item.output single_record_item.output2)) +(alias (name runtest) (action (diff string_arithmetic.output string_arithmetic.output2)) (deps string_arithmetic.output string_arithmetic.output2)) +(alias (name runtest) (action (diff super-counter.output super-counter.output2)) (deps super-counter.output super-counter.output2)) +(alias (name runtest) (action (diff tuple_list.output tuple_list.output2)) (deps tuple_list.output tuple_list.output2)) +(alias (name runtest) (action (diff tuple_param_destruct.output tuple_param_destruct.output2)) (deps tuple_param_destruct.output tuple_param_destruct.output2)) +(alias (name runtest) (action (diff tuple_type.output tuple_type.output2)) (deps tuple_type.output tuple_type.output2)) +(alias (name runtest) (action (diff tuple.output tuple.output2)) (deps tuple.output tuple.output2)) +(alias (name runtest) (action (diff tuples_no_annotation.output tuples_no_annotation.output2)) (deps tuples_no_annotation.output tuples_no_annotation.output2)) +(alias (name runtest) (action (diff tuples_sequences_functions.output tuples_sequences_functions.output2)) (deps tuples_sequences_functions.output tuples_sequences_functions.output2)) +(alias (name runtest) (action (diff variant.output variant.output2)) (deps variant.output variant.output2)) +(alias (name runtest) (action (diff website2.output website2.output2)) (deps website2.output website2.output2)) + +(rule (targets address.ast) (action (with-stdout-to address.ast (run ligo print-ast address.religo -s reasonligo))) (deps address.religo)) +(rule (targets amount.ast) (action (with-stdout-to amount.ast (run ligo print-ast amount.religo -s reasonligo))) (deps amount.religo)) +(rule (targets arithmetic.ast) (action (with-stdout-to arithmetic.ast (run ligo print-ast arithmetic.religo -s reasonligo))) (deps arithmetic.religo)) +(rule (targets balance_constant.ast) (action (with-stdout-to balance_constant.ast (run ligo print-ast balance_constant.religo -s reasonligo))) (deps balance_constant.religo)) +(rule (targets bitwise_arithmetic.ast) (action (with-stdout-to bitwise_arithmetic.ast (run ligo print-ast bitwise_arithmetic.religo -s reasonligo))) (deps bitwise_arithmetic.religo)) +(rule (targets boolean_operators.ast) (action (with-stdout-to boolean_operators.ast (run ligo print-ast boolean_operators.religo -s reasonligo))) (deps boolean_operators.religo)) +(rule (targets bytes_arithmetic.ast) (action (with-stdout-to bytes_arithmetic.ast (run ligo print-ast bytes_arithmetic.religo -s reasonligo))) (deps bytes_arithmetic.religo)) +(rule (targets bytes_unpack.ast) (action (with-stdout-to bytes_unpack.ast (run ligo print-ast bytes_unpack.religo -s reasonligo))) (deps bytes_unpack.religo)) +(rule (targets check_signature.ast) (action (with-stdout-to check_signature.ast (run ligo print-ast check_signature.religo -s reasonligo))) (deps check_signature.religo)) +(rule (targets closure.ast) (action (with-stdout-to closure.ast (run ligo print-ast closure.religo -s reasonligo))) (deps closure.religo)) +(rule (targets condition-shadowing.ast) (action (with-stdout-to condition-shadowing.ast (run ligo print-ast condition-shadowing.religo -s reasonligo))) (deps condition-shadowing.religo)) +(rule (targets condition.ast) (action (with-stdout-to condition.ast (run ligo print-ast condition.religo -s reasonligo))) (deps condition.religo)) +(rule (targets counter.ast) (action (with-stdout-to counter.ast (run ligo print-ast counter.religo -s reasonligo))) (deps counter.religo)) +(rule (targets crypto.ast) (action (with-stdout-to crypto.ast (run ligo print-ast crypto.religo -s reasonligo))) (deps crypto.religo)) +(rule (targets empty_case.ast) (action (with-stdout-to empty_case.ast (run ligo print-ast empty_case.religo -s reasonligo))) (deps empty_case.religo)) +(rule (targets eq_bool.ast) (action (with-stdout-to eq_bool.ast (run ligo print-ast eq_bool.religo -s reasonligo))) (deps eq_bool.religo)) +(rule (targets function-shared.ast) (action (with-stdout-to function-shared.ast (run ligo print-ast function-shared.religo -s reasonligo))) (deps function-shared.religo)) +(rule (targets high-order.ast) (action (with-stdout-to high-order.ast (run ligo print-ast high-order.religo -s reasonligo))) (deps high-order.religo)) +(rule (targets implicit_account.ast) (action (with-stdout-to implicit_account.ast (run ligo print-ast implicit_account.religo -s reasonligo))) (deps implicit_account.religo)) +(rule (targets included.ast) (action (with-stdout-to included.ast (run ligo print-ast included.religo -s reasonligo))) (deps included.religo)) +(rule (targets includer.ast) (action (with-stdout-to includer.ast (run ligo print-ast includer.religo -s reasonligo))) (deps includer.religo)) +(rule (targets key_hash.ast) (action (with-stdout-to key_hash.ast (run ligo print-ast key_hash.religo -s reasonligo))) (deps key_hash.religo)) +(rule (targets lambda.ast) (action (with-stdout-to lambda.ast (run ligo print-ast lambda.religo -s reasonligo))) (deps lambda.religo)) +(rule (targets lambda2.ast) (action (with-stdout-to lambda2.ast (run ligo print-ast lambda2.religo -s reasonligo))) (deps lambda2.religo)) +(rule (targets let_multiple.ast) (action (with-stdout-to let_multiple.ast (run ligo print-ast let_multiple.religo -s reasonligo))) (deps let_multiple.religo)) +(rule (targets letin.ast) (action (with-stdout-to letin.ast (run ligo print-ast letin.religo -s reasonligo))) (deps letin.religo)) +(rule (targets list.ast) (action (with-stdout-to list.ast (run ligo print-ast list.religo -s reasonligo))) (deps list.religo)) +(rule (targets loop.ast) (action (with-stdout-to loop.ast (run ligo print-ast loop.religo -s reasonligo))) (deps loop.religo)) +(rule (targets map.ast) (action (with-stdout-to map.ast (run ligo print-ast map.religo -s reasonligo))) (deps map.religo)) +(rule (targets match_bis.ast) (action (with-stdout-to match_bis.ast (run ligo print-ast match_bis.religo -s reasonligo))) (deps match_bis.religo)) +(rule (targets match.ast) (action (with-stdout-to match.ast (run ligo print-ast match.religo -s reasonligo))) (deps match.religo)) +(rule (targets michelson_pair_tree.ast) (action (with-stdout-to michelson_pair_tree.ast (run ligo print-ast michelson_pair_tree.religo -s reasonligo))) (deps michelson_pair_tree.religo)) +(rule (targets multiple-parameters.ast) (action (with-stdout-to multiple-parameters.ast (run ligo print-ast multiple-parameters.religo -s reasonligo))) (deps multiple-parameters.religo)) +(rule (targets multisig.ast) (action (with-stdout-to multisig.ast (run ligo print-ast multisig.religo -s reasonligo))) (deps multisig.religo)) +(rule (targets no_semicolon.ast) (action (with-stdout-to no_semicolon.ast (run ligo print-ast no_semicolon.religo -s reasonligo))) (deps no_semicolon.religo)) +(rule (targets pledge.ast) (action (with-stdout-to pledge.ast (run ligo print-ast pledge.religo -s reasonligo))) (deps pledge.religo)) +(rule (targets record.ast) (action (with-stdout-to record.ast (run ligo print-ast record.religo -s reasonligo))) (deps record.religo)) +(rule (targets recursion.ast) (action (with-stdout-to recursion.ast (run ligo print-ast recursion.religo -s reasonligo))) (deps recursion.religo)) +(rule (targets self_address.ast) (action (with-stdout-to self_address.ast (run ligo print-ast self_address.religo -s reasonligo))) (deps self_address.religo)) +(rule (targets set_arithmetic.ast) (action (with-stdout-to set_arithmetic.ast (run ligo print-ast set_arithmetic.religo -s reasonligo))) (deps set_arithmetic.religo)) +(rule (targets set_delegate.ast) (action (with-stdout-to set_delegate.ast (run ligo print-ast set_delegate.religo -s reasonligo))) (deps set_delegate.religo)) +(rule (targets single_record_item.ast) (action (with-stdout-to single_record_item.ast (run ligo print-ast single_record_item.religo -s reasonligo))) (deps single_record_item.religo)) +(rule (targets string_arithmetic.ast) (action (with-stdout-to string_arithmetic.ast (run ligo print-ast string_arithmetic.religo -s reasonligo))) (deps string_arithmetic.religo)) +(rule (targets super-counter.ast) (action (with-stdout-to super-counter.ast (run ligo print-ast super-counter.religo -s reasonligo))) (deps super-counter.religo)) +(rule (targets tuple_list.ast) (action (with-stdout-to tuple_list.ast (run ligo print-ast tuple_list.religo -s reasonligo))) (deps tuple_list.religo)) +(rule (targets tuple_param_destruct.ast) (action (with-stdout-to tuple_param_destruct.ast (run ligo print-ast tuple_param_destruct.religo -s reasonligo))) (deps tuple_param_destruct.religo)) +(rule (targets tuple_type.ast) (action (with-stdout-to tuple_type.ast (run ligo print-ast tuple_type.religo -s reasonligo))) (deps tuple_type.religo)) +(rule (targets tuple.ast) (action (with-stdout-to tuple.ast (run ligo print-ast tuple.religo -s reasonligo))) (deps tuple.religo)) +(rule (targets tuples_no_annotation.ast) (action (with-stdout-to tuples_no_annotation.ast (run ligo print-ast tuples_no_annotation.religo -s reasonligo))) (deps tuples_no_annotation.religo)) +(rule (targets tuples_sequences_functions.ast) (action (with-stdout-to tuples_sequences_functions.ast (run ligo print-ast tuples_sequences_functions.religo -s reasonligo))) (deps tuples_sequences_functions.religo)) +(rule (targets variant.ast) (action (with-stdout-to variant.ast (run ligo print-ast variant.religo -s reasonligo))) (deps variant.religo)) +(rule (targets website2.ast) (action (with-stdout-to website2.ast (run ligo print-ast website2.religo -s reasonligo))) (deps website2.religo)) + + +(rule (targets address.ast_pretty) (action (with-stdout-to address.ast_pretty (run ligo print-ast address.output -s reasonligo))) (deps address.output)) +(rule (targets amount.ast_pretty) (action (with-stdout-to amount.ast_pretty (run ligo print-ast amount.output -s reasonligo))) (deps amount.output)) +(rule (targets arithmetic.ast_pretty) (action (with-stdout-to arithmetic.ast_pretty (run ligo print-ast arithmetic.output -s reasonligo))) (deps arithmetic.output)) +(rule (targets balance_constant.ast_pretty) (action (with-stdout-to balance_constant.ast_pretty (run ligo print-ast balance_constant.output -s reasonligo))) (deps balance_constant.output)) +(rule (targets bitwise_arithmetic.ast_pretty) (action (with-stdout-to bitwise_arithmetic.ast_pretty (run ligo print-ast bitwise_arithmetic.output -s reasonligo))) (deps bitwise_arithmetic.output)) +(rule (targets boolean_operators.ast_pretty) (action (with-stdout-to boolean_operators.ast_pretty (run ligo print-ast boolean_operators.output -s reasonligo))) (deps boolean_operators.output)) +(rule (targets bytes_arithmetic.ast_pretty) (action (with-stdout-to bytes_arithmetic.ast_pretty (run ligo print-ast bytes_arithmetic.output -s reasonligo))) (deps bytes_arithmetic.output)) +(rule (targets bytes_unpack.ast_pretty) (action (with-stdout-to bytes_unpack.ast_pretty (run ligo print-ast bytes_unpack.output -s reasonligo))) (deps bytes_unpack.output)) +(rule (targets check_signature.ast_pretty) (action (with-stdout-to check_signature.ast_pretty (run ligo print-ast check_signature.output -s reasonligo))) (deps check_signature.output)) +(rule (targets closure.ast_pretty) (action (with-stdout-to closure.ast_pretty (run ligo print-ast closure.output -s reasonligo))) (deps closure.output)) +(rule (targets condition-shadowing.ast_pretty) (action (with-stdout-to condition-shadowing.ast_pretty (run ligo print-ast condition-shadowing.output -s reasonligo))) (deps condition-shadowing.output)) +(rule (targets condition.ast_pretty) (action (with-stdout-to condition.ast_pretty (run ligo print-ast condition.output -s reasonligo))) (deps condition.output)) +(rule (targets counter.ast_pretty) (action (with-stdout-to counter.ast_pretty (run ligo print-ast counter.output -s reasonligo))) (deps counter.output)) +(rule (targets crypto.ast_pretty) (action (with-stdout-to crypto.ast_pretty (run ligo print-ast crypto.output -s reasonligo))) (deps crypto.output)) +(rule (targets empty_case.ast_pretty) (action (with-stdout-to empty_case.ast_pretty (run ligo print-ast empty_case.output -s reasonligo))) (deps empty_case.output)) +(rule (targets eq_bool.ast_pretty) (action (with-stdout-to eq_bool.ast_pretty (run ligo print-ast eq_bool.output -s reasonligo))) (deps eq_bool.output)) +(rule (targets function-shared.ast_pretty) (action (with-stdout-to function-shared.ast_pretty (run ligo print-ast function-shared.output -s reasonligo))) (deps function-shared.output)) +(rule (targets high-order.ast_pretty) (action (with-stdout-to high-order.ast_pretty (run ligo print-ast high-order.output -s reasonligo))) (deps high-order.output)) +(rule (targets implicit_account.ast_pretty) (action (with-stdout-to implicit_account.ast_pretty (run ligo print-ast implicit_account.output -s reasonligo))) (deps implicit_account.output)) +(rule (targets included.ast_pretty) (action (with-stdout-to included.ast_pretty (run ligo print-ast included.output -s reasonligo))) (deps included.output)) +(rule (targets includer.ast_pretty) (action (with-stdout-to includer.ast_pretty (run ligo print-ast includer.output -s reasonligo))) (deps includer.output)) +(rule (targets key_hash.ast_pretty) (action (with-stdout-to key_hash.ast_pretty (run ligo print-ast key_hash.output -s reasonligo))) (deps key_hash.output)) +(rule (targets lambda.ast_pretty) (action (with-stdout-to lambda.ast_pretty (run ligo print-ast lambda.output -s reasonligo))) (deps lambda.output)) +(rule (targets lambda2.ast_pretty) (action (with-stdout-to lambda2.ast_pretty (run ligo print-ast lambda2.output -s reasonligo))) (deps lambda2.output)) +(rule (targets let_multiple.ast_pretty) (action (with-stdout-to let_multiple.ast_pretty (run ligo print-ast let_multiple.output -s reasonligo))) (deps let_multiple.output)) +(rule (targets letin.ast_pretty) (action (with-stdout-to letin.ast_pretty (run ligo print-ast letin.output -s reasonligo))) (deps letin.output)) +(rule (targets list.ast_pretty) (action (with-stdout-to list.ast_pretty (run ligo print-ast list.output -s reasonligo))) (deps list.output)) +(rule (targets loop.ast_pretty) (action (with-stdout-to loop.ast_pretty (run ligo print-ast loop.output -s reasonligo))) (deps loop.output)) +(rule (targets map.ast_pretty) (action (with-stdout-to map.ast_pretty (run ligo print-ast map.output -s reasonligo))) (deps map.output)) +(rule (targets match_bis.ast_pretty) (action (with-stdout-to match_bis.ast_pretty (run ligo print-ast match_bis.output -s reasonligo))) (deps match_bis.output)) +(rule (targets match.ast_pretty) (action (with-stdout-to match.ast_pretty (run ligo print-ast match.output -s reasonligo))) (deps match.output)) +(rule (targets michelson_pair_tree.ast_pretty) (action (with-stdout-to michelson_pair_tree.ast_pretty (run ligo print-ast michelson_pair_tree.output -s reasonligo))) (deps michelson_pair_tree.output)) +(rule (targets multiple-parameters.ast_pretty) (action (with-stdout-to multiple-parameters.ast_pretty (run ligo print-ast multiple-parameters.output -s reasonligo))) (deps multiple-parameters.output)) +(rule (targets multisig.ast_pretty) (action (with-stdout-to multisig.ast_pretty (run ligo print-ast multisig.output -s reasonligo))) (deps multisig.output)) +(rule (targets no_semicolon.ast_pretty) (action (with-stdout-to no_semicolon.ast_pretty (run ligo print-ast no_semicolon.output -s reasonligo))) (deps no_semicolon.output)) +(rule (targets pledge.ast_pretty) (action (with-stdout-to pledge.ast_pretty (run ligo print-ast pledge.output -s reasonligo))) (deps pledge.output)) +(rule (targets record.ast_pretty) (action (with-stdout-to record.ast_pretty (run ligo print-ast record.output -s reasonligo))) (deps record.output)) +(rule (targets recursion.ast_pretty) (action (with-stdout-to recursion.ast_pretty (run ligo print-ast recursion.output -s reasonligo))) (deps recursion.output)) +(rule (targets self_address.ast_pretty) (action (with-stdout-to self_address.ast_pretty (run ligo print-ast self_address.output -s reasonligo))) (deps self_address.output)) +(rule (targets set_arithmetic.ast_pretty) (action (with-stdout-to set_arithmetic.ast_pretty (run ligo print-ast set_arithmetic.output -s reasonligo))) (deps set_arithmetic.output)) +(rule (targets set_delegate.ast_pretty) (action (with-stdout-to set_delegate.ast_pretty (run ligo print-ast set_delegate.output -s reasonligo))) (deps set_delegate.output)) +(rule (targets single_record_item.ast_pretty) (action (with-stdout-to single_record_item.ast_pretty (run ligo print-ast single_record_item.output -s reasonligo))) (deps single_record_item.output)) +(rule (targets string_arithmetic.ast_pretty) (action (with-stdout-to string_arithmetic.ast_pretty (run ligo print-ast string_arithmetic.output -s reasonligo))) (deps string_arithmetic.output)) +(rule (targets super-counter.ast_pretty) (action (with-stdout-to super-counter.ast_pretty (run ligo print-ast super-counter.output -s reasonligo))) (deps super-counter.output)) +(rule (targets tuple_list.ast_pretty) (action (with-stdout-to tuple_list.ast_pretty (run ligo print-ast tuple_list.output -s reasonligo))) (deps tuple_list.output)) +(rule (targets tuple_param_destruct.ast_pretty) (action (with-stdout-to tuple_param_destruct.ast_pretty (run ligo print-ast tuple_param_destruct.output -s reasonligo))) (deps tuple_param_destruct.output)) +(rule (targets tuple_type.ast_pretty) (action (with-stdout-to tuple_type.ast_pretty (run ligo print-ast tuple_type.output -s reasonligo))) (deps tuple_type.output)) +(rule (targets tuple.ast_pretty) (action (with-stdout-to tuple.ast_pretty (run ligo print-ast tuple.output -s reasonligo))) (deps tuple.output)) +(rule (targets tuples_no_annotation.ast_pretty) (action (with-stdout-to tuples_no_annotation.ast_pretty (run ligo print-ast tuples_no_annotation.output -s reasonligo))) (deps tuples_no_annotation.output)) +(rule (targets tuples_sequences_functions.ast_pretty) (action (with-stdout-to tuples_sequences_functions.ast_pretty (run ligo print-ast tuples_sequences_functions.output -s reasonligo))) (deps tuples_sequences_functions.output)) +(rule (targets variant.ast_pretty) (action (with-stdout-to variant.ast_pretty (run ligo print-ast variant.output -s reasonligo))) (deps variant.output)) +(rule (targets website2.ast_pretty) (action (with-stdout-to website2.ast_pretty (run ligo print-ast website2.output -s reasonligo))) (deps website2.output)) + +(alias (name runtest) (action (diff address.ast address.ast_pretty)) (deps address.ast address.ast_pretty)) +(alias (name runtest) (action (diff amount.ast amount.ast_pretty)) (deps amount.ast amount.ast_pretty)) +(alias (name runtest) (action (diff arithmetic.ast arithmetic.ast_pretty)) (deps arithmetic.ast arithmetic.ast_pretty)) +(alias (name runtest) (action (diff balance_constant.ast balance_constant.ast_pretty)) (deps balance_constant.ast balance_constant.ast_pretty)) +(alias (name runtest) (action (diff bitwise_arithmetic.ast bitwise_arithmetic.ast_pretty)) (deps bitwise_arithmetic.ast bitwise_arithmetic.ast_pretty)) +(alias (name runtest) (action (diff boolean_operators.ast boolean_operators.ast_pretty)) (deps boolean_operators.ast boolean_operators.ast_pretty)) +(alias (name runtest) (action (diff bytes_arithmetic.ast bytes_arithmetic.ast_pretty)) (deps bytes_arithmetic.ast bytes_arithmetic.ast_pretty)) +(alias (name runtest) (action (diff bytes_unpack.ast bytes_unpack.ast_pretty)) (deps bytes_unpack.ast bytes_unpack.ast_pretty)) +(alias (name runtest) (action (diff check_signature.ast check_signature.ast_pretty)) (deps check_signature.ast check_signature.ast_pretty)) +(alias (name runtest) (action (diff closure.ast closure.ast_pretty)) (deps closure.ast closure.ast_pretty)) +(alias (name runtest) (action (diff condition-shadowing.ast condition-shadowing.ast_pretty)) (deps condition-shadowing.ast condition-shadowing.ast_pretty)) +(alias (name runtest) (action (diff condition.ast condition.ast_pretty)) (deps condition.ast condition.ast_pretty)) +(alias (name runtest) (action (diff counter.ast counter.ast_pretty)) (deps counter.ast counter.ast_pretty)) +(alias (name runtest) (action (diff crypto.ast crypto.ast_pretty)) (deps crypto.ast crypto.ast_pretty)) +(alias (name runtest) (action (diff empty_case.ast empty_case.ast_pretty)) (deps empty_case.ast empty_case.ast_pretty)) +(alias (name runtest) (action (diff eq_bool.ast eq_bool.ast_pretty)) (deps eq_bool.ast eq_bool.ast_pretty)) +(alias (name runtest) (action (diff function-shared.ast function-shared.ast_pretty)) (deps function-shared.ast function-shared.ast_pretty)) +(alias (name runtest) (action (diff high-order.ast high-order.ast_pretty)) (deps high-order.ast high-order.ast_pretty)) +(alias (name runtest) (action (diff implicit_account.ast implicit_account.ast_pretty)) (deps implicit_account.ast implicit_account.ast_pretty)) +(alias (name runtest) (action (diff included.ast included.ast_pretty)) (deps included.ast included.ast_pretty)) +(alias (name runtest) (action (diff includer.ast includer.ast_pretty)) (deps includer.ast includer.ast_pretty)) +(alias (name runtest) (action (diff key_hash.ast key_hash.ast_pretty)) (deps key_hash.ast key_hash.ast_pretty)) +(alias (name runtest) (action (diff lambda.ast lambda.ast_pretty)) (deps lambda.ast lambda.ast_pretty)) +(alias (name runtest) (action (diff lambda2.ast lambda2.ast_pretty)) (deps lambda2.ast lambda2.ast_pretty)) +(alias (name runtest) (action (diff let_multiple.ast let_multiple.ast_pretty)) (deps let_multiple.ast let_multiple.ast_pretty)) +(alias (name runtest) (action (diff letin.ast letin.ast_pretty)) (deps letin.ast letin.ast_pretty)) +(alias (name runtest) (action (diff list.ast list.ast_pretty)) (deps list.ast list.ast_pretty)) +(alias (name runtest) (action (diff loop.ast loop.ast_pretty)) (deps loop.ast loop.ast_pretty)) +(alias (name runtest) (action (diff map.ast map.ast_pretty)) (deps map.ast map.ast_pretty)) +(alias (name runtest) (action (diff match_bis.ast match_bis.ast_pretty)) (deps match_bis.ast match_bis.ast_pretty)) +(alias (name runtest) (action (diff match.ast match.ast_pretty)) (deps match.ast match.ast_pretty)) +(alias (name runtest) (action (diff michelson_pair_tree.ast michelson_pair_tree.ast_pretty)) (deps michelson_pair_tree.ast michelson_pair_tree.ast_pretty)) +(alias (name runtest) (action (diff multiple-parameters.ast multiple-parameters.ast_pretty)) (deps multiple-parameters.ast multiple-parameters.ast_pretty)) +(alias (name runtest) (action (diff multisig.ast multisig.ast_pretty)) (deps multisig.ast multisig.ast_pretty)) +(alias (name runtest) (action (diff no_semicolon.ast no_semicolon.ast_pretty)) (deps no_semicolon.ast no_semicolon.ast_pretty)) +(alias (name runtest) (action (diff pledge.ast pledge.ast_pretty)) (deps pledge.ast pledge.ast_pretty)) +(alias (name runtest) (action (diff record.ast record.ast_pretty)) (deps record.ast record.ast_pretty)) +(alias (name runtest) (action (diff recursion.ast recursion.ast_pretty)) (deps recursion.ast recursion.ast_pretty)) +(alias (name runtest) (action (diff self_address.ast self_address.ast_pretty)) (deps self_address.ast self_address.ast_pretty)) +(alias (name runtest) (action (diff set_arithmetic.ast set_arithmetic.ast_pretty)) (deps set_arithmetic.ast set_arithmetic.ast_pretty)) +(alias (name runtest) (action (diff set_delegate.ast set_delegate.ast_pretty)) (deps set_delegate.ast set_delegate.ast_pretty)) +(alias (name runtest) (action (diff single_record_item.ast single_record_item.ast_pretty)) (deps single_record_item.ast single_record_item.ast_pretty)) +(alias (name runtest) (action (diff string_arithmetic.ast string_arithmetic.ast_pretty)) (deps string_arithmetic.ast string_arithmetic.ast_pretty)) +(alias (name runtest) (action (diff super-counter.ast super-counter.ast_pretty)) (deps super-counter.ast super-counter.ast_pretty)) +(alias (name runtest) (action (diff tuple_list.ast tuple_list.ast_pretty)) (deps tuple_list.ast tuple_list.ast_pretty)) +(alias (name runtest) (action (diff tuple_param_destruct.ast tuple_param_destruct.ast_pretty)) (deps tuple_param_destruct.ast tuple_param_destruct.ast_pretty)) +(alias (name runtest) (action (diff tuple_type.ast tuple_type.ast_pretty)) (deps tuple_type.ast tuple_type.ast_pretty)) +(alias (name runtest) (action (diff tuple.ast tuple.ast_pretty)) (deps tuple.ast tuple.ast_pretty)) +(alias (name runtest) (action (diff tuples_no_annotation.ast tuples_no_annotation.ast_pretty)) (deps tuples_no_annotation.ast tuples_no_annotation.ast_pretty)) +(alias (name runtest) (action (diff tuples_sequences_functions.ast tuples_sequences_functions.ast_pretty)) (deps tuples_sequences_functions.ast tuples_sequences_functions.ast_pretty)) +(alias (name runtest) (action (diff variant.ast variant.ast_pretty)) (deps variant.ast variant.ast_pretty)) +(alias (name runtest) (action (diff website2.ast website2.ast_pretty)) (deps website2.ast website2.ast_pretty)) \ No newline at end of file diff --git a/src/test/contracts/expected/address.religo b/src/test/contracts/expected/address.religo index 7afb9b377..4979af040 100644 --- a/src/test/contracts/expected/address.religo +++ b/src/test/contracts/expected/address.religo @@ -1,5 +1,5 @@ let main = - ((p: key_hash)): address => + (p: key_hash): address => { let c: contract(unit) = Tezos.implicit_account(p); Tezos.address(c) diff --git a/src/test/contracts/expected/amount.religo b/src/test/contracts/expected/amount.religo index 7543eb3fd..447dac88b 100644 --- a/src/test/contracts/expected/amount.religo +++ b/src/test/contracts/expected/amount.religo @@ -1,5 +1,5 @@ let check_ = - ((p: unit)): int => + (p: unit): int => if(Tezos.amount == 100000000mutez) { 42 diff --git a/src/test/contracts/expected/arithmetic.religo b/src/test/contracts/expected/arithmetic.religo index 52e01e696..af641c76e 100644 --- a/src/test/contracts/expected/arithmetic.religo +++ b/src/test/contracts/expected/arithmetic.religo @@ -1,17 +1,17 @@ -let mod_op = ((n: int)): nat => n mod 42; +let mod_op = (n: int): nat => n mod 42; -let plus_op = ((n: int)): int => n + 42; +let plus_op = (n: int): int => n + 42; -let minus_op = ((n: int)): int => n - 42; +let minus_op = (n: int): int => n - 42; -let times_op = ((n: int)): int => n * 42; +let times_op = (n: int): int => n * 42; -let div_op = ((n: int)): int => n / 2; +let div_op = (n: int): int => n / 2; -let neg_op = ((n: int)): int => -n; +let neg_op = (n: int): int => -n; -let foo = ((n: int)): int => n + 10; +let foo = (n: int): int => n + 10; -let neg_op_2 = ((b: int)): int => -foo(b); +let neg_op_2 = (b: int): int => -foo(b); -let ediv_op = ((n: int)): option((int, nat)) => ediv(n, 2); +let ediv_op = (n: int): option((int, nat)) => ediv(n, 2); diff --git a/src/test/contracts/expected/bad_address_format.religo b/src/test/contracts/expected/bad_address_format.religo index 9000969ec..ee7f13c0d 100644 --- a/src/test/contracts/expected/bad_address_format.religo +++ b/src/test/contracts/expected/bad_address_format.religo @@ -1,3 +1,3 @@ let main = - ((parameter: int), (storage: address)) => + (parameter: int, storage: address) => ([] : list(operation), "KT1badaddr" : address); diff --git a/src/test/contracts/expected/balance_constant.religo b/src/test/contracts/expected/balance_constant.religo index 4082d7324..6ae8a6f74 100644 --- a/src/test/contracts/expected/balance_constant.religo +++ b/src/test/contracts/expected/balance_constant.religo @@ -1,7 +1,7 @@ type storage = tez; let main2 = - ((p: unit), (s: storage)) => + (p: unit, s: storage) => ([] : list(operation), Tezos.balance); -let main = ((x: (unit, storage))) => main2(x[0], x[1]); +let main = (x: (unit, storage)) => main2(x[0], x[1]); diff --git a/src/test/contracts/expected/bitwise_arithmetic.religo b/src/test/contracts/expected/bitwise_arithmetic.religo index 91af7e540..9468c4d57 100644 --- a/src/test/contracts/expected/bitwise_arithmetic.religo +++ b/src/test/contracts/expected/bitwise_arithmetic.religo @@ -1,9 +1,9 @@ -let or_op = ((n: nat)): nat => Bitwise.or(n, 4n); +let or_op = (n: nat): nat => Bitwise.or(n, 4n); -let and_op = ((n: nat)): nat => Bitwise.and(n, 7n); +let and_op = (n: nat): nat => Bitwise.and(n, 7n); -let xor_op = ((n: nat)): nat => Bitwise.xor(n, 7n); +let xor_op = (n: nat): nat => Bitwise.xor(n, 7n); -let lsl_op = ((n: nat)): nat => Bitwise.shift_left(n, 7n); +let lsl_op = (n: nat): nat => Bitwise.shift_left(n, 7n); -let lsr_op = ((n: nat)): nat => Bitwise.shift_right(n, 7n); +let lsr_op = (n: nat): nat => Bitwise.shift_right(n, 7n); diff --git a/src/test/contracts/expected/boolean_operators.religo b/src/test/contracts/expected/boolean_operators.religo index a1f640409..0c7f1ae28 100644 --- a/src/test/contracts/expected/boolean_operators.religo +++ b/src/test/contracts/expected/boolean_operators.religo @@ -1,9 +1,9 @@ -let or_true = ((b: bool)): bool => b || true; +let or_true = (b: bool): bool => b || true; -let or_false = ((b: bool)): bool => b || false; +let or_false = (b: bool): bool => b || false; -let and_true = ((b: bool)): bool => b && true; +let and_true = (b: bool): bool => b && true; -let and_false = ((b: bool)): bool => b && false; +let and_false = (b: bool): bool => b && false; -let not_bool = ((b: bool)): bool => ! b; +let not_bool = (b: bool): bool => ! b; diff --git a/src/test/contracts/expected/bytes_arithmetic.religo b/src/test/contracts/expected/bytes_arithmetic.religo index 7fef60bb1..c04599411 100644 --- a/src/test/contracts/expected/bytes_arithmetic.religo +++ b/src/test/contracts/expected/bytes_arithmetic.religo @@ -1,6 +1,5 @@ -let concat_op = - ((s: bytes)): bytes => Bytes.concat(s, 0x7070); +let concat_op = (s: bytes): bytes => Bytes.concat(s, 0x7070); -let slice_op = ((s: bytes)): bytes => Bytes.slice(1n, 2n, s); +let slice_op = (s: bytes): bytes => Bytes.slice(1n, 2n, s); -let hasherman = ((s: bytes)): bytes => Crypto.sha256(s); +let hasherman = (s: bytes): bytes => Crypto.sha256(s); diff --git a/src/test/contracts/expected/bytes_unpack.religo b/src/test/contracts/expected/bytes_unpack.religo index 65d3e2408..ab91a5324 100644 --- a/src/test/contracts/expected/bytes_unpack.religo +++ b/src/test/contracts/expected/bytes_unpack.religo @@ -1,19 +1,19 @@ let id_string = - ((p: string)): option(string) => + (p: string): option(string) => { let packed: bytes = Bytes.pack(p); ((Bytes.unpack(packed)) : option(string)) }; let id_int = - ((p: int)): option(int) => + (p: int): option(int) => { let packed: bytes = Bytes.pack(p); ((Bytes.unpack(packed)) : option(int)) }; let id_address = - ((p: address)): option(address) => + (p: address): option(address) => { let packed: bytes = Bytes.pack(p); ((Bytes.unpack(packed)) : option(address)) diff --git a/src/test/contracts/expected/check_signature.religo b/src/test/contracts/expected/check_signature.religo index 4080d6001..c19cd6a53 100644 --- a/src/test/contracts/expected/check_signature.religo +++ b/src/test/contracts/expected/check_signature.religo @@ -1,5 +1,5 @@ let check_signature = - ((param: (key, signature, bytes))): bool => + (param: (key, signature, bytes)): bool => { let (pk, signed, msg) = param; Crypto.check(pk, signed, msg) diff --git a/src/test/contracts/expected/closure.religo b/src/test/contracts/expected/closure.religo index 1bb5fee3f..1f9bc3ff9 100644 --- a/src/test/contracts/expected/closure.religo +++ b/src/test/contracts/expected/closure.religo @@ -1,8 +1,8 @@ let test = - ((k: int)): int => + (k: int): int => { let j: int = k + 5; - let close: ((int => int)) = ((i: int)) => i + j; + let close: (int => int) = (i: int) => i + j; let j: int = 20; close(20) }; diff --git a/src/test/contracts/expected/condition-shadowing.religo b/src/test/contracts/expected/condition-shadowing.religo index a486a11a5..a31570a05 100644 --- a/src/test/contracts/expected/condition-shadowing.religo +++ b/src/test/contracts/expected/condition-shadowing.religo @@ -1,5 +1,5 @@ let main = - ((i: int)) => + (i: int) => { let result = 0; if(i diff --git a/src/test/contracts/expected/condition.religo b/src/test/contracts/expected/condition.religo index cb9032b10..5fdc354e3 100644 --- a/src/test/contracts/expected/condition.religo +++ b/src/test/contracts/expected/condition.religo @@ -1,5 +1,5 @@ let main = - ((i: int)) => + (i: int) => if(i == 2) { 42 diff --git a/src/test/contracts/expected/counter.religo b/src/test/contracts/expected/counter.religo index 1cf29ecce..14af3847f 100644 --- a/src/test/contracts/expected/counter.religo +++ b/src/test/contracts/expected/counter.religo @@ -1,5 +1,5 @@ type storage = int; let main = - (((p, s): (int, storage))): (list(operation), storage) => + ((p, s): (int, storage)): (list(operation), storage) => ([] : list(operation), p + s); diff --git a/src/test/contracts/expected/crypto.religo b/src/test/contracts/expected/crypto.religo index 54b3fb1ff..4afc4a41c 100644 --- a/src/test/contracts/expected/crypto.religo +++ b/src/test/contracts/expected/crypto.religo @@ -1,3 +1,3 @@ -let hasherman512 = ((s: bytes)) => Crypto.sha512(s); +let hasherman512 = (s: bytes) => Crypto.sha512(s); -let hasherman_blake = ((s: bytes)) => Crypto.blake2b(s); +let hasherman_blake = (s: bytes) => Crypto.blake2b(s); diff --git a/src/test/contracts/expected/empty_case.religo b/src/test/contracts/expected/empty_case.religo index 10aee843c..6705b108c 100644 --- a/src/test/contracts/expected/empty_case.religo +++ b/src/test/contracts/expected/empty_case.religo @@ -1,7 +1,7 @@ type foo = Bar(int) | Baz; let main = - ((f: foo)): int => + (f: foo): int => switch(f) { | Bar(i) => i | Baz => (-1) diff --git a/src/test/contracts/expected/eq_bool.religo b/src/test/contracts/expected/eq_bool.religo index 781ff1dcc..ec3bb0d3a 100644 --- a/src/test/contracts/expected/eq_bool.religo +++ b/src/test/contracts/expected/eq_bool.religo @@ -1,5 +1,5 @@ let main = - (((a, b): (bool, bool))) => + ((a, b): (bool, bool)) => if(a == b) { 999 diff --git a/src/test/contracts/expected/failwith.religo b/src/test/contracts/expected/failwith.religo index aa3ca062c..5e9680040 100644 --- a/src/test/contracts/expected/failwith.religo +++ b/src/test/contracts/expected/failwith.religo @@ -1,7 +1,7 @@ type storage = unit; let main = - ((p: unit), storage) => + (p: unit, storage) => if(true) { failwith("This contract always fails") }; diff --git a/src/test/contracts/expected/function-shared.religo b/src/test/contracts/expected/function-shared.religo index 652dd2e14..ab4fcc3b2 100644 --- a/src/test/contracts/expected/function-shared.religo +++ b/src/test/contracts/expected/function-shared.religo @@ -1,5 +1,5 @@ -let foo = ((i: int)): int => i + 20; +let foo = (i: int): int => i + 20; -let bar = ((i: int)): int => i + 50; +let bar = (i: int): int => i + 50; -let foobar = ((i: int)): int => foo(i) + bar(i); +let foobar = (i: int): int => foo(i) + bar(i); diff --git a/src/test/contracts/expected/high-order.religo b/src/test/contracts/expected/high-order.religo index 0c7dc4b4e..e4e0652d9 100644 --- a/src/test/contracts/expected/high-order.religo +++ b/src/test/contracts/expected/high-order.religo @@ -1,53 +1,53 @@ let foobar = - ((i: int)): int => + (i: int): int => { - let foo: (int => int) = ((i: int)) => i; - let bar: (((int => int) => int)) = - ((f: (int => int))) => f(i); + let foo: int => int = (i: int) => i; + let bar: ((int => int) => int) = + (f: int => int) => f(i); bar(foo) }; let higher2 = - ((i: int), (f: (int => int))): int => + (i: int, f: int => int): int => { let ii: int = f(i); ii }; let foobar2 = - ((i: int)): int => + (i: int): int => { - let foo2: (int => int) = ((i: int)) => i; + let foo2: int => int = (i: int) => i; higher2(i, foo2) }; let a: int = 0; let foobar3 = - ((i: int)): int => + (i: int): int => { - let foo2: (int => int) = ((i: int)) => a + i; + let foo2: int => int = (i: int) => a + i; higher2(i, foo2) }; -let f = ((i: int)): int => i; +let f = (i: int): int => i; -let g = ((i: int)): int => f(i); +let g = (i: int): int => f(i); -let foobar4 = ((i: int)): int => g(g(i)); +let foobar4 = (i: int): int => g(g(i)); let higher3 = - ((i: int), (f: (int => int)), (g: (int => int))): int => + (i: int, f: int => int, g: int => int): int => { let ii: int = f(g(i)); ii }; let foobar5 = - ((i: int)): int => + (i: int): int => { let a: int = 0; - let foo: (int => int) = ((i: int)) => a + i; - let goo: (int => int) = ((i: int)) => foo(i); + let foo: int => int = (i: int) => a + i; + let goo: int => int = (i: int) => foo(i); higher3(i, foo, goo) }; diff --git a/src/test/contracts/expected/implicit_account.religo b/src/test/contracts/expected/implicit_account.religo index a151ec548..8bfc216f8 100644 --- a/src/test/contracts/expected/implicit_account.religo +++ b/src/test/contracts/expected/implicit_account.religo @@ -1,3 +1,3 @@ let main = - ((kh: key_hash)): contract(unit) => + (kh: key_hash): contract(unit) => Tezos.implicit_account(kh); diff --git a/src/test/contracts/expected/key_hash.religo b/src/test/contracts/expected/key_hash.religo index a5d51838f..bac557809 100644 --- a/src/test/contracts/expected/key_hash.religo +++ b/src/test/contracts/expected/key_hash.religo @@ -1,5 +1,5 @@ let check_hash_key = - ((kh1_k2: (key_hash, key))): (bool, key_hash) => + (kh1_k2: (key_hash, key)): (bool, key_hash) => { let (kh1, k2) = kh1_k2; let kh2: key_hash = Crypto.hash_key(k2); diff --git a/src/test/contracts/expected/lambda.religo b/src/test/contracts/expected/lambda.religo index d348ce6b3..2de46c15d 100644 --- a/src/test/contracts/expected/lambda.religo +++ b/src/test/contracts/expected/lambda.religo @@ -1,5 +1,5 @@ type storage = unit; let main = - (((p, s): (unit, storage))): unit => - ((((useless: unit))) => ())(()); + ((p, s): (unit, storage)): unit => + (((useless: unit)) => ())(()); diff --git a/src/test/contracts/expected/lambda2.religo b/src/test/contracts/expected/lambda2.religo index 6ccefae09..d3026ba76 100644 --- a/src/test/contracts/expected/lambda2.religo +++ b/src/test/contracts/expected/lambda2.religo @@ -1,7 +1,5 @@ type storage = unit; let main = - (((a, s): (unit, storage))): unit => - - (((f: (unit => unit))) => f(()))(((useless: unit)) => - unit); + ((a, s): (unit, storage)): unit => + ((f: unit => unit) => f(()))((useless: unit) => unit); diff --git a/src/test/contracts/expected/let_multiple.religo b/src/test/contracts/expected/let_multiple.religo index d961ba0ee..9292412d7 100644 --- a/src/test/contracts/expected/let_multiple.religo +++ b/src/test/contracts/expected/let_multiple.religo @@ -1,13 +1,13 @@ let ((x: int), (y: int)) = (1, 2); -let main = ((p: unit)): int => x + y; +let main = (p: unit): int => x + y; let ((x: int), (y: int)) = (3, 3); -let main_paren = ((p: unit)): int => x + y; +let main_paren = (p: unit): int => x + y; let foobar: (int, int) = (23, 42); let ((foo: int), (bar: int)) = foobar; -let non_tuple_rhs = ((p: unit)): int => foo + bar; +let non_tuple_rhs = (p: unit): int => foo + bar; diff --git a/src/test/contracts/expected/letin.religo b/src/test/contracts/expected/letin.religo index e5b2f209c..1a5b07bc9 100644 --- a/src/test/contracts/expected/letin.religo +++ b/src/test/contracts/expected/letin.religo @@ -1,7 +1,7 @@ type storage = (int, int); let main = - ((n: (int, storage))): (list(operation), storage) => + (n: (int, storage)): (list(operation), storage) => { let x: (int, int) = { @@ -11,14 +11,14 @@ let main = ([] : list(operation), x) }; -let f0 = ((a: string)) => true; +let f0 = (a: string) => true; -let f1 = ((a: string)) => true; +let f1 = (a: string) => true; -let f2 = ((a: string)) => true; +let f2 = (a: string) => true; let letin_nesting = - ((_: unit)) => + (_: unit) => { let s = "test"; let p0 = f0(s); @@ -31,7 +31,7 @@ let letin_nesting = }; let letin_nesting2 = - ((x: int)) => + (x: int) => { let y = 2; let z = 3; diff --git a/src/test/contracts/expected/list.religo b/src/test/contracts/expected/list.religo index 3869b3664..4971c3c0b 100644 --- a/src/test/contracts/expected/list.religo +++ b/src/test/contracts/expected/list.religo @@ -11,7 +11,7 @@ let y: list(int) = [3, 4, 5]; let z: list(int) = [2, ...y]; let main = - (((action, s): (parameter, storage))): return => + ((action, s): (parameter, storage)): return => { let storage = switch(action) { @@ -21,22 +21,22 @@ let main = ([] : list(operation), storage) }; -let size_ = ((s: list(int))): nat => List.length(s); +let size_ = (s: list(int)): nat => List.length(s); let fold_op = - ((s: list(int))): int => + (s: list(int)): int => { - let aggregate = ((t: (int, int))) => t[0] + t[1]; + let aggregate = (t: (int, int)) => t[0] + t[1]; List.fold(aggregate, s, 10) }; let map_op = - ((s: list(int))): list(int) => - List.map(((cur: int)) => cur + 1, s); + (s: list(int)): list(int) => + List.map((cur: int) => cur + 1, s); let iter_op = - ((s: list(int))): unit => + (s: list(int)): unit => { - let do_nothing = ((useless: int)) => unit; + let do_nothing = (useless: int) => unit; List.iter(do_nothing, s) }; diff --git a/src/test/contracts/expected/loop.religo b/src/test/contracts/expected/loop.religo index 1df8dc726..710c09880 100644 --- a/src/test/contracts/expected/loop.religo +++ b/src/test/contracts/expected/loop.religo @@ -1,5 +1,5 @@ let rec aux_simple = - ((i: int)): int => + (i: int): int => if(i < 100) { aux_simple(i + 1) @@ -7,16 +7,16 @@ let rec aux_simple = i }; -let counter_simple = ((n: int)): int => aux_simple(n); +let counter_simple = (n: int): int => aux_simple(n); type sum_aggregator = {counter: int, sum: int }; let counter = - ((n: int)): int => + (n: int): int => { let initial: sum_aggregator = {counter: 0, sum: 0 }; let rec aggregate = - ((prev: sum_aggregator)): int => + (prev: sum_aggregator): int => if(prev.counter <= n) { @@ -32,7 +32,7 @@ let counter = }; let rec aux_nest = - ((prev: sum_aggregator)): sum_aggregator => + (prev: sum_aggregator): sum_aggregator => if(prev.counter < 100) { @@ -43,7 +43,7 @@ let rec aux_nest = }; let counter_nest = - ((n: int)): int => + (n: int): int => { let initial: sum_aggregator = {counter: 0, sum: 0 }; let out: sum_aggregator = aux_nest(initial); diff --git a/src/test/contracts/expected/map.religo b/src/test/contracts/expected/map.religo index 682c6d0e7..bb4443927 100644 --- a/src/test/contracts/expected/map.religo +++ b/src/test/contracts/expected/map.religo @@ -13,59 +13,56 @@ let map1: foobar = let map2: foobar = Map.literal([(23, 0), (42, 0)]); let set_ = - ((n: int), (m: foobar)): foobar => - Map.update(23, Some (n), m); + (n: int, m: foobar): foobar => Map.update(23, Some (n), m); -let add = - ((n: int), (m: foobar)): foobar => Map.add(23, n, m); +let add = (n: int, m: foobar): foobar => Map.add(23, n, m); -let rm = ((m: foobar)): foobar => Map.remove(42, m); +let rm = (m: foobar): foobar => Map.remove(42, m); let patch_ = - ((m: foobar)): foobar => + (m: foobar): foobar => Map.literal([(0, 5), (1, 6), (2, 7)]); let patch_empty = - ((m: foobar)): foobar => + (m: foobar): foobar => Map.literal([(0, 0), (1, 1), (2, 2)]); let patch_deep = - ((m: (foobar, nat))): (foobar, nat) => + (m: (foobar, nat)): (foobar, nat) => (Map.literal([(0, 0), (1, 9), (2, 2)]), 10n); -let size_ = ((m: foobar)): nat => Map.size(m); +let size_ = (m: foobar): nat => Map.size(m); -let get = ((m: foobar)): option(int) => Map.find_opt(42, m); +let get = (m: foobar): option(int) => Map.find_opt(42, m); -let get_ = ((m: foobar)): option(int) => Map.find_opt(42, m); +let get_ = (m: foobar): option(int) => Map.find_opt(42, m); -let mem = - ((km: (int, foobar))): bool => Map.mem(km[0], km[1]); +let mem = (km: (int, foobar)): bool => Map.mem(km[0], km[1]); let iter_op = - ((m: foobar)): unit => + (m: foobar): unit => { - let assert_eq = ((i: int), (j: int)) => assert(i == j); + let assert_eq = (i: int, j: int) => assert(i == j); Map.iter(assert_eq, m) }; let map_op = - ((m: foobar)): foobar => + (m: foobar): foobar => { - let increment = ((z: int), (j: int)) => j + 1; + let increment = (z: int, j: int) => j + 1; Map.map(increment, m) }; let fold_op = - ((m: foobar)): foobar => + (m: foobar): foobar => { let aggregate = - ((i: int), (j: (int, int))) => i + j[0] + j[1]; + (i: int, j: (int, int)) => i + j[0] + j[1]; Map.fold(aggregate, m, 10) }; let deep_op = - ((m: foobar)): foobar => + (m: foobar): foobar => { let coco = (0, m); let coco = (0, Map.remove(42, coco[1])); diff --git a/src/test/contracts/expected/match.religo b/src/test/contracts/expected/match.religo index 0ed078673..63a45c86f 100644 --- a/src/test/contracts/expected/match.religo +++ b/src/test/contracts/expected/match.religo @@ -5,7 +5,7 @@ type parameter = Add(int) | Sub(int); type return = (list(operation), storage); let main = - (((action, store): (parameter, storage))) => + ((action, store): (parameter, storage)) => { let store = store diff --git a/src/test/contracts/expected/match_bis.religo b/src/test/contracts/expected/match_bis.religo index 4288f1b2b..e9b4f21f7 100644 --- a/src/test/contracts/expected/match_bis.religo +++ b/src/test/contracts/expected/match_bis.religo @@ -2,12 +2,12 @@ type storage = int; type parameter = Increment(int) | Decrement(int); -let add = (((a: int)), ((b: int))) => a + b; +let add = ((a: int), (b: int)) => a + b; -let sub = (((a: int)), ((b: int))) => a - b; +let sub = ((a: int), (b: int)) => a - b; let main = - (((action, store): (parameter, storage))) => + ((action, store): (parameter, storage)) => { let store = switch(action) { diff --git a/src/test/contracts/expected/michelson_pair_tree.religo b/src/test/contracts/expected/michelson_pair_tree.religo index 00d73e9e2..20e64dd2f 100644 --- a/src/test/contracts/expected/michelson_pair_tree.religo +++ b/src/test/contracts/expected/michelson_pair_tree.religo @@ -6,7 +6,7 @@ type storage = michelson_pair type return = (list(operation), storage); let main = - (((action, store): (unit, storage))): return => + ((action, store): (unit, storage)): return => { let foo = (3, (1, 2n)); (([] : list(operation)), (foo : storage)) diff --git a/src/test/contracts/expected/multiple-parameters.religo b/src/test/contracts/expected/multiple-parameters.religo index 179f9f1b2..7c5a6d198 100644 --- a/src/test/contracts/expected/multiple-parameters.religo +++ b/src/test/contracts/expected/multiple-parameters.religo @@ -1,7 +1,6 @@ let abcde_curried = - ((a: int), (b: int), (c: int), (d: int), (e: int)): int => - c + e + 3; + (a: int, b: int, c: int, d: int, e: int): int => c + e + 3; let abcde = - ((x: (int, int, int, int, int))): int => + (x: (int, int, int, int, int)): int => abcde_curried(x[0], x[1], x[2], x[3], x[4]); diff --git a/src/test/contracts/expected/multisig.religo b/src/test/contracts/expected/multisig.religo index 2cb8c7bec..e53b47ad9 100644 --- a/src/test/contracts/expected/multisig.religo +++ b/src/test/contracts/expected/multisig.religo @@ -13,7 +13,7 @@ type storage = { auth: authorized_keys }; -type message = (unit => list(operation)); +type message = unit => list(operation); type dummy = (key_hash, signature); @@ -30,7 +30,7 @@ type return = (list(operation), storage); type parameter = CheckMessage(check_message_pt); let check_message = - (((param, s): (check_message_pt, storage))): return => + ((param, s): (check_message_pt, storage)): return => { let message: message = param.message; let s = @@ -46,8 +46,8 @@ let check_message = let valid: nat = 0n; let keys: authorized_keys = s.auth; let aux = - (((vk, pkh_sig): - ((nat, authorized_keys), (key_hash, signature)))) + ((vk, pkh_sig): + ((nat, authorized_keys), (key_hash, signature))) : (nat, authorized_keys) => { @@ -91,7 +91,7 @@ let check_message = }; let main = - (((action, store): (parameter, storage))): return => + ((action, store): (parameter, storage)): return => switch(action) { | CheckMessage(p) => check_message((p, store)) }; diff --git a/src/test/contracts/expected/no_semicolon.religo b/src/test/contracts/expected/no_semicolon.religo index d22ed1926..82db545df 100644 --- a/src/test/contracts/expected/no_semicolon.religo +++ b/src/test/contracts/expected/no_semicolon.religo @@ -1,7 +1,7 @@ type f = int; let a = - ((b: f)) => + (b: f) => { if(b == 2) { @@ -12,7 +12,7 @@ let a = }; let c = - ((c: f)) => + (c: f) => { 3 }; diff --git a/src/test/contracts/expected/pledge.religo b/src/test/contracts/expected/pledge.religo index 3f8424f06..763ab7bb2 100644 --- a/src/test/contracts/expected/pledge.religo +++ b/src/test/contracts/expected/pledge.religo @@ -1,16 +1,16 @@ type storage = address; type parameter = Donate(unit) -| Distribute(((unit => list(operation)))); +| Distribute((unit => list(operation))); let donate = - (((p, s): (unit, storage))): (list(operation), storage) => + ((p, s): (unit, storage)): (list(operation), storage) => { (([] : list(operation)), s) }; let distribute = - (((p, s): ((unit => list(operation)), storage))) + ((p, s): (unit => list(operation), storage)) : (list(operation), storage) => { @@ -26,9 +26,7 @@ let distribute = }; let main = - (((p, s): (parameter, storage))) - : - (list(operation), storage) => + ((p, s): (parameter, storage)): (list(operation), storage) => { switch(p) { | Donate => donate(((), s)) diff --git a/src/test/contracts/expected/record.religo b/src/test/contracts/expected/record.religo index 221e3d1dc..c41cc77f9 100644 --- a/src/test/contracts/expected/record.religo +++ b/src/test/contracts/expected/record.religo @@ -12,12 +12,11 @@ let b: int = abc.b; let c: int = abc.c; -let projection = ((r: foobar)): int => r.foo + r.bar; +let projection = (r: foobar): int => r.foo + r.bar; -let modify = - ((r: foobar)): foobar => {foo: 256, bar: r.bar }; +let modify = (r: foobar): foobar => {foo: 256, bar: r.bar }; -let modify_abc = ((r: abc)): abc => {...r, b: 2048, c: 42}; +let modify_abc = (r: abc): abc => {...r, b: 2048, c: 42}; type big_record = {a: int, b: int, c: int, d: int, e: int }; @@ -26,6 +25,4 @@ let br: big_record = {a: 23, b: 23, c: 23, d: 23, e: 23 }; type double_record = {inner: abc }; let modify_inner = - ((r: double_record)): double_record => - {...r, - inner.b: 2048}; + (r: double_record): double_record => {...r, inner.b: 2048}; diff --git a/src/test/contracts/expected/recursion.religo b/src/test/contracts/expected/recursion.religo index 232e7ce53..5551c9a6c 100644 --- a/src/test/contracts/expected/recursion.religo +++ b/src/test/contracts/expected/recursion.religo @@ -1,5 +1,5 @@ let rec sum = - (((n, acc): (int, int))): int => + ((n, acc): (int, int)): int => if(n < 1) { acc @@ -8,7 +8,7 @@ let rec sum = }; let rec fibo = - (((n, n_1, n_0): (int, int, int))): int => + ((n, n_1, n_0): (int, int, int)): int => if(n < 2) { n_1 diff --git a/src/test/contracts/expected/self_address.religo b/src/test/contracts/expected/self_address.religo index bb32977e1..db48e28df 100644 --- a/src/test/contracts/expected/self_address.religo +++ b/src/test/contracts/expected/self_address.religo @@ -1 +1 @@ -let main = ((p: unit)): address => Tezos.self_address; +let main = (p: unit): address => Tezos.self_address; diff --git a/src/test/contracts/expected/set_arithmetic.religo b/src/test/contracts/expected/set_arithmetic.religo index 7032a3d74..7c9edfd3b 100644 --- a/src/test/contracts/expected/set_arithmetic.religo +++ b/src/test/contracts/expected/set_arithmetic.religo @@ -1,18 +1,17 @@ let literal_op = - ((p: unit)): set(string) => + (p: unit): set(string) => Set.literal(["foo", "bar", "foobar"]); let add_op = - ((s: set(string))): set(string) => Set.add("foobar", s); + (s: set(string)): set(string) => Set.add("foobar", s); let remove_op = - ((s: set(string))): set(string) => Set.remove("foobar", s); + (s: set(string)): set(string) => Set.remove("foobar", s); let remove_deep = - ((s: (set(string), nat))): set(string) => + (s: (set(string), nat)): set(string) => Set.remove("foobar", s[0]); -let mem_op = - ((s: set(string))): bool => Set.mem("foobar", s); +let mem_op = (s: set(string)): bool => Set.mem("foobar", s); -let size_op = ((s: set(string))): nat => Set.cardinal(s); +let size_op = (s: set(string)): nat => Set.cardinal(s); diff --git a/src/test/contracts/expected/set_delegate.religo b/src/test/contracts/expected/set_delegate.religo index 3cf594226..278464cf6 100644 --- a/src/test/contracts/expected/set_delegate.religo +++ b/src/test/contracts/expected/set_delegate.religo @@ -1,5 +1,5 @@ let main = - ((p: key_hash)): list(operation) => + (p: key_hash): list(operation) => { let unused: operation = (Tezos.set_delegate(Some (p))); ([] : list(operation)) diff --git a/src/test/contracts/expected/single_record_item.religo b/src/test/contracts/expected/single_record_item.religo index e5a12aa07..8fc4e2a1e 100644 --- a/src/test/contracts/expected/single_record_item.religo +++ b/src/test/contracts/expected/single_record_item.religo @@ -1,3 +1,3 @@ type p = {x: int }; -let o = ((p: int)): p => {x: p }; +let o = (p: int): p => {x: p }; diff --git a/src/test/contracts/expected/string_arithmetic.religo b/src/test/contracts/expected/string_arithmetic.religo index cd71b31ed..396a023e1 100644 --- a/src/test/contracts/expected/string_arithmetic.religo +++ b/src/test/contracts/expected/string_arithmetic.religo @@ -1,6 +1,5 @@ -let size_op = ((s: string)): nat => String.length(s); +let size_op = (s: string): nat => String.length(s); -let slice_op = - ((s: string)): string => String.sub(1n, 2n, s); +let slice_op = (s: string): string => String.sub(1n, 2n, s); -let concat_syntax = ((s: string)) => s ++ "test_literal"; +let concat_syntax = (s: string) => s ++ "test_literal"; diff --git a/src/test/contracts/expected/super-counter.religo b/src/test/contracts/expected/super-counter.religo index a0fc4ae4e..a7445c5cb 100644 --- a/src/test/contracts/expected/super-counter.religo +++ b/src/test/contracts/expected/super-counter.religo @@ -5,7 +5,7 @@ type storage = int; type return = (list(operation), storage); let main = - (((action, store): (parameter, storage))): return => + ((action, store): (parameter, storage)): return => { let store = switch(action) { diff --git a/src/test/contracts/expected/tuple.religo b/src/test/contracts/expected/tuple.religo index 233e676d9..d9c25255e 100644 --- a/src/test/contracts/expected/tuple.religo +++ b/src/test/contracts/expected/tuple.religo @@ -1,12 +1,12 @@ type abc = (int, int, int); -let projection_abc = ((tpl: abc)): int => tpl[1]; +let projection_abc = (tpl: abc): int => tpl[1]; type foobar = (int, int); let fb: foobar = (0, 0); -let projection = ((tpl: foobar)): int => tpl[0] + tpl[1]; +let projection = (tpl: foobar): int => tpl[0] + tpl[1]; type big_tuple = (int, int, int, int, int); diff --git a/src/test/contracts/expected/tuple_param_destruct.religo b/src/test/contracts/expected/tuple_param_destruct.religo index 8ea7fb1ad..c5d0d7deb 100644 --- a/src/test/contracts/expected/tuple_param_destruct.religo +++ b/src/test/contracts/expected/tuple_param_destruct.religo @@ -1,4 +1,4 @@ -let sum = (((result, i): (int, int))): int => result - i; +let sum = ((result, i): (int, int)): int => result - i; let parentheses = - ((((((result, i)))): (((int, int))))): int => result - i; + (((((result, i)))): (((int, int)))): int => result - i; diff --git a/src/test/contracts/expected/tuple_type.religo b/src/test/contracts/expected/tuple_type.religo index 73a8e2ee8..8b608cd6c 100644 --- a/src/test/contracts/expected/tuple_type.religo +++ b/src/test/contracts/expected/tuple_type.religo @@ -1,30 +1,30 @@ type fun_type = (int, int) => int; let arguments = - ((b: int), (c: int)) => + (b: int, c: int) => { b + c }; -let arguments_type_def = ((b: fun_type)) => b(5, 3); +let arguments_type_def = (b: fun_type) => b(5, 3); let arguments_test = - ((_: int)) => arguments_type_def(arguments); + (_: int) => arguments_type_def(arguments); -type tuple_type = ((int, int) => int); +type tuple_type = ((int, int)) => int; let tuple = - (((a, b): (int, int))) => + ((a, b): (int, int)) => { a + b }; -let tuple_type_def = ((b: tuple_type)) => b((5, 3)); +let tuple_type_def = (b: tuple_type) => b((5, 3)); -let tuple_test = ((_: int)) => tuple_type_def(tuple); +let tuple_test = (_: int) => tuple_type_def(tuple); let arguments_inline = - ((b: int), (c: int)) => + (b: int, c: int) => { b + c }; @@ -33,16 +33,16 @@ let arguments_type_def_inline = (b: (int, int) => int) => b(5, 3); let arguments_test_inline = - ((_: int)) => arguments_type_def_inline(arguments_inline); + (_: int) => arguments_type_def_inline(arguments_inline); let tuple_inline = - (((a, b): (int, int))) => + ((a, b): (int, int)) => { a + b }; let tuple_type_def_inline = - (b: ((int, int) => int)) => b((5, 3)); + (b: ((int, int)) => int) => b((5, 3)); let tuple_test_inline = - ((_: int)) => tuple_type_def_inline(tuple_inline); + (_: int) => tuple_type_def_inline(tuple_inline); diff --git a/src/test/contracts/expected/tuples_no_annotation.religo b/src/test/contracts/expected/tuples_no_annotation.religo index 7a9253064..7cd18c185 100644 --- a/src/test/contracts/expected/tuples_no_annotation.religo +++ b/src/test/contracts/expected/tuples_no_annotation.religo @@ -3,7 +3,7 @@ type storage = (int, string, nat, bool); type parameter = int; let main = - (((p, storage): (parameter, storage))) => + ((p, storage): (parameter, storage)) => { ([] : list(operation), (2, "2", 2n, false)) }; diff --git a/src/test/contracts/expected/tuples_sequences_functions.religo b/src/test/contracts/expected/tuples_sequences_functions.religo index 22867281b..12c911779 100644 --- a/src/test/contracts/expected/tuples_sequences_functions.religo +++ b/src/test/contracts/expected/tuples_sequences_functions.religo @@ -14,9 +14,9 @@ let g = (a + 1, c); let h = ("a" ++ "2", d); -let i = ((a: int), (b: int)) => a + b; +let i = (a: int, b: int) => a + b; -let j = ((a: int), (b: int)) => a - b; +let j = (a: int, b: int) => a - b; let m = { @@ -24,13 +24,13 @@ let m = z }; -let n = ((a: int)): int => a + 1; +let n = (a: int): int => a + 1; -let o = ((a: int)): int => a + 1; +let o = (a: int): int => a + 1; -let n = ((a: int), (b: int)): int => a + 1; +let n = (a: int, b: int): int => a + 1; -let o = ((a: int), (b: int)): int => a + 1; +let o = (a: int, b: int): int => a + 1; let p = { diff --git a/src/test/contracts/expected/website2.religo b/src/test/contracts/expected/website2.religo index 233802380..44eedaf67 100644 --- a/src/test/contracts/expected/website2.religo +++ b/src/test/contracts/expected/website2.religo @@ -2,12 +2,12 @@ type storage = int; type parameter = Increment(int) | Decrement(int); -let add = (((a, b): (int, int))): int => a + b; +let add = ((a, b): (int, int)): int => a + b; -let sub = (((a, b): (int, int))): int => a - b; +let sub = ((a, b): (int, int)): int => a - b; let main = - (((p, storage): (parameter, storage))) => + ((p, storage): (parameter, storage)) => { let storage = switch(p) {