diff options
author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-02-03 13:11:20 +0000 |
---|---|---|
committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-02-03 13:11:20 +0000 |
commit | 3a2a72f0b7bd8e858138678f1dbc614db4c48d52 (patch) | |
tree | 79e495f8d252684b51aff3214173b115f754a9c3 | |
parent | a463a1b0a6c848534756ea09e3d5aa1c0b138dee (diff) |
ocamlbuild: Improve a lexing error message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | ocamlbuild/configuration.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ocamlbuild/configuration.ml b/ocamlbuild/configuration.ml index 23e95963e..7a4f2f4fb 100644 --- a/ocamlbuild/configuration.ml +++ b/ocamlbuild/configuration.ml @@ -36,10 +36,12 @@ let parse_string s = add_config conf let parse_file ?dir file = - with_input_file file begin fun ic -> - let conf = Lexers.conf_lines dir 1 (Printf.sprintf "file: %S" file) (Lexing.from_channel ic) in - add_config conf - end + try + with_input_file file begin fun ic -> + let conf = Lexers.conf_lines dir 1 (Printf.sprintf "file: %S" file) (Lexing.from_channel ic) in + add_config conf + end + with Lexers.Error msg -> raise (Lexers.Error (file ^ ": " ^ msg)) let key_match = Glob.eval |