Browse Source

(minor) remove path from type list

Nicolas Cannasse 20 years ago
parent
commit
4168ec57bd
3 changed files with 11 additions and 11 deletions
  1. 4 4
      genneko.ml
  2. 5 5
      genswf8.ml
  3. 2 2
      typer.ml

+ 4 - 4
genneko.ml

@@ -326,7 +326,7 @@ let gen_enum e =
 		(EObject (pmap_list gen_enum_constr e.e_constrs),p)
 	),null_pos)
 
-let gen_type (p,t) =
+let gen_type t =
 	match t with
 	| TClassDecl c -> 
 		if c.cl_extern then
@@ -336,7 +336,7 @@ let gen_type (p,t) =
 	| TEnumDecl e -> 
 		gen_enum e
 
-let gen_static_vars (_,t) =
+let gen_static_vars t =
 	match t with
 	| TEnumDecl _ -> []
 	| TClassDecl c ->
@@ -357,7 +357,7 @@ let gen_static_vars (_,t) =
 						),p) :: acc
 			) c.cl_statics []
 
-let gen_packages h ((p,_),t) =
+let gen_packages h t =
 	let rec loop acc p =
 		match p with
 		| [] -> []
@@ -371,7 +371,7 @@ let gen_packages h ((p,_),t) =
 			end else
 				loop path l
 	in
-	loop [] p
+	loop [] (fst (type_path t))
 
 let gen_boot() =
 	call null_pos (field null_pos (ident null_pos "Boot") "__init") []

+ 5 - 5
genswf8.ml

@@ -1077,13 +1077,13 @@ let gen_path ctx (p,t) is_extern =
 		push ctx [VStr id];
 		write ctx AEval
 
-let gen_type_def ctx t tdef =
-	match tdef with
+let gen_type_def ctx t =
+	match t with
 	| TClassDecl c ->
 		if c.cl_extern then
 			()
 		else
-		let id = gen_type ctx t false in
+		let id = gen_type ctx c.cl_path false in
 		push ctx [VStr id];
 		(match c.cl_constructor with
 		| Some { cf_expr = Some e } ->
@@ -1114,7 +1114,7 @@ let gen_type_def ctx t tdef =
 		PMap.iter (fun _ f -> gen_class_static_field ctx id f) c.cl_statics;
 		PMap.iter (fun _ f -> gen_class_field ctx f) c.cl_fields;
 	| TEnumDecl e ->
-		let id = gen_type ctx t false in
+		let id = gen_type ctx e.e_path false in
 		push ctx [VStr id; VInt 0; VStr "Object"];
 		write ctx ANew;
 		write ctx (ASetReg 0);
@@ -1223,7 +1223,7 @@ let generate file ver types =
 		statics = [];
 	} in
 	write ctx (AStringPool []);
-	List.iter (fun (p,t) -> gen_type_def ctx p t) types;
+	List.iter (fun t -> gen_type_def ctx t) types;
 	gen_type_map ctx;
 	gen_boot ctx;
 	List.iter (gen_class_static_init ctx) (List.rev ctx.statics);

+ 2 - 2
typer.ml

@@ -1229,7 +1229,7 @@ let types ctx main =
 			| TClassDecl c -> walk_class p c
 			| TEnumDecl e -> ());				
 			Hashtbl.replace states p Done;
-			types := (p,t) :: !types
+			types := t :: !types
 
     and loop_class p c =
 		if c.cl_path <> p then loop (TClassDecl c)
@@ -1317,7 +1317,7 @@ let types ctx main =
 			cf_public = false;
 			cf_expr = Some (mk (TCall (mk (TField (mk (TType t) (mk_mono()) null_pos,"main")) (mk_mono()) null_pos,[])) (mk_mono()) null_pos);
 		} c.cl_statics;
-		types := (path,TClassDecl c) :: !types
+		types := TClassDecl c :: !types
 	);
 	List.rev !types