File tree Expand file tree Collapse file tree 5 files changed +11
-10
lines changed Expand file tree Collapse file tree 5 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ let report_error_in_block block msg =
5252 | Cram _ -> " cram "
5353 | Toplevel _ -> " toplevel "
5454 in
55- Fmt. epr " %a: Error in the %scode block@]\n %s\n "
56- Stable_printer.Location. print_loc block.loc kind msg
55+ Fmt. epr " %a: Error in the %scode block@]\n %s\n " Stable_printer.Location. pp
56+ block.loc kind msg
5757
5858let run setup non_deterministic silent_eval record_backtrace syntax silent
5959 verbose_findlib prelude prelude_str file section root force_output output :
Original file line number Diff line number Diff line change @@ -20,11 +20,10 @@ let loc_error ~loc fmt =
2020 Format. kasprintf
2121 (fun s -> Error (`Msg s))
2222 (" %a: invalid code block: " ^^ fmt)
23- Stable_printer.Location. print_loc loc
23+ Stable_printer.Location. pp loc
2424
2525let locate_error_msg ~loc s =
26- Format. asprintf " %a: invalid code block: %s" Stable_printer.Location. print_loc
27- loc s
26+ Format. asprintf " %a: invalid code block: %s" Stable_printer.Location. pp loc s
2827
2928let locate_errors ~loc r =
3029 Result. map_error
@@ -139,7 +138,7 @@ let dump ppf ({ loc; section; labels; contents; value; _ } as b) =
139138 Fmt. pf ppf
140139 " {@[loc: %a;@ section: %a;@ labels: %a;@ header: %a;@ contents: %a;@ \
141140 value: %a@]}"
142- Stable_printer.Location. print_loc loc
141+ Stable_printer.Location. pp loc
143142 Fmt. (Dump. option dump_section)
144143 section
145144 Fmt.Dump. (list Label. pp)
Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ and cram_block = parse
116116 | exn ->
117117 let loc = Location. curr lexbuf in
118118 let msg =
119- Format. asprintf " %a: %s" Stable_printer.Location. print_loc loc (Printexc. to_string exn )
119+ Format. asprintf " %a: %s" Stable_printer.Location. pp loc
120+ (Printexc. to_string exn )
120121 in
121122 Util.Result. errorf " %s" msg
122123
@@ -127,7 +128,8 @@ let cram_token lexbuf =
127128 | exn ->
128129 let loc = Location. curr lexbuf in
129130 let msg =
130- Format. asprintf " %a: %s" Stable_printer.Location. print_loc loc (Printexc. to_string exn )
131+ Format. asprintf " %a: %s" Stable_printer.Location. pp loc
132+ (Printexc. to_string exn )
131133 in
132134 Util.Result. errorf " %s" msg
133135}
Original file line number Diff line number Diff line change 11module Location = struct
22 open Location
33
4- let print_loc ppf loc =
4+ let pp ppf loc =
55 (* setup_colors ();*)
66 let file_valid = function
77 | "_none_" ->
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ Use this for user facing part of the code so that mdx's output does not
33depend on the ocaml version it was built with. *)
44
55module Location : sig
6- val print_loc : Format .formatter -> Location .t -> unit
6+ val pp : Format .formatter -> Location .t -> unit
77 (* * Prints location for error reporting as ["File <file>, lines <line-range>"] *)
88end
You can’t perform that action at this time.
0 commit comments