summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/process_file.ml b/src/process_file.ml
index b121c87c..d67fba76 100644
--- a/src/process_file.ml
+++ b/src/process_file.ml
@@ -275,8 +275,14 @@ let load_files ?check:(check=false) options type_envs files =
if !opt_memo_z3 then Constraint.load_digests () else ();
let t = Profile.start () in
- let ast = Parse_ast.Defs (List.map (fun f -> (f, parse_file f |> snd |> preprocess options)) files) in
+
+ let parsed_files = List.map (fun f -> (f, parse_file f)) files in
+
+ let comments = List.map (fun (f, (comments, _)) -> (f, comments)) parsed_files in
+ let ast = Parse_ast.Defs (List.map (fun (f, (_, file_ast)) -> (f, preprocess options file_ast)) parsed_files) in
let ast = Initial_check.process_ast ~generate:(not check) ast in
+ let ast = { ast with comments = comments } in
+
let () = if !opt_ddump_initial_ast then Pretty_print_sail.pp_ast stdout ast else () in
begin match !opt_reformat with