fix PR#6062: camlp4 macro parser uncaught exception

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13875 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Hongbo Zhang 2013-07-07 14:21:35 +00:00
parent e94ecc00a4
commit 72af5c7cd0
5 changed files with 6 additions and 11 deletions

View File

@ -62,6 +62,7 @@ Runtime system:
point within the major heap. point within the major heap.
Bug fixes: Bug fixes:
- PR#6062: Fix a regression bug caused by commit 13047
- PR#3679: Warning display problems - PR#3679: Warning display problems
- PR#3963: Graphics.wait_next_event in Win32 hangs if window closed - PR#3963: Graphics.wait_next_event in Win32 hangs if window closed
- PR#4079: Queue.copy is now tail-recursive - PR#4079: Queue.copy is now tail-recursive

View File

@ -34,7 +34,7 @@ for target in $TARGETS camlp4/boot/Camlp4Ast.ml; do
done done
if [ -x ./boot/myocamlbuild.native ]; then if [ -x ./boot/myocamlbuild.native ]; then
OCAMLBUILD=./boot/myocamlbuild.native OCAMLBUILD=./boot/myocamlbuild.native
else else
OCAMLBUILD="./boot/ocamlrun boot/myocamlbuild" OCAMLBUILD="./boot/ocamlrun boot/myocamlbuild"
fi fi

View File

@ -248,7 +248,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
defined.val := list_remove x defined.val; defined.val := list_remove x defined.val;
} }
with with
[ Not_found -> () ]; [ Struct.Grammar.Delete.Rule_not_found _ -> () ];
value parse_def s = value parse_def s =
match Gram.parse_string expr (Loc.mk "<command line>") s with match Gram.parse_string expr (Loc.mk "<command line>") s with

View File

@ -277,11 +277,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
<:expr< let module $m$ = $mb$ in $e$ >> <:expr< let module $m$ = $mb$ in $e$ >>
| "let"; "open"; "!"; i = module_longident; "in"; e = expr LEVEL ";" -> | "let"; "open"; "!"; i = module_longident; "in"; e = expr LEVEL ";" ->
<:expr< let open! $id:i$ in $e$ >> <:expr< let open! $id:i$ in $e$ >>
(* Ast.ExOpI _loc i Ast.OvOverride e *)
| "let"; "open"; i = module_longident; "in"; e = expr LEVEL ";" -> | "let"; "open"; i = module_longident; "in"; e = expr LEVEL ";" ->
<:expr< let open $id:i$ in $e$ >> <:expr< let open $id:i$ in $e$ >>
(* Ast.ExOpI _loc i Ast.OvNil e *)
(* <:expr< let open $id:i$ in $e$ >> *)
| "function"; a = match_case -> | "function"; a = match_case ->
<:expr< fun [ $a$ ] >> <:expr< fun [ $a$ ] >>
| "if"; e1 = SELF; "then"; e2 = expr LEVEL "top"; | "if"; e1 = SELF; "then"; e2 = expr LEVEL "top";

View File

@ -932,13 +932,10 @@ New syntax:\
and _ = (a_FLOAT : 'a_FLOAT Gram.Entry.t) in and _ = (a_FLOAT : 'a_FLOAT Gram.Entry.t) in
let grammar_entry_create = Gram.Entry.mk in let grammar_entry_create = Gram.Entry.mk in
let (* <:str_item< open $i$ >> *) let (* <:str_item< open $i$ >> *)
(* <:expr< let open $id:i$ in $e$ >> *)
(* Here it's LABEL and not tilde_label since ~a:b is different than ~a : b *) (* Here it's LABEL and not tilde_label since ~a:b is different than ~a : b *)
(* Same remark for ?a:b *) (* <:expr< let open $i$ in $e$ >> *) (* Same remark for ?a:b *) infixop5 : 'infixop5 Gram.Entry.t =
infixop5 : 'infixop5 Gram.Entry.t =
grammar_entry_create "infixop5" grammar_entry_create "infixop5"
and (* <:expr< let open $id:i$ in $e$ >> *) and (* | i = opt_label; "("; p = patt_tcon; ")" -> *)
(* | i = opt_label; "("; p = patt_tcon; ")" -> *)
(* <:patt< ? $i$ : ($p$) >> *) (* <:patt< ? $i$ : ($p$) >> *)
(* | i = opt_label; "("; p = ipatt_tcon; ")" -> (* | i = opt_label; "("; p = ipatt_tcon; ")" ->
<:patt< ? $i$ : ($p$) >> <:patt< ? $i$ : ($p$) >>
@ -14304,7 +14301,7 @@ Added statements:
Gram.Sself ]) Gram.Sself ])
| None -> ()); | None -> ());
defined := list_remove x !defined) defined := list_remove x !defined)
with | Not_found -> () with | Struct.Grammar.Delete.Rule_not_found _ -> ()
let parse_def s = let parse_def s =
match Gram.parse_string expr (Loc.mk "<command line>") s with match Gram.parse_string expr (Loc.mk "<command line>") s with