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.
Bug fixes:
- PR#6062: Fix a regression bug caused by commit 13047
- PR#3679: Warning display problems
- PR#3963: Graphics.wait_next_event in Win32 hangs if window closed
- PR#4079: Queue.copy is now tail-recursive

View File

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

View File

@ -248,7 +248,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
defined.val := list_remove x defined.val;
}
with
[ Not_found -> () ];
[ Struct.Grammar.Delete.Rule_not_found _ -> () ];
value parse_def s =
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$ >>
| "let"; "open"; "!"; i = module_longident; "in"; e = expr LEVEL ";" ->
<:expr< let open! $id:i$ in $e$ >>
(* Ast.ExOpI _loc i Ast.OvOverride e *)
| "let"; "open"; i = module_longident; "in"; e = expr LEVEL ";" ->
<: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 ->
<:expr< fun [ $a$ ] >>
| "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
let grammar_entry_create = Gram.Entry.mk in
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 *)
(* Same remark for ?a:b *) (* <:expr< let open $i$ in $e$ >> *)
infixop5 : 'infixop5 Gram.Entry.t =
(* Same remark for ?a:b *) infixop5 : 'infixop5 Gram.Entry.t =
grammar_entry_create "infixop5"
and (* <:expr< let open $id:i$ in $e$ >> *)
(* | i = opt_label; "("; p = patt_tcon; ")" -> *)
and (* | i = opt_label; "("; p = patt_tcon; ")" -> *)
(* <:patt< ? $i$ : ($p$) >> *)
(* | i = opt_label; "("; p = ipatt_tcon; ")" ->
<:patt< ? $i$ : ($p$) >>
@ -14304,7 +14301,7 @@ Added statements:
Gram.Sself ])
| None -> ());
defined := list_remove x !defined)
with | Not_found -> ()
with | Struct.Grammar.Delete.Rule_not_found _ -> ()
let parse_def s =
match Gram.parse_string expr (Loc.mk "<command line>") s with