Make error reporting slightly more regular.

This commit is contained in:
Graydon Hoare 2010-08-24 09:58:26 -07:00
parent 14262c7311
commit 10316fbfa5
2 changed files with 4 additions and 3 deletions

View file

@ -109,7 +109,7 @@ let report_err sess ido str =
in
match spano with
None ->
fail sess "Error: %s\n%!" str
fail sess "error: %s\n%!" str
| Some span ->
fail sess "%s: error: %s\n%!"
(string_of_span span) str

View file

@ -602,10 +602,11 @@ let with_err_handling sess thunk =
thunk ()
with
Parse_err (ps, str) ->
Session.fail sess "Parse error: %s\n%!" str;
Session.fail sess "%s: error: %s\n%!"
(Session.string_of_pos (lexpos ps)) str;
List.iter
(fun (cx,pos) ->
Session.fail sess "%s:E (parse context): %s\n%!"
Session.fail sess "%s: (parse context): %s\n%!"
(Session.string_of_pos pos) cx)
ps.pstate_ctxt;
let apos = lexpos ps in