@@ -11,22 +11,11 @@ let file_lines filePath =
1111let setup_colors () =
1212 Misc.Color. setup ! Clflags. color
1313
14- let print_filename ppf file =
15- match file with
16- (* modified *)
17- | " _none_"
18- | "" -> Format. fprintf ppf " (No file name)"
19- | real_file -> Format. fprintf ppf " %s" (Location. show_filename real_file)
14+ let print_filename = Location. print_filename
2015
2116let print_loc ~normalizedRange ppf (loc : Location.t ) =
2217 setup_colors () ;
23- let (file, _, _) = Location. get_pos_info loc.loc_start in
24- if file = " //toplevel//" then begin
25- if Location. highlight_locations ppf [loc] then () else
26- fprintf ppf " Characters %i-%i"
27- loc.loc_start.pos_cnum loc.loc_end.pos_cnum
28- end else
29- let dim_loc ppf = function
18+ let dim_loc ppf = function
3019 | None -> ()
3120 | Some ((start_line , start_line_start_char ), (end_line , end_line_end_char )) ->
3221 if start_line = end_line then
@@ -36,8 +25,8 @@ let print_loc ~normalizedRange ppf (loc : Location.t) =
3625 fprintf ppf " @{<dim>%i:%i-%i@}" start_line start_line_start_char end_line_end_char
3726 else
3827 fprintf ppf " @{<dim>%i:%i-%i:%i@}" start_line start_line_start_char end_line end_line_end_char
39- in
40- fprintf ppf " @{<filename>%a@}%a" print_filename file dim_loc normalizedRange
28+ in
29+ fprintf ppf " @{<filename>%a@}%a" print_filename loc.loc_start.pos_fname dim_loc normalizedRange
4130;;
4231
4332let print ~message_kind intro ppf (loc : Location.t ) =
0 commit comments