Browse Source

[typer] remove Directory package rule because it is unused

Simon Krajewski 1 year ago
parent
commit
822dd87c1e

+ 0 - 1
src/context/common.ml

@@ -27,7 +27,6 @@ open Warning
 
 
 type package_rule =
 type package_rule =
 	| Forbidden
 	| Forbidden
-	| Directory of string
 	| Remap of string
 	| Remap of string
 
 
 type pos = Globals.pos
 type pos = Globals.pos

+ 0 - 2
src/context/display/displayPath.ml

@@ -26,7 +26,6 @@ module TypePathHandler = struct
 			| x :: l ->
 			| x :: l ->
 				(try
 				(try
 					match PMap.find x com.package_rules with
 					match PMap.find x com.package_rules with
-					| Directory d -> d :: l
 					| Remap s -> s :: l
 					| Remap s -> s :: l
 					| _ -> p
 					| _ -> p
 				with
 				with
@@ -47,7 +46,6 @@ module TypePathHandler = struct
 									match PMap.find f com.package_rules with
 									match PMap.find f com.package_rules with
 									| Forbidden -> ()
 									| Forbidden -> ()
 									| Remap f -> packages := f :: !packages
 									| Remap f -> packages := f :: !packages
-									| Directory _ -> raise Not_found
 								with Not_found ->
 								with Not_found ->
 									packages := f :: !packages
 									packages := f :: !packages
 						else
 						else

+ 0 - 1
src/context/display/displayToplevel.ml

@@ -74,7 +74,6 @@ class explore_class_path_task com checked recursive f_pack f_module dir pack = o
 						begin try
 						begin try
 							begin match PMap.find file com.package_rules with
 							begin match PMap.find file com.package_rules with
 								| Forbidden | Remap _ -> ()
 								| Forbidden | Remap _ -> ()
-								| _ -> raise Not_found
 							end
 							end
 						with Not_found ->
 						with Not_found ->
 							f_pack (List.rev pack,file);
 							f_pack (List.rev pack,file);

+ 0 - 1
src/macro/macroApi.ml

@@ -516,7 +516,6 @@ and encode_exceptions_config ec =
 and encode_package_rule pr =
 and encode_package_rule pr =
 	let tag, pl = match pr with
 	let tag, pl = match pr with
 		| Forbidden -> 0, []
 		| Forbidden -> 0, []
-		| Directory (path) -> 1, [encode_string path]
 		| Remap (path) -> 2, [encode_string path]
 		| Remap (path) -> 2, [encode_string path]
 	in
 	in
 	encode_enum ~pos:None IPackageRule tag pl
 	encode_enum ~pos:None IPackageRule tag pl

+ 2 - 7
src/typing/typeloadParse.ml

@@ -82,25 +82,20 @@ let parse_hook = ref parse_file
 
 
 let resolve_module_file com m remap p =
 let resolve_module_file com m remap p =
 	let forbid = ref false in
 	let forbid = ref false in
-	let compose_path no_rename =
+	let compose_path =
 		(match m with
 		(match m with
 		| [] , name -> name
 		| [] , name -> name
 		| x :: l , name ->
 		| x :: l , name ->
 			let x = (try
 			let x = (try
 				match PMap.find x com.package_rules with
 				match PMap.find x com.package_rules with
 				| Forbidden -> forbid := true; x
 				| Forbidden -> forbid := true; x
-				| Directory d -> if no_rename then x else d
 				| Remap d -> remap := d :: l; d
 				| Remap d -> remap := d :: l; d
 				with Not_found -> x
 				with Not_found -> x
 			) in
 			) in
 			String.concat "/" (x :: l) ^ "/" ^ name
 			String.concat "/" (x :: l) ^ "/" ^ name
 		) ^ ".hx"
 		) ^ ".hx"
 	in
 	in
-	let file = try
-			Common.find_file com (compose_path false)
-		with Not_found ->
-			Common.find_file com (compose_path true)
-	in
+	let file = Common.find_file com compose_path in
 	let file = (match ExtString.String.lowercase (snd m) with
 	let file = (match ExtString.String.lowercase (snd m) with
 	| "con" | "aux" | "prn" | "nul" | "com1" | "com2" | "com3" | "lpt1" | "lpt2" | "lpt3" when Sys.os_type = "Win32" ->
 	| "con" | "aux" | "prn" | "nul" | "com1" | "com2" | "com3" | "lpt1" | "lpt2" | "lpt3" when Sys.os_type = "Win32" ->
 		(* these names are reserved by the OS - old DOS legacy, such files cannot be easily created but are reported as visible *)
 		(* these names are reserved by the OS - old DOS legacy, such files cannot be easily created but are reported as visible *)