From 733654abab8ae039f1bd4d13266faee4a336871c Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 24 Dec 2012 05:09:22 +0000 Subject: raise an error when multiple private keywords are used in type declarations git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13157 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'camlp4') diff --git a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml index 8501a914aa..c2b850eccd 100644 --- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml +++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml @@ -352,8 +352,11 @@ module Make (Ast : Sig.Camlp4Ast) = struct fun [ <:ctyp< $t1$ == $t2$ >> -> type_decl tl cl loc (Some (ctyp t1)) pflag t2 - | <:ctyp< private $t$ >> -> - type_decl tl cl loc m True t + | <:ctyp@_loc< private $t$ >> -> + if pflag then + error _loc "multiple private keyword used, use only one instead" + else + type_decl tl cl loc m True t | <:ctyp< { $t$ } >> -> mktype loc tl cl (Ptype_record (List.map mktrecord (list_of_ctyp t []))) (mkprivate' pflag) m -- cgit v1.2.1