diff options
Diffstat (limited to 'camlp4/lib/stdpp.ml')
-rw-r--r-- | camlp4/lib/stdpp.ml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/camlp4/lib/stdpp.ml b/camlp4/lib/stdpp.ml index a89cb15d8e..665dac1f30 100644 --- a/camlp4/lib/stdpp.ml +++ b/camlp4/lib/stdpp.ml @@ -12,7 +12,7 @@ (* $Id$ *) -exception Exc_located of (int * int) and exn; +exception Exc_located of Token.flocation and exn; value raise_with_loc loc exc = match exc with @@ -21,6 +21,14 @@ value raise_with_loc loc exc = ; value line_of_loc fname (bp, ep) = + (bp.Lexing.pos_fname, + bp.Lexing.pos_lnum, + bp.Lexing.pos_cnum - bp.Lexing.pos_bol, + ep.Lexing.pos_cnum - bp.Lexing.pos_bol) +; + +(* +value line_of_loc fname (bp, ep) = try let ic = open_in_bin fname in let strm = Stream.of_channel ic in @@ -75,5 +83,6 @@ value line_of_loc fname (bp, ep) = with [ Sys_error _ -> (fname, 1, bp, ep) ] ; +*) value loc_name = ref "loc"; |