Skip to content

Commit

Permalink
Remove My_zip
Browse files Browse the repository at this point in the history
The module `My_Zip` contains only function which is called once in
`Solving_loop`. This commit cleans the code and move it in
`Solving_loop` directly. Technically, `Solving_loop` is a part of the
binary, but as everyone knows, most of the code of this module will be
push into the library after we design a good API.
  • Loading branch information
Halbaroth committed Oct 31, 2024
1 parent 5c84d11 commit 6b376ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 128 deletions.
11 changes: 10 additions & 1 deletion src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ let process_source ?selector_inst ~print_status src =
end
| `Stdin -> ()
in
let extract_zip_file f =
let cin = Zip.open_in f in
Fun.protect ~finally:(fun () -> Zip.close_in cin) @@ fun () ->
match Zip.entries cin with
| [e] when not @@ e.Zip.is_directory ->
Zip.read_entry cin e
| _ ->
fatal_error "the zip archive '%s' should contain exactly one file" f
in
(* Prepare the input source for Dolmen from an input source for Alt-Ergo. *)
let mk_files src =
let lang =
Expand All @@ -316,7 +325,7 @@ let process_source ?selector_inst ~print_status src =
let src =
match src with
| `File path when Filename.check_suffix path ".zip" ->
let content = AltErgoLib.My_zip.extract_zip_file path in
let content = extract_zip_file path in
`Raw (Filename.(chop_extension path |> basename), content)
| `File _ | `Raw _ | `Stdin -> src
in
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
; util
Emap Gc_debug Hconsing Hstring Heap Loc Numbers Uqueue
Options Timers Util Vec Version Steps Printer
My_zip My_list Theories Nest Compat
My_list Theories Nest Compat
)

(js_of_ocaml
Expand Down
78 changes: 0 additions & 78 deletions src/lib/util/my_zip.ml

This file was deleted.

48 changes: 0 additions & 48 deletions src/lib/util/my_zip.mli

This file was deleted.

0 comments on commit 6b376ed

Please sign in to comment.