diff options
author | Alain Frisch <alain@frisch.fr> | 2012-06-29 09:49:52 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2012-06-29 09:49:52 +0000 |
commit | 9d32d891087bde292ec53783f9c9a8d95fd87add (patch) | |
tree | 6f140267c5a6d55b603d35854867935071b76b46 /experimental | |
parent | 8531a5c8eea6a62905cbea60d14f17bc44e531fa (diff) | |
download | ocaml-9d32d891087bde292ec53783f9c9a8d95fd87add.tar.gz |
Better error report.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12654 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/frisch/ifdef.ml | 6 | ||||
-rw-r--r-- | experimental/frisch/test_ifdef.ml | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/experimental/frisch/ifdef.ml b/experimental/frisch/ifdef.ml index 1667360326..78278f71e8 100644 --- a/experimental/frisch/ifdef.ml +++ b/experimental/frisch/ifdef.ml @@ -27,8 +27,10 @@ let ifdef = else this # module_expr body_not_def - | {pmod_desc = Pmod_ident {txt = Lident "IFDEF"}} -> - failwith "Improper use of IFDEF" (* todo: location *) + | {pmod_desc = Pmod_ident {txt = Lident "IFDEF"}; pmod_loc = loc} -> + Format.printf "%a@.Improper use of IFDEF. The correct form is: IFDEF(<var_name:uident>)(<then:modtype>)(<body:modtype>)@." + Location.print_loc loc; + exit 2 | x -> super # module_expr x end diff --git a/experimental/frisch/test_ifdef.ml b/experimental/frisch/test_ifdef.ml index 77fe015682..18fdaf87a1 100644 --- a/experimental/frisch/test_ifdef.ml +++ b/experimental/frisch/test_ifdef.ml @@ -1,5 +1,7 @@ include IFDEF(XHOME)(struct let () = print_endline "Defined!" -end)(struct +end) +(*(struct let () = print_endline "Not defined!" end) +*) |