diff --git a/src/passes/10-transpiler/transpiler.ml b/src/passes/10-transpiler/transpiler.ml index 83f2a79eb..7168af974 100644 --- a/src/passes/10-transpiler/transpiler.ml +++ b/src/passes/10-transpiler/transpiler.ml @@ -278,7 +278,7 @@ let rec transpile_type (t:AST.type_expression) : type_value result = ) (* TODO hmm *) | T_sum m -> - let is_michelson_or = Stage_common.Helpers.is_michelson_or m in + let is_michelson_or = Ast_typed.Helpers.is_michelson_or m in let node = Append_tree.of_list @@ kv_list_of_cmap m in let aux a b : type_value annotated result = let%bind a = a in @@ -297,12 +297,12 @@ let rec transpile_type (t:AST.type_expression) : type_value result = aux node in ok @@ snd m' | T_record m -> - let is_tuple_lmap = Stage_common.Helpers.is_tuple_lmap m in + let is_tuple_lmap = Ast_typed.Helpers.is_tuple_lmap m in let node = Append_tree.of_list @@ ( if is_tuple_lmap then - Stage_common.Helpers.tuple_of_record m + Ast_typed.Helpers.tuple_of_record m else - List.rev @@ LMap.to_kv_list m + List.rev @@ Ast_typed.Types.LMap.to_kv_list m ) in let aux a b : type_value annotated result = @@ -311,7 +311,7 @@ let rec transpile_type (t:AST.type_expression) : type_value result = ok (None, T_pair (a, b)) in let%bind m' = Append_tree.fold_ne - (fun (Stage_common.Types.Label ann, a) -> + (fun (Ast_typed.Types.Label ann, a) -> let%bind a = transpile_type a in ok ((if is_tuple_lmap then None diff --git a/src/stages/4-ast_typed/helpers.ml b/src/stages/4-ast_typed/helpers.ml index bb3962846..c7dff6989 100644 --- a/src/stages/4-ast_typed/helpers.ml +++ b/src/stages/4-ast_typed/helpers.ml @@ -163,3 +163,9 @@ let kv_list_of_record_or_tuple (m: _ LMap.t) = tuple_of_record m else List.rev @@ LMap.to_kv_list m + + +let is_michelson_or (t: _ constructor_map) = + CMap.cardinal t = 2 && + (CMap.mem (Constructor "M_left") t) && + (CMap.mem (Constructor "M_right") t) \ No newline at end of file diff --git a/src/stages/common/helpers.ml b/src/stages/common/helpers.ml index 3a7c387de..dded3a7d8 100644 --- a/src/stages/common/helpers.ml +++ b/src/stages/common/helpers.ml @@ -67,7 +67,3 @@ let kv_list_of_record_or_tuple (m: _ LMap.t) = else List.rev @@ LMap.to_kv_list m -let is_michelson_or (t: _ constructor_map) = - CMap.cardinal t = 2 && - (CMap.mem (Constructor "M_left") t) && - (CMap.mem (Constructor "M_right") t) diff --git a/src/stages/common/helpers.mli b/src/stages/common/helpers.mli index 6b8dd6e2f..03817d6d4 100644 --- a/src/stages/common/helpers.mli +++ b/src/stages/common/helpers.mli @@ -24,7 +24,6 @@ val get_pair : val tuple_of_record : 'a LMap.t -> (label * 'a) list val list_of_record_or_tuple : 'a LMap.t -> 'a list val kv_list_of_record_or_tuple : 'a LMap.t -> (label * 'a) list -val is_michelson_or : 'a Types.constructor_map -> bool val bind_map_lmapi :