diff options
author | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2005-01-31 14:34:14 +0000 |
---|---|---|
committer | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2005-01-31 14:34:14 +0000 |
commit | 6497f27021fec4e01f2182014f2bb1989b4707f9 (patch) | |
tree | 473be7e63895a42966970ab6a70998113bc1bd59 /lib/compat.ml4 | |
parent | 6b649aba925b6f7462da07599fe67ebb12a3460e (diff) |
Imported Upstream version 8.0pl2upstream/8.0pl2
Diffstat (limited to 'lib/compat.ml4')
-rw-r--r-- | lib/compat.ml4 | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/compat.ml4 b/lib/compat.ml4 index 5e1c65b4..0947f5fb 100644 --- a/lib/compat.ml4 +++ b/lib/compat.ml4 @@ -11,19 +11,24 @@ (* IFDEF not available in 3.06; use ifdef instead *) (* type loc is different in 3.08 *) -ifdef OCAML308 then +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 |