Commit 4befe168 authored by MARCHE Claude's avatar MARCHE Claude Committed by MARCHE Claude

fix bug of why3doc

parent 29add8d3
...@@ -63,11 +63,17 @@ let pp_url fmt lp = ...@@ -63,11 +63,17 @@ let pp_url fmt lp =
| _ -> | _ ->
Format.fprintf fmt "%s.html" fn Format.fprintf fmt "%s.html" fn
let pp_anchor fmt id = match id.id_loc with let pp_anchor fmt id =
match id.id_loc with
| None -> raise Not_found | None -> raise Not_found
| Some loc -> let _, l, _, _ = Loc.get loc in pp_tag fmt id.id_string l | Some loc ->
let _, l, _, _ = Loc.get loc in pp_tag fmt id.id_string l
let pp_locate fmt id = let pp_locate fmt id =
let lp, _, _ = match id.id_loc with
try Mlw_module.restore_path id with Not_found -> Theory.restore_path id in | None -> raise Not_found
Format.fprintf fmt "%a#%a" pp_url lp pp_anchor id | Some _loc ->
let lp, _, _ =
try Mlw_module.restore_path id with Not_found -> Theory.restore_path id
in
Format.fprintf fmt "%a#%a" pp_url lp pp_anchor id
...@@ -22,6 +22,7 @@ val set_stdlib_url: string -> unit ...@@ -22,6 +22,7 @@ val set_stdlib_url: string -> unit
val output_file: string -> string val output_file: string -> string
val pp_anchor: Format.formatter -> ident -> unit val pp_anchor: Format.formatter -> ident -> unit
(* raises [Not_found] if ident has no location *)
val pp_locate: Format.formatter -> ident -> unit val pp_locate: Format.formatter -> ident -> unit
(* or raises [Not_found] *) (* raises [Not_found] if ident has no location *)
...@@ -63,13 +63,17 @@ ...@@ -63,13 +63,17 @@
(* Format.eprintf " IDENT %s/%d/%d@." f l c; *) (* Format.eprintf " IDENT %s/%d/%d@." f l c; *)
(* is this a def point? *) (* is this a def point? *)
try try
match Glob.find loc with let id, def = Glob.find loc in
| id, Glob.Def -> match id.Ident.id_loc with
fprintf fmt "<a name=\"%a\">%a</a>" | None -> raise Not_found
Doc_def.pp_anchor id Pp.html_string s | Some _ ->
| id, Glob.Use -> match def with
fprintf fmt "<a href=\"%a\">%a</a>" | Glob.Def ->
Doc_def.pp_locate id Pp.html_string s fprintf fmt "<a name=\"%a\">%a</a>"
Doc_def.pp_anchor id Pp.html_string s
| Glob.Use ->
fprintf fmt "<a href=\"%a\">%a</a>"
Doc_def.pp_locate id Pp.html_string s
with Not_found -> with Not_found ->
(* otherwise, just print it *) (* otherwise, just print it *)
pp_print_string fmt s pp_print_string fmt s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment