cross-reference-checker: fix attribute structure after GPR #1953

master
Gabriel Scherer 2018-08-19 18:32:26 +02:00
parent a6d7e60839
commit 1c082929e3
1 changed files with 9 additions and 9 deletions

View File

@ -135,17 +135,17 @@ module OCaml_refs = struct
sourcefile
(** search for an attribute [[@manual.ref "tex_label_name"]] *)
let manual_reference_attribute (s, payload) =
if s.Location.txt = "manual.ref" then
match payload with
| Parsetree.(
PStr [{pstr_desc= Pstr_eval
({ pexp_desc = Pexp_constant Pconst_string (s,_) },_) } ] ) ->
let manual_reference_attribute attr =
let open Parsetree in
if attr.attr_name.Location.txt <> "manual.ref"
then None
else begin match attr.attr_payload with
| PStr [{pstr_desc= Pstr_eval
({ pexp_desc = Pexp_constant Pconst_string (s,_) },_) } ] ->
Some s
| _ -> print_error (Wrong_attribute_payload s.Location.loc);
| _ -> print_error (Wrong_attribute_payload attr.attr_loc);
Some "" (* triggers an error *)
else
None
end
let rec label_from_attributes = function
| [] -> None