Преглед изворни кода

move `type_of_module_type` to type.ml because it is very useful

Simon Krajewski пре 10 година
родитељ
комит
f87cfb0574
2 измењених фајлова са 7 додато и 7 уклоњено
  1. 6 0
      type.ml
  2. 1 7
      typer.ml

+ 6 - 0
type.ml

@@ -667,6 +667,12 @@ let concat e1 e2 =
 
 let is_closed a = !(a.a_status) <> Opened
 
+let type_of_module_type = function
+	| TClassDecl c -> TInst (c,List.map snd c.cl_params)
+	| TEnumDecl e -> TEnum (e,List.map snd e.e_params)
+	| TTypeDecl t -> TType (t,List.map snd t.t_params)
+	| TAbstractDecl a -> TAbstract (a,List.map snd a.a_params)
+
 (* ======= Field utility ======= *)
 
 let field_name f =

+ 1 - 7
typer.ml

@@ -817,12 +817,6 @@ let fast_enum_field e ef p =
 	let et = mk (TTypeExpr (TEnumDecl e)) (TAnon { a_fields = PMap.empty; a_status = ref (EnumStatics e) }) p in
 	TField (et,FEnum (e,ef))
 
-let type_of_module_type = function
-	| TClassDecl c -> TInst (c,List.map snd c.cl_params)
-	| TEnumDecl e -> TEnum (e,List.map snd e.e_params)
-	| TTypeDecl t -> TType (t,List.map snd t.t_params)
-	| TAbstractDecl a -> TAbstract (a,List.map snd a.a_params)
-
 let rec type_module_type ctx t tparams p =
 	match t with
 	| TClassDecl c ->
@@ -4915,4 +4909,4 @@ get_constructor_ref := get_constructor;
 cast_or_unify_ref := Codegen.AbstractCast.cast_or_unify_raise;
 type_module_type_ref := type_module_type;
 find_array_access_raise_ref := Codegen.AbstractCast.find_array_access_raise;
-build_call_ref := build_call
+build_call_ref := build_call