diff options
-rw-r--r-- | lib/lib.mllib | 2 | ||||
-rw-r--r-- | tools/coqdep_common.ml | 14 | ||||
-rw-r--r-- | tools/coqdep_lexer.mll | 6 |
3 files changed, 17 insertions, 5 deletions
diff --git a/lib/lib.mllib b/lib/lib.mllib index b5db04d21..c3982a8c9 100644 --- a/lib/lib.mllib +++ b/lib/lib.mllib @@ -15,7 +15,7 @@ Gmap Fset Fmap Tlm -tries +Tries Gmapl Profile Explore diff --git a/tools/coqdep_common.ml b/tools/coqdep_common.ml index 295b7c519..797c25ccc 100644 --- a/tools/coqdep_common.ml +++ b/tools/coqdep_common.ml @@ -190,7 +190,11 @@ let soustraite_fichier_ML dep md ext = a_faire_opt := !a_faire_opt ^ opt) (List.rev list); (!a_faire, !a_faire_opt) - with Sys_error _ -> ("","") + with + | Sys_error _ -> ("","") + | _ -> + Printf.eprintf "Coqdep: subprocess %s failed on file %s%s\n" dep md ext; + exit 1 let autotraite_fichier_ML md ext = try @@ -236,7 +240,13 @@ let traite_fichier_mllib md ext = a_faire_opt := !a_faire_opt^" "^file^".cmx" | None -> ()) list; (!a_faire, !a_faire_opt) - with Sys_error _ -> ("","") + with + | Sys_error _ -> ("","") + | Syntax_error (i,j) -> + Printf.eprintf "File \"%s%s\", characters %i-%i:\nError: Syntax error\n" + md ext i j; + exit 1 + (* Makefile's escaping rules are awful: $ is escaped by doubling and other special characters are escaped by backslash prefixing while diff --git a/tools/coqdep_lexer.mll b/tools/coqdep_lexer.mll index 0e7467eb0..09433ff76 100644 --- a/tools/coqdep_lexer.mll +++ b/tools/coqdep_lexer.mll @@ -24,6 +24,7 @@ let comment_depth = ref 0 exception Fin_fichier + exception Syntax_error of int*int let module_current_name = ref [] let module_names = ref [] @@ -221,12 +222,13 @@ and qual_id = parse | _ { caml_action lexbuf } and mllib_list = parse - | coq_ident { let s = String.uncapitalize (Lexing.lexeme lexbuf) + | caml_up_ident { let s = String.uncapitalize (Lexing.lexeme lexbuf) in s :: mllib_list lexbuf } | "*predef*" { mllib_list lexbuf } | space+ { mllib_list lexbuf } | eof { [] } + | _ { raise (Syntax_error (Lexing.lexeme_start lexbuf, + Lexing.lexeme_end lexbuf)) } and ocamldep_parse = parse | [^ ':' ]* ':' { mllib_list lexbuf } - | _ { [] } |