diff options
author | Son Ho | 2022-02-09 12:38:29 +0100 |
---|---|---|
committer | Son Ho | 2022-02-09 12:38:29 +0100 |
commit | fa5815de72b983bcbf87b4ec3e57d459632bb0d8 (patch) | |
tree | cfc76232ebbe841981e155c46c935bbb1f056e2c /src/Translate.ml | |
parent | b9dd3ed9b70246449ce1c856175d8f6ff28a6049 (diff) |
Add logging information
Diffstat (limited to 'src/Translate.ml')
-rw-r--r-- | src/Translate.ml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Translate.ml b/src/Translate.ml index 8d9c0270..7dab7a90 100644 --- a/src/Translate.ml +++ b/src/Translate.ml @@ -342,7 +342,7 @@ let translate_module (filename : string) (dest_dir : string) (config : config) (* Open the output file *) (* First compute the filename by replacing the extension and converting the * case (rust module names are snake case) *) - let module_name, extract_filename = + let module_name, extract_filebasename = match Filename.chop_suffix_opt ~suffix:".cfim" filename with | None -> (* Note that we already checked the suffix upon opening the file *) @@ -352,9 +352,11 @@ let translate_module (filename : string) (dest_dir : string) (config : config) let basename = Filename.basename filename in (* Convert the case *) let module_name = StringUtils.to_camel_case basename in - (* We add the extension for F* *) - (module_name, Filename.concat dest_dir (module_name ^ ".fst")) + (* Concatenate *) + (module_name, Filename.concat dest_dir module_name) in + (* Add the extension for F* *) + let extract_filename = extract_filebasename ^ ".fst" in let out = open_out extract_filename in let fmt = Format.formatter_of_out_channel out in @@ -471,4 +473,7 @@ let translate_module (filename : string) (dest_dir : string) (config : config) (* Close the box and end the formatting *) Format.pp_close_box fmt (); - Format.pp_print_newline fmt () + Format.pp_print_newline fmt (); + + (* Some logging *) + log#linfo (lazy ("Generated: " ^ extract_filename)) |