diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/compat.ml4 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/compat.ml4 b/lib/compat.ml4 index 6c2102491f..0947f5fb84 100644 --- a/lib/compat.ml4 +++ b/lib/compat.ml4 @@ -15,15 +15,20 @@ ifdef OCAML_308 then module M = struct type loc = Token.flocation let dummy_loc = Token.dummy_loc -let unloc (b,e) = (b.Lexing.pos_cnum,e.Lexing.pos_cnum) let make_loc loc = Token.make_loc loc +let unloc (b,e) = + let loc = (b.Lexing.pos_cnum,e.Lexing.pos_cnum) in + (* Ensure that we unpack a char location that was encoded as a line-col + location by make_loc *) + assert (dummy_loc = (b,e) or make_loc loc = (b,e)); + loc end else module M = struct type loc = int * int let dummy_loc = (0,0) -let unloc x = x let make_loc x = x +let unloc x = x end type loc = M.loc |
