summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <smimram@debian.org>2007-10-15 19:55:12 +0000
committerGravatar Samuel Mimram <smimram@debian.org>2007-10-15 19:55:12 +0000
commit4767d724d489a7ad67f696e9401e70b9f9ae2143 (patch)
tree142a99bc1cd3beef403f1942908de090f70c5e07 /lib
parent72b9a7df489ea47b3e5470741fd39f6100d31676 (diff)
Imported Upstream version 8.1.pl2+dfsgupstream/8.1.pl2+dfsg
Diffstat (limited to 'lib')
-rw-r--r--lib/compat.ml440
-rw-r--r--lib/options.ml4
-rw-r--r--lib/util.ml6
3 files changed, 40 insertions, 10 deletions
diff --git a/lib/compat.ml4 b/lib/compat.ml4
index 7ea3ff66..372d2be3 100644
--- a/lib/compat.ml4
+++ b/lib/compat.ml4
@@ -8,10 +8,24 @@
(* Compatibility file depending on ocaml version *)
-(* IFDEF not available in 3.06; use ifdef instead *)
-
(* type loc is different in 3.08 *)
-ifdef OCAML_308 then
+
+IFDEF OCAML309 THEN DEFINE OCAML308 END
+
+IFDEF CAMLP5 THEN
+module M = struct
+type loc = Stdpp.location
+let dummy_loc = Stdpp.dummy_loc
+let make_loc = Stdpp.make_loc
+let unloc loc = Stdpp.first_pos loc, Stdpp.last_pos loc
+let join_loc loc1 loc2 =
+ if loc1 = dummy_loc or loc2 = dummy_loc then dummy_loc
+ else Stdpp.encl_loc loc1 loc2
+type token = string*string
+type lexer = token Token.glexer
+let using l x = l.Token.tok_using x
+end
+ELSE IFDEF OCAML308 THEN
module M = struct
type loc = Token.flocation
let dummy_loc = Token.dummy_loc
@@ -24,16 +38,34 @@ let unloc (b,e) =
assert (dummy_loc = (b,e) or make_loc loc = (b,e));
*)
loc
+let join_loc loc1 loc2 =
+ if loc1 = dummy_loc or loc2 = dummy_loc then dummy_loc
+ else (fst loc1, snd loc2)
+type token = Token.t
+type lexer = Token.lexer
+let using l x = l.Token.using x
end
-else
+ELSE
module M = struct
type loc = int * int
let dummy_loc = (0,0)
let make_loc x = x
let unloc x = x
+let join_loc loc1 loc2 =
+ if loc1 = dummy_loc or loc2 = dummy_loc then dummy_loc
+ else (fst loc1, snd loc2)
+type token = Token.t
+type lexer = Token.lexer
+let using l x = l.Token.using x
end
+END
+END
type loc = M.loc
let dummy_loc = M.dummy_loc
let unloc = M.unloc
let make_loc = M.make_loc
+let join_loc = M.join_loc
+type token = M.token
+type lexer = M.lexer
+let using = M.using
diff --git a/lib/options.ml b/lib/options.ml
index c46857e3..53a7e9cf 100644
--- a/lib/options.ml
+++ b/lib/options.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: options.ml 9191 2006-09-29 15:45:42Z courtieu $ *)
+(* $Id: options.ml 10105 2007-08-30 16:53:32Z herbelin $ *)
open Util
@@ -121,4 +121,4 @@ let browser_cmd_fmt =
Not_found ->
if Sys.os_type = "Win32"
then "C:\\PROGRA~1\\INTERN~1\\IEXPLORE ", ""
- else "netscape -remote \"OpenURL(", ")\""
+ else "firefox -remote \"OpenURL(", ")\""
diff --git a/lib/util.ml b/lib/util.ml
index bf70acc7..16d73430 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
-(* $Id: util.ml 9766 2007-04-13 13:26:28Z herbelin $ *)
+(* $Id: util.ml 10185 2007-10-06 18:05:13Z herbelin $ *)
open Pp
@@ -32,9 +32,7 @@ type 'a located = loc * 'a
let anomaly_loc (loc,s,strm) = Stdpp.raise_with_loc loc (Anomaly (s,strm))
let user_err_loc (loc,s,strm) = Stdpp.raise_with_loc loc (UserError (s,strm))
let invalid_arg_loc (loc,s) = Stdpp.raise_with_loc loc (Invalid_argument s)
-let join_loc loc1 loc2 =
- if loc1 = dummy_loc or loc2 = dummy_loc then dummy_loc
- else (fst loc1, snd loc2)
+let join_loc = Compat.join_loc
(* Like Exc_located, but specifies the outermost file read, the filename
associated to the location of the error, and the error itself. *)