Commit | Line | Data |
---|---|---|
1 | type t = | |
2 | { file : string | |
3 | ; start_char : int | |
4 | ; start_line : int | |
5 | ; end_char : int | |
6 | ; end_line : int | |
7 | } | |
8 | ||
9 | let of_lexing_positions | |
10 | ~pos_start: | |
11 | Lexing.({pos_fname=sfile; pos_lnum=sline; pos_bol=sbol; pos_cnum=scnum}) | |
12 | ~pos_end: | |
13 | Lexing.({pos_fname=efile; pos_lnum=eline; pos_bol=ebol; pos_cnum=ecnum}) | |
14 | = | |
15 | assert (sfile = efile); | |
16 | { file = sfile | |
17 | ; start_char = scnum - sbol | |
18 | ; start_line = sline | |
19 | ; end_char = ecnum - ebol | |
20 | ; end_line = eline | |
21 | } |