aboutsummaryrefslogtreecommitdiffhomepage
path: root/library/loadpath.ml
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-04-01 10:51:32 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-04-01 16:38:41 +0200
commit7c41bc9bdc883aacbc015954a89ff13fe9c9c1c0 (patch)
tree573d4063c5d35fa318178bd9215b0c10a31ff157 /library/loadpath.ml
parent569cf23a28c344fe32bd4e9712a4e2028c350de2 (diff)
From X Require Y looks for X with absolute path, disregarding -R.
Diffstat (limited to 'library/loadpath.ml')
-rw-r--r--library/loadpath.ml11
1 files changed, 3 insertions, 8 deletions
diff --git a/library/loadpath.ml b/library/loadpath.ml
index ca2280102..54ea0be4f 100644
--- a/library/loadpath.ml
+++ b/library/loadpath.ml
@@ -87,20 +87,15 @@ let extend_path_with_dirpath p dir =
List.fold_left Filename.concat p
(List.rev_map Id.to_string (DirPath.repr dir))
-let expand_root_path dir =
+let filter_path f =
let rec aux = function
| [] -> []
| p :: l ->
- if DirPath.equal p.path_logical dir then p.path_physical :: aux l
+ if f p.path_logical then (p.path_physical, p.path_logical) :: aux l
else aux l
in
aux !load_paths
-let is_suffix dir1 dir2 =
- let dir1 = DirPath.repr dir1 in
- let dir2 = DirPath.repr dir2 in
- List.prefix_of Id.equal dir1 dir2
-
let expand_path dir =
let rec aux = function
| [] -> []
@@ -109,7 +104,7 @@ let expand_path dir =
match p.path_implicit with
| true ->
(** The path is implicit, so that we only want match the logical suffix *)
- if is_suffix dir lg then (ph, lg) :: aux l else aux l
+ if is_dirpath_suffix_of dir lg then (ph, lg) :: aux l else aux l
| false ->
(** Otherwise we must match exactly *)
if DirPath.equal dir lg then (ph, lg) :: aux l else aux l