diff options
Diffstat (limited to 'cparser/Parse.ml')
-rw-r--r-- | cparser/Parse.ml | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml index ecd13332..8665e158 100644 --- a/cparser/Parse.ml +++ b/cparser/Parse.ml @@ -46,7 +46,7 @@ let read_file sourcefile = text let preprocessed_file transfs name sourcefile = - Cerrors.reset(); + Diagnostics.reset(); (* Reading the whole file at once may seem costly, but seems to be the simplest / most robust way of accessing the text underlying a range of positions. This is used when printing an error message. @@ -55,7 +55,6 @@ let preprocessed_file transfs name sourcefile = on my machine. *) let text = read_file sourcefile in let p = - try let t = parse_transformations transfs in let rec inf = Datatypes.S inf in let ast : Cabs.definition list = @@ -70,13 +69,11 @@ let preprocessed_file transfs name sourcefile = | Parser.Parser.Inter.Fail_pr -> (* Theoretically impossible : implies inconsistencies between grammars. *) - Cerrors.fatal_error Cutil.no_loc "Internal error while parsing" + Diagnostics.fatal_error Diagnostics.no_loc "Internal error while parsing" | Parser.Parser.Inter.Timeout_pr -> assert false | Parser.Parser.Inter.Parsed_pr (ast, _ ) -> ast) in let p1 = Timing.time "Elaboration" Elab.elab_file ast in - Cerrors.raise_on_errors (); - Timing.time2 "Emulations" transform_program t p1 name - with - | Cerrors.Abort -> - [] in - if Cerrors.check_errors() then None else Some p + Diagnostics.check_errors (); + Timing.time2 "Emulations" transform_program t p1 name in + Diagnostics.check_errors(); + p |