Better error report.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12654 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
8531a5c8ee
commit
9d32d89108
|
@ -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
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
include IFDEF(XHOME)(struct
|
||||
let () = print_endline "Defined!"
|
||||
end)(struct
|
||||
end)
|
||||
(*(struct
|
||||
let () = print_endline "Not defined!"
|
||||
end)
|
||||
*)
|
||||
|
|
Loading…
Reference in New Issue