diff options
author | Hongbo Zhang <bobzhang1988 AT gmail.com> | 2012-12-24 05:09:22 +0000 |
---|---|---|
committer | Hongbo Zhang <bobzhang1988 AT gmail.com> | 2012-12-24 05:09:22 +0000 |
commit | 733654abab8ae039f1bd4d13266faee4a336871c (patch) | |
tree | bc6fd707c632e5ec1f57f1efe0e6c4416e01a57d /camlp4 | |
parent | 2d3c0b7c1ee5e7a70a6e615b23eaa1f3a72a5cdd (diff) | |
download | ocaml-733654abab8ae039f1bd4d13266faee4a336871c.tar.gz |
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
Diffstat (limited to 'camlp4')
-rw-r--r-- | camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml | 7 |
1 files changed, 5 insertions, 2 deletions
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 |