Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read_cma #9

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocaml-compiler-libs.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml" {>= "4.04.1"}
"ocaml" {>= "5.2.0"}
"dune" {>= "1.5.1"}
]
synopsis: """OCaml compiler libraries repackaged"""
Expand Down
4 changes: 3 additions & 1 deletion src/read_cma/read_cma.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
open StdLabels

let compunit_name Cmo_format.{ cu_name = Compunit name ; _ } = name

let units fn =
(* The cma format is documented in typing/cmo_format.mli in the compiler sources *)
let ic = open_in_bin fn in
Expand All @@ -11,5 +13,5 @@ let units fn =
let toc = (input_value ic : Cmo_format.library) in
close_in ic;

List.map toc.lib_units ~f:(fun cu -> cu.Cmo_format.cu_name)
List.map toc.lib_units ~f:compunit_name
|> List.sort ~cmp:String.compare