summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camlp4/camlp4/Makefile2
-rw-r--r--camlp4/camlp4/argl.ml13
-rw-r--r--camlp4/camlp4/ast2pt.ml2
-rw-r--r--camlp4/camlp4/mLast.mli4
-rw-r--r--camlp4/camlp4/pcaml.ml2
-rw-r--r--camlp4/camlp4/pcaml.mli3
-rw-r--r--camlp4/camlp4/reloc.ml2
-rw-r--r--camlp4/etc/pa_o.ml16
-rw-r--r--camlp4/etc/pa_olabl.ml10
-rw-r--r--camlp4/etc/pr_o.ml8
-rw-r--r--camlp4/etc/pr_r.ml8
-rw-r--r--camlp4/meta/pa_r.ml10
-rw-r--r--camlp4/meta/q_MLast.ml18
-rw-r--r--camlp4/ocaml_src/camlp4/Makefile2
-rw-r--r--camlp4/ocaml_src/camlp4/argl.ml9
-rw-r--r--camlp4/ocaml_src/camlp4/ast2pt.ml2
-rw-r--r--camlp4/ocaml_src/camlp4/mLast.mli2
-rw-r--r--camlp4/ocaml_src/camlp4/pcaml.ml2
-rw-r--r--camlp4/ocaml_src/camlp4/pcaml.mli3
-rw-r--r--camlp4/ocaml_src/camlp4/reloc.ml2
-rw-r--r--camlp4/ocaml_src/meta/pa_r.ml16
-rw-r--r--camlp4/ocaml_src/meta/q_MLast.ml35
-rw-r--r--stdlib/sys.ml2
23 files changed, 68 insertions, 105 deletions
diff --git a/camlp4/camlp4/Makefile b/camlp4/camlp4/Makefile
index 2fe59ce98..b58757e74 100644
--- a/camlp4/camlp4/Makefile
+++ b/camlp4/camlp4/Makefile
@@ -5,7 +5,7 @@ include ../config/Makefile
SHELL=/bin/sh
INCLUDES=-I ../odyl -I ../boot -I $(OTOP)/utils -I $(OTOP)/parsing -I $(OTOP)/otherlibs/dynlink
-OCAMLCFLAGS=-warn-error A $(INCLUDES)
+OCAMLCFLAGS= $(INCLUDES) -warn-error A
LINKFLAGS=$(INCLUDES)
INTERFACES=-I $(OLIBDIR) Arg Array ArrayLabels Buffer Callback CamlinternalOO Char Complex Digest Filename Format Gc Genlex Hashtbl Int32 Int64 Lazy Lexing List ListLabels Map Marshal MoreLabels Nativeint Obj Oo Parsing Pervasives Printexc Printf Queue Random Scanf Set Sort Stack StdLabels Stream String StringLabels Sys Weak -I ../boot Extfold Extfun Fstream Gramext Grammar Plexer Stdpp Token -I $(OTOP)/utils Config Warnings -I $(OTOP)/parsing Asttypes Location Longident Parsetree -I . Ast2pt MLast Pcaml Quotation Spretty
CAMLP4_INTF=$(OTOP)/utils/config.cmi $(OTOP)/utils/warnings.cmi $(OTOP)/parsing/asttypes.cmi $(OTOP)/parsing/location.cmi $(OTOP)/parsing/longident.cmi $(OTOP)/parsing/parsetree.cmi ast2pt.cmi mLast.cmi pcaml.cmi spretty.cmi quotation.cmi
diff --git a/camlp4/camlp4/argl.ml b/camlp4/camlp4/argl.ml
index 760efd93e..e4de7a172 100644
--- a/camlp4/camlp4/argl.ml
+++ b/camlp4/camlp4/argl.ml
@@ -246,6 +246,15 @@ Other options:
}
;
+value warn_noassert () =
+ do {
+ eprintf "\
+camlp4 warning: option -noassert is obsolete
+You should give the -noassert option to the ocaml compiler instead.
+";
+ }
+;
+
value initial_spec_list =
[("-intf",
Arg.String
@@ -257,8 +266,8 @@ value initial_spec_list =
"<file> Parse <file> as an implementation, whatever its extension.");
("-unsafe", Arg.Set Ast2pt.fast,
"Generate unsafe accesses to array and strings.");
- ("-noassert", Arg.Set Pcaml.no_assert,
- "Don't compile assertion checks.");
+ ("-noassert", Arg.Unit warn_noassert,
+ "Obsolete, do not use this option.");
("-verbose", Arg.Set Grammar.error_verbose,
"More verbose in parsing errors.");
("-loc", Arg.String (fun x -> Stdpp.loc_name.val := x),
diff --git a/camlp4/camlp4/ast2pt.ml b/camlp4/camlp4/ast2pt.ml
index 81c7db449..124a6e34a 100644
--- a/camlp4/camlp4/ast2pt.ml
+++ b/camlp4/camlp4/ast2pt.ml
@@ -514,6 +514,7 @@ value rec expr =
(Pexp_apply (mkexp loc (Pexp_ident (array_function "Array" "get")))
[("", expr e1); ("", expr e2)])
| ExArr loc el -> mkexp loc (Pexp_array (List.map expr el))
+ | ExAsf loc -> mkexp loc Pexp_assertfalse
| ExAss loc e v ->
let e =
match e with
@@ -535,6 +536,7 @@ value rec expr =
| _ -> error loc "bad left part of assignment" ]
in
mkexp loc e
+ | ExAsr loc e -> mkexp loc (Pexp_assert (expr e))
| ExChr loc s ->
mkexp loc (Pexp_constant (Const_char (char_of_char_token loc s)))
| ExCoe loc e t1 t2 ->
diff --git a/camlp4/camlp4/mLast.mli b/camlp4/camlp4/mLast.mli
index 90cb1c942..f3f7fd80a 100644
--- a/camlp4/camlp4/mLast.mli
+++ b/camlp4/camlp4/mLast.mli
@@ -76,7 +76,9 @@ and expr =
| ExApp of loc and expr and expr
| ExAre of loc and expr and expr
| ExArr of loc and list expr
- | ExAss of loc and expr and expr
+ | ExAsf of loc (* assert False *)
+ | ExAsr of loc and expr (* assert *)
+ | ExAss of loc and expr and expr (* assignment *)
| ExChr of loc and string
| ExCoe of loc and expr and option ctyp and ctyp
| ExFlo of loc and string
diff --git a/camlp4/camlp4/pcaml.ml b/camlp4/camlp4/pcaml.ml
index 411d565b5..a96451930 100644
--- a/camlp4/camlp4/pcaml.ml
+++ b/camlp4/camlp4/pcaml.ml
@@ -320,7 +320,7 @@ value warning_default_function (bp, ep) txt =
value warning = ref warning_default_function;
value no_constructors_arity = Ast2pt.no_constructors_arity;
-value no_assert = ref False;
+(*value no_assert = ref False;*)
value arg_spec_list_ref = ref [];
value arg_spec_list () = arg_spec_list_ref.val;
diff --git a/camlp4/camlp4/pcaml.mli b/camlp4/camlp4/pcaml.mli
index a730db494..cd734d538 100644
--- a/camlp4/camlp4/pcaml.mli
+++ b/camlp4/camlp4/pcaml.mli
@@ -61,8 +61,9 @@ value add_option : string -> Arg.spec -> string -> unit;
(** Add an option to the command line options. *)
value no_constructors_arity : ref bool;
(** [True]: dont generate constructor arity. *)
-value no_assert : ref bool;
+(*value no_assert : ref bool;
(** [True]: dont generate assertion checks. *)
+*)
value sync : ref (Stream.t char -> unit);
diff --git a/camlp4/camlp4/reloc.ml b/camlp4/camlp4/reloc.ml
index c771c512c..78cc626e5 100644
--- a/camlp4/camlp4/reloc.ml
+++ b/camlp4/camlp4/reloc.ml
@@ -97,6 +97,8 @@ and expr floc sh =
| ExApp loc x1 x2 -> ExApp (floc loc) (self x1) (self x2)
| ExAre loc x1 x2 -> ExAre (floc loc) (self x1) (self x2)
| ExArr loc x1 -> ExArr (floc loc) (List.map self x1)
+ | ExAsf loc -> ExAsf (floc loc)
+ | ExAsr loc x1 -> ExAsr (floc loc) (self x1)
| ExAss loc x1 x2 -> ExAss (floc loc) (self x1) (self x2)
| ExChr loc x1 -> ExChr (floc loc) x1
| ExCoe loc x1 x2 x3 ->
diff --git a/camlp4/etc/pa_o.ml b/camlp4/etc/pa_o.ml
index 7ac4e9d34..9011f7cd7 100644
--- a/camlp4/etc/pa_o.ml
+++ b/camlp4/etc/pa_o.ml
@@ -50,11 +50,11 @@ value o2b =
;
value mkumin loc f arg =
- match arg with
- [ <:expr< $int:n$ >> when int_of_string n > 0 ->
+ match (f, arg) with
+ [ ("-", <:expr< $int:n$ >>) when int_of_string n > 0 ->
let n = "-" ^ n in
<:expr< $int:n$ >>
- | <:expr< $flo:n$ >> when float_of_string n > 0.0 ->
+ | (_, <:expr< $flo:n$ >>) when float_of_string n > 0.0 ->
let n = "-" ^ n in
<:expr< $flo:n$ >>
| _ ->
@@ -584,15 +584,9 @@ EXTEND
List.fold_left (fun e1 e2 -> <:expr< $e1$ $e2$ >>) e1 el
| _ -> <:expr< $e1$ $e2$ >> ] ]
| "assert"; e = SELF ->
- let f = <:expr< $str:input_file.val$ >> in
- let bp = <:expr< $int:string_of_int (fst loc)$ >> in
- let ep = <:expr< $int:string_of_int (snd loc)$ >> in
- let raiser = <:expr< raise (Assert_failure ($f$, $bp$, $ep$)) >> in
match e with
- [ <:expr< False >> -> raiser
- | _ ->
- if no_assert.val then <:expr< () >>
- else <:expr< if $e$ then () else $raiser$ >> ]
+ [ <:expr< False >> -> <:expr< assert False >>
+ | _ -> <:expr< assert ($e$) >> ]
| "lazy"; e = SELF ->
<:expr< lazy ($e$) >> ]
| "." LEFTA
diff --git a/camlp4/etc/pa_olabl.ml b/camlp4/etc/pa_olabl.ml
index d3bcb69da..7cb286781 100644
--- a/camlp4/etc/pa_olabl.ml
+++ b/camlp4/etc/pa_olabl.ml
@@ -1096,15 +1096,9 @@ EXTEND
List.fold_left (fun e1 e2 -> <:expr< $e1$ $e2$ >>) e1 el
| _ -> <:expr< $e1$ $e2$ >> ] ]
| "assert"; e = expr LEVEL "simple" ->
- let f = <:expr< $str:input_file.val$ >> in
- let bp = <:expr< $int:string_of_int (fst loc)$ >> in
- let ep = <:expr< $int:string_of_int (snd loc)$ >> in
- let raiser = <:expr< raise (Assert_failure ($f$, $bp$, $ep$)) >> in
match e with
- [ <:expr< False >> -> raiser
- | _ ->
- if no_assert.val then <:expr< () >>
- else <:expr< if $e$ then () else $raiser$ >> ]
+ [ <:expr< False >> -> MLast.ExAsf loc
+ | _ -> MLast.ExAsr loc e ]
| "lazy"; e = SELF ->
<:expr< lazy ($e$) >> ]
| "simple" LEFTA
diff --git a/camlp4/etc/pr_o.ml b/camlp4/etc/pr_o.ml
index 1e203b982..9f2a762f0 100644
--- a/camlp4/etc/pr_o.ml
+++ b/camlp4/etc/pr_o.ml
@@ -1045,8 +1045,6 @@ pr_expr.pr_levels :=
`S LR "with" :];
`match_assoc_list loc pel "" [: :];
`HVbox [: `S LR "end"; k :] :] :]
- | <:expr< if $_$ then () else raise (Assert_failure $_$) >> as e ->
- fun curr next dg k -> [: `next e dg k :]
| <:expr< if $e1$ then $e2$ else $e3$ >> as e ->
fun curr next dg k ->
let eel_e =
@@ -1277,10 +1275,10 @@ pr_expr.pr_levels :=
fun curr next dg k -> [: `next e "" k :]
| <:expr< lazy ($x$) >> ->
fun curr next dg k -> [: `S LR "lazy"; `next x "" k :]
- | <:expr< if $e$ then () else raise (Assert_failure $_$) >> ->
- fun curr next dg k -> [: `S LR "assert"; `next e "" k :]
- | <:expr< raise (Assert_failure $_$) >> ->
+ | <:expr< assert False >> ->
fun curr next dg k -> [: `S LR "assert"; `S LR "false"; k :]
+ | <:expr< assert ($e$) >> ->
+ fun curr next dg k -> [: `S LR "assert"; `next e "" k :]
| <:expr< $lid:n$ $x$ $y$ >> as e ->
fun curr next dg k ->
let loc = MLast.loc_of_expr e in
diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml
index 8774956bd..11ddd8ecc 100644
--- a/camlp4/etc/pr_r.ml
+++ b/camlp4/etc/pr_r.ml
@@ -989,8 +989,6 @@ pr_expr.pr_levels :=
[: `HVbox [: :];
`BEbox [: `S LR "try"; `expr e [: :]; `S LR "with" :];
`match_assoc_list pel k :]
- | <:expr< if $_$ then () else raise (Assert_failure $_$) >> as e ->
- fun curr next _ k -> [: `next e "" k :]
| <:expr< if $e1$ then $e2$ else $e3$ >> ->
fun curr next _ k ->
let (eel, e) =
@@ -1157,10 +1155,10 @@ pr_expr.pr_levels :=
fun curr next _ k -> [: `next e "" k :]
| <:expr< lazy ($x$) >> ->
fun curr next _ k -> [: `S LR "lazy"; `next x "" k :]
- | <:expr< if $e$ then () else raise (Assert_failure $_$) >> ->
- fun curr next _ k -> [: `S LR "assert"; `next e "" k :]
- | <:expr< raise (Assert_failure $_$) >> ->
+ | <:expr< assert False >> ->
fun curr next _ k -> [: `S LR "assert"; `S LR "False"; k :]
+ | <:expr< assert ($e$) >> ->
+ fun curr next _ k -> [: `S LR "assert"; `next e "" k :]
| <:expr< $lid:n$ $x$ $y$ >> as e ->
fun curr next _ k ->
if is_infix n then [: `next e "" k :]
diff --git a/camlp4/meta/pa_r.ml b/camlp4/meta/pa_r.ml
index 4fdb6afc6..cc8ff0932 100644
--- a/camlp4/meta/pa_r.ml
+++ b/camlp4/meta/pa_r.ml
@@ -139,15 +139,9 @@ value mkexprident loc i j =
;
value mkassert loc e =
- let f = <:expr< $str:input_file.val$ >> in
- let bp = <:expr< $int:string_of_int (fst loc)$ >> in
- let ep = <:expr< $int:string_of_int (snd loc)$ >> in
- let raiser = <:expr< raise (Assert_failure ($f$, $bp$, $ep$)) >> in
match e with
- [ <:expr< False >> -> raiser
- | _ ->
- if no_assert.val then <:expr< () >>
- else <:expr< if $e$ then () else $raiser$ >> ]
+ [ <:expr< False >> -> <:expr< assert False >>
+ | _ -> <:expr< assert ($e$) >> ]
;
value append_elem el e = el @ [e];
diff --git a/camlp4/meta/q_MLast.ml b/camlp4/meta/q_MLast.ml
index c07886da6..a61ee49e2 100644
--- a/camlp4/meta/q_MLast.ml
+++ b/camlp4/meta/q_MLast.ml
@@ -216,23 +216,9 @@ value mkexprident loc i j =
;
value mkassert _ e =
- let f = Qast.Node "ExStr" [Qast.Loc; Qast.Str ""] in
- let bp = Qast.Node "ExInt" [Qast.Loc; Qast.Str "0"] in
- let ep = Qast.Node "ExInt" [Qast.Loc; Qast.Str "0"] in
- let raiser =
- Qast.Node "ExApp"
- [Qast.Loc; Qast.Node "ExLid" [Qast.Loc; Qast.Str "raise"];
- Qast.Node "ExApp"
- [Qast.Loc; Qast.Node "ExUid" [Qast.Loc; Qast.Str "Assert_failure"];
- Qast.Node "ExTup" [Qast.Loc; Qast.List [f; bp; ep]]]]
- in
match e with
- [ Qast.Node "ExUid" [_; Qast.Str "False"] -> raiser
- | _ ->
- if Pcaml.no_assert.val then Qast.Node "ExUid" [Qast.Loc; Qast.Str "()"]
- else
- Qast.Node "ExIfe"
- [Qast.Loc; e; Qast.Node "ExUid" [Qast.Loc; Qast.Str "()"]; raiser] ]
+ [ Qast.Node "ExUid" [_; Qast.Str "False"] -> Qast.Node "ExAsf" [Qast.Loc]
+ | _ -> Qast.Node "ExAsr" [Qast.Loc; e] ]
;
value append_elem el e = Qast.Apply "@" [el; Qast.List [e]];
diff --git a/camlp4/ocaml_src/camlp4/Makefile b/camlp4/ocaml_src/camlp4/Makefile
index 8e3aaad60..7ea191f41 100644
--- a/camlp4/ocaml_src/camlp4/Makefile
+++ b/camlp4/ocaml_src/camlp4/Makefile
@@ -5,7 +5,7 @@ include ../../config/Makefile
SHELL=/bin/sh
INCLUDES=-I ../odyl -I ../../boot -I $(OTOP)/utils -I $(OTOP)/parsing -I $(OTOP)/otherlibs/dynlink
-OCAMLCFLAGS=-warn-error A $(INCLUDES)
+OCAMLCFLAGS= $(INCLUDES) -warn-error A
LINKFLAGS=$(INCLUDES)
INTERFACES=-I $(OLIBDIR) Arg Array ArrayLabels Buffer Callback CamlinternalOO Char Complex Digest Filename Format Gc Genlex Hashtbl Int32 Int64 Lazy Lexing List ListLabels Map Marshal MoreLabels Nativeint Obj Oo Parsing Pervasives Printexc Printf Queue Random Scanf Set Sort Stack StdLabels Stream String StringLabels Sys Weak -I ../../boot Extfold Extfun Fstream Gramext Grammar Plexer Stdpp Token -I $(OTOP)/utils Config Warnings -I $(OTOP)/parsing Asttypes Location Longident Parsetree -I . Ast2pt MLast Pcaml Quotation Spretty
CAMLP4_INTF=$(OTOP)/utils/config.cmi $(OTOP)/utils/warnings.cmi $(OTOP)/parsing/asttypes.cmi $(OTOP)/parsing/location.cmi $(OTOP)/parsing/longident.cmi $(OTOP)/parsing/parsetree.cmi ast2pt.cmi mLast.cmi pcaml.cmi spretty.cmi quotation.cmi
diff --git a/camlp4/ocaml_src/camlp4/argl.ml b/camlp4/ocaml_src/camlp4/argl.ml
index 0a0c1988c..19c9e1d51 100644
--- a/camlp4/ocaml_src/camlp4/argl.ml
+++ b/camlp4/ocaml_src/camlp4/argl.ml
@@ -258,6 +258,13 @@ Other options:
end
;;
+let warn_noassert () =
+ eprintf "\
+camlp4 warning: option -noassert is obsolete
+You should give the -noassert option to the ocaml compiler instead.
+"
+;;
+
let initial_spec_list =
["-intf", Arg.String (fun x -> file_kind := Intf; Pcaml.input_file := x),
"<file> Parse <file> as an interface, whatever its extension.";
@@ -265,7 +272,7 @@ let initial_spec_list =
"<file> Parse <file> as an implementation, whatever its extension.";
"-unsafe", Arg.Set Ast2pt.fast,
"Generate unsafe accesses to array and strings.";
- "-noassert", Arg.Set Pcaml.no_assert, "Don't compile assertion checks.";
+ "-noassert", Arg.Unit warn_noassert, "Obsolete, do not use this option.";
"-verbose", Arg.Set Grammar.error_verbose,
"More verbose in parsing errors.";
"-loc", Arg.String (fun x -> Stdpp.loc_name := x),
diff --git a/camlp4/ocaml_src/camlp4/ast2pt.ml b/camlp4/ocaml_src/camlp4/ast2pt.ml
index 1cd5da551..ec7e48e55 100644
--- a/camlp4/ocaml_src/camlp4/ast2pt.ml
+++ b/camlp4/ocaml_src/camlp4/ast2pt.ml
@@ -515,6 +515,7 @@ let rec expr =
(mkexp loc (Pexp_ident (array_function "Array" "get")),
["", expr e1; "", expr e2]))
| ExArr (loc, el) -> mkexp loc (Pexp_array (List.map expr el))
+ | ExAsf loc -> mkexp loc Pexp_assertfalse
| ExAss (loc, e, v) ->
let e =
match e with
@@ -538,6 +539,7 @@ let rec expr =
| _ -> error loc "bad left part of assignment"
in
mkexp loc e
+ | ExAsr (loc, e) -> mkexp loc (Pexp_assert (expr e))
| ExChr (loc, s) ->
mkexp loc (Pexp_constant (Const_char (char_of_char_token loc s)))
| ExCoe (loc, e, t1, t2) ->
diff --git a/camlp4/ocaml_src/camlp4/mLast.mli b/camlp4/ocaml_src/camlp4/mLast.mli
index 46f541d00..e357b9757 100644
--- a/camlp4/ocaml_src/camlp4/mLast.mli
+++ b/camlp4/ocaml_src/camlp4/mLast.mli
@@ -76,6 +76,8 @@ and expr =
| ExApp of loc * expr * expr
| ExAre of loc * expr * expr
| ExArr of loc * expr list
+ | ExAsf of loc
+ | ExAsr of loc * expr
| ExAss of loc * expr * expr
| ExChr of loc * string
| ExCoe of loc * expr * ctyp option * ctyp
diff --git a/camlp4/ocaml_src/camlp4/pcaml.ml b/camlp4/ocaml_src/camlp4/pcaml.ml
index 20fa7d0ed..bd0d6ca20 100644
--- a/camlp4/ocaml_src/camlp4/pcaml.ml
+++ b/camlp4/ocaml_src/camlp4/pcaml.ml
@@ -309,7 +309,7 @@ let warning_default_function (bp, ep) txt =
let warning = ref warning_default_function;;
let no_constructors_arity = Ast2pt.no_constructors_arity;;
-let no_assert = ref false;;
+(*value no_assert = ref False;*)
let arg_spec_list_ref = ref [];;
let arg_spec_list () = !arg_spec_list_ref;;
diff --git a/camlp4/ocaml_src/camlp4/pcaml.mli b/camlp4/ocaml_src/camlp4/pcaml.mli
index 45f72577d..05415844e 100644
--- a/camlp4/ocaml_src/camlp4/pcaml.mli
+++ b/camlp4/ocaml_src/camlp4/pcaml.mli
@@ -61,8 +61,9 @@ val add_option : string -> Arg.spec -> string -> unit;;
(** Add an option to the command line options. *)
val no_constructors_arity : bool ref;;
(** [True]: dont generate constructor arity. *)
-val no_assert : bool ref;;
+(*value no_assert : ref bool;
(** [True]: dont generate assertion checks. *)
+*)
val sync : (char Stream.t -> unit) ref;;
diff --git a/camlp4/ocaml_src/camlp4/reloc.ml b/camlp4/ocaml_src/camlp4/reloc.ml
index fb31775e9..bb85b5bc2 100644
--- a/camlp4/ocaml_src/camlp4/reloc.ml
+++ b/camlp4/ocaml_src/camlp4/reloc.ml
@@ -101,6 +101,8 @@ and expr floc sh =
| ExApp (loc, x1, x2) -> ExApp (floc loc, self x1, self x2)
| ExAre (loc, x1, x2) -> ExAre (floc loc, self x1, self x2)
| ExArr (loc, x1) -> ExArr (floc loc, List.map self x1)
+ | ExAsf loc -> ExAsf (floc loc)
+ | ExAsr (loc, x1) -> ExAsr (floc loc, self x1)
| ExAss (loc, x1, x2) -> ExAss (floc loc, self x1, self x2)
| ExChr (loc, x1) -> ExChr (floc loc, x1)
| ExCoe (loc, x1, x2, x3) ->
diff --git a/camlp4/ocaml_src/meta/pa_r.ml b/camlp4/ocaml_src/meta/pa_r.ml
index b491fb788..05e18e8ce 100644
--- a/camlp4/ocaml_src/meta/pa_r.ml
+++ b/camlp4/ocaml_src/meta/pa_r.ml
@@ -136,21 +136,9 @@ let mkexprident loc i j =
;;
let mkassert loc e =
- let f = MLast.ExStr (loc, !input_file) in
- let bp = MLast.ExInt (loc, string_of_int (fst loc)) in
- let ep = MLast.ExInt (loc, string_of_int (snd loc)) in
- let raiser =
- MLast.ExApp
- (loc, MLast.ExLid (loc, "raise"),
- MLast.ExApp
- (loc, MLast.ExUid (loc, "Assert_failure"),
- MLast.ExTup (loc, [f; bp; ep])))
- in
match e with
- MLast.ExUid (_, "False") -> raiser
- | _ ->
- if !no_assert then MLast.ExUid (loc, "()")
- else MLast.ExIfe (loc, e, MLast.ExUid (loc, "()"), raiser)
+ MLast.ExUid (_, "False") -> MLast.ExAsf loc
+ | _ -> MLast.ExAsr (loc, e)
;;
let append_elem el e = el @ [e];;
diff --git a/camlp4/ocaml_src/meta/q_MLast.ml b/camlp4/ocaml_src/meta/q_MLast.ml
index 590235609..f5a41f5c0 100644
--- a/camlp4/ocaml_src/meta/q_MLast.ml
+++ b/camlp4/ocaml_src/meta/q_MLast.ml
@@ -256,29 +256,10 @@ let mkexprident loc i j =
;;
let mkassert _ e =
- let f = Qast.Node ("ExStr", [Qast.Loc; Qast.Str ""]) in
- let bp = Qast.Node ("ExInt", [Qast.Loc; Qast.Str "0"]) in
- let ep = Qast.Node ("ExInt", [Qast.Loc; Qast.Str "0"]) in
- let raiser =
- Qast.Node
- ("ExApp",
- [Qast.Loc; Qast.Node ("ExLid", [Qast.Loc; Qast.Str "raise"]);
- Qast.Node
- ("ExApp",
- [Qast.Loc;
- Qast.Node ("ExUid", [Qast.Loc; Qast.Str "Assert_failure"]);
- Qast.Node ("ExTup", [Qast.Loc; Qast.List [f; bp; ep]])])])
- in
match e with
- Qast.Node ("ExUid", [_; Qast.Str "False"]) -> raiser
- | _ ->
- if !(Pcaml.no_assert) then
- Qast.Node ("ExUid", [Qast.Loc; Qast.Str "()"])
- else
- Qast.Node
- ("ExIfe",
- [Qast.Loc; e; Qast.Node ("ExUid", [Qast.Loc; Qast.Str "()"]);
- raiser])
+ Qast.Node ("ExUid", [_; Qast.Str "False"]) ->
+ Qast.Node ("ExAsf", [Qast.Loc])
+ | _ -> Qast.Node ("ExAsr", [Qast.Loc; e])
;;
let append_elem el e = Qast.Apply ("@", [el; Qast.List [e]]);;
@@ -590,7 +571,7 @@ Grammar.extend
Qast.Tuple [xx1; xx2; xx3] -> xx1, xx2, xx3
| _ ->
match () with
- _ -> raise (Match_failure ("q_MLast.ml", 288, 19))
+ _ -> raise (Match_failure ("q_MLast.ml", 274, 19))
in
Qast.Node ("StExc", [Qast.Loc; c; tl; b]) :
'str_item));
@@ -826,7 +807,7 @@ Grammar.extend
Qast.Tuple [xx1; xx2; xx3] -> xx1, xx2, xx3
| _ ->
match () with
- _ -> raise (Match_failure ("q_MLast.ml", 340, 19))
+ _ -> raise (Match_failure ("q_MLast.ml", 326, 19))
in
Qast.Node ("SgExc", [Qast.Loc; c; tl]) :
'sig_item));
@@ -2663,7 +2644,7 @@ Grammar.extend
Qast.Tuple [xx1; xx2; xx3] -> xx1, xx2, xx3
| _ ->
match () with
- _ -> raise (Match_failure ("q_MLast.ml", 882, 19))
+ _ -> raise (Match_failure ("q_MLast.ml", 868, 19))
in
Qast.Node ("CrVal", [Qast.Loc; lab; mf; e]) :
'class_str_item));
@@ -3058,7 +3039,7 @@ Grammar.extend
Qast.Tuple [xx1; xx2] -> xx1, xx2
| _ ->
match () with
- _ -> raise (Match_failure ("q_MLast.ml", 996, 19))
+ _ -> raise (Match_failure ("q_MLast.ml", 982, 19))
in
Qast.Node ("TyObj", [Qast.Loc; ml; v]) :
'ctyp));
@@ -3093,7 +3074,7 @@ Grammar.extend
Qast.Tuple [xx1; xx2] -> xx1, xx2
| _ ->
match () with
- _ -> raise (Match_failure ("q_MLast.ml", 1007, 19))
+ _ -> raise (Match_failure ("q_MLast.ml", 993, 19))
in
Qast.Tuple [Qast.Cons (f, ml); v] :
'meth_list))]];
diff --git a/stdlib/sys.ml b/stdlib/sys.ml
index 77d91abb7..4b0ab9e94 100644
--- a/stdlib/sys.ml
+++ b/stdlib/sys.ml
@@ -78,4 +78,4 @@ let catch_break on =
(* OCaml version string, must be in the format described in sys.mli. *)
-let ocaml_version = "3.06+24 (2003-02-28)";;
+let ocaml_version = "3.06+25 (2003-03-13)";;