aboutsummaryrefslogtreecommitdiff
path: root/contrib/xml
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/xml')
-rw-r--r--contrib/xml/cic2acic.ml17
-rw-r--r--contrib/xml/xmlcommand.ml7
2 files changed, 6 insertions, 18 deletions
diff --git a/contrib/xml/cic2acic.ml b/contrib/xml/cic2acic.ml
index 75e428e14d..5515320f0a 100644
--- a/contrib/xml/cic2acic.ml
+++ b/contrib/xml/cic2acic.ml
@@ -57,16 +57,6 @@ let remove_module_dirpath_from_dirpath ~basedir dir =
let get_uri_of_var v pvars =
let module D = Declare in
let module N = Names in
- let rec search_in_pvars names =
- function
- [] -> None
- | ((name,l)::tl) ->
- let names' = name::names in
- if List.mem v l then
- Some names'
- else
- search_in_pvars names' tl
- in
let rec search_in_open_sections =
function
[] -> Util.error ("Variable "^v^" not found")
@@ -78,9 +68,10 @@ let get_uri_of_var v pvars =
search_in_open_sections tl
in
let path =
- match search_in_pvars [] pvars with
- None -> search_in_open_sections (N.repr_dirpath (Lib.cwd ()))
- | Some path -> path
+ if List.mem v pvars then
+ []
+ else
+ search_in_open_sections (N.repr_dirpath (Lib.cwd ()))
in
"cic:" ^
List.fold_left
diff --git a/contrib/xml/xmlcommand.ml b/contrib/xml/xmlcommand.ml
index 3a0fdfb9b9..649139f356 100644
--- a/contrib/xml/xmlcommand.ml
+++ b/contrib/xml/xmlcommand.ml
@@ -89,8 +89,7 @@ let could_have_namesakes o sp = (* namesake = omonimo in italian *)
(* OF VARIABLES DECLARED IN THE i-th SUPER-SECTION OF THE CURRENT *)
(* SECTION, WHOSE PATH IS namei *)
-let pvars =
- ref ([Names.id_of_string "",[]] : (Names.identifier * string list) list);;
+let pvars = ref ([] : string list);;
let cumenv = ref Environ.empty_env;;
(* filter_params pvars hyps *)
@@ -138,9 +137,7 @@ let add_to_pvars x =
E.push_named (Names.id_of_string v, None, typ) !cumenv ;
v
in
- match !pvars with
- [] -> assert false
- | ((name,l)::tl) -> pvars := (name,v::l)::tl
+ pvars := v::!pvars
;;
(* The computation is very inefficient, but we can't do anything *)