1 (***********************************************************************)
5 (* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
7 (* Copyright 2006 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
11 (***********************************************************************)
16 type kind
= Dinfo_call
| Dinfo_raise
22 dinfo_char_start
: int;
27 dinfo_kind
= Dinfo_call
;
37 else Printf.sprintf
"{%s:%d,%d-%d}"
38 d
.dinfo_file d
.dinfo_line d
.dinfo_char_start d
.dinfo_char_end
40 let from_location kind loc
=
41 if loc
.loc_ghost
then none else
43 dinfo_file
= loc
.loc_start
.pos_fname
;
44 dinfo_line
= loc
.loc_start
.pos_lnum
;
45 dinfo_char_start
= loc
.loc_start
.pos_cnum
- loc
.loc_start
.pos_bol
;
47 if loc
.loc_end
.pos_fname
= loc
.loc_start
.pos_fname
48 then loc
.loc_end
.pos_cnum
- loc
.loc_start
.pos_bol
49 else loc
.loc_start
.pos_cnum
- loc
.loc_start
.pos_bol
}
51 let from_call ev
= from_location Dinfo_call ev
.Lambda.lev_loc
52 let from_raise ev
= from_location Dinfo_raise ev
.Lambda.lev_loc