diff --git a/src/ocaml/compression/dune b/src/ocaml/compression/dune new file mode 100644 index 0000000000..86c7f02108 --- /dev/null +++ b/src/ocaml/compression/dune @@ -0,0 +1,4 @@ +(library + (name ocaml_compression) + (public_name merlin-lib.ocaml_compression) + (libraries compiler-libs.common)) diff --git a/src/ocaml/compression/ocaml_compression.ml b/src/ocaml/compression/ocaml_compression.ml new file mode 100644 index 0000000000..464aa32bd3 --- /dev/null +++ b/src/ocaml/compression/ocaml_compression.ml @@ -0,0 +1,3 @@ + +(** We rely on [compiler-libs] for compression *) +include Compression diff --git a/src/ocaml/typing/cmi_format.ml b/src/ocaml/typing/cmi_format.ml index 01e27b7cd5..b4934e27e7 100644 --- a/src/ocaml/typing/cmi_format.ml +++ b/src/ocaml/typing/cmi_format.ml @@ -35,7 +35,7 @@ type cmi_infos = { } let input_cmi ic = - let (name, sign) = (input_value ic : header) in + let (name, sign) = (Ocaml_compression.input_value ic : header) in let crcs = (input_value ic : crcs) in let flags = (input_value ic : flags) in { @@ -76,7 +76,7 @@ let read_cmi filename = let output_cmi filename oc cmi = (* beware: the provided signature must have been substituted for saving *) output_string oc Config.cmi_magic_number; - output_value oc ((cmi.cmi_name, cmi.cmi_sign) : header); + Ocaml_compression.output_value oc ((cmi.cmi_name, cmi.cmi_sign) : header); flush oc; let crc = Digest.file filename in let crcs = (cmi.cmi_name, Some crc) :: cmi.cmi_crcs in diff --git a/src/ocaml/typing/cmt_format.ml b/src/ocaml/typing/cmt_format.ml index 49a629879f..6fbc314f0a 100644 --- a/src/ocaml/typing/cmt_format.ml +++ b/src/ocaml/typing/cmt_format.ml @@ -121,11 +121,11 @@ let clear_env binary_annots = exception Error of error -let input_cmt ic = (input_value ic : cmt_infos) +let input_cmt ic = (Ocaml_compression.input_value ic : cmt_infos) let output_cmt oc cmt = output_string oc Config.cmt_magic_number; - output_value oc (cmt : cmt_infos) + Ocaml_compression.output_value oc (cmt : cmt_infos) let read filename = (* Printf.fprintf stderr "Cmt_format.read %s\n%!" filename; *) diff --git a/src/ocaml/typing/dune b/src/ocaml/typing/dune index bebe62fbb2..132d16157e 100644 --- a/src/ocaml/typing/dune +++ b/src/ocaml/typing/dune @@ -7,4 +7,4 @@ -open Merlin_utils (:standard -w -9)) (modules_without_implementation annot outcometree) - (libraries merlin_utils ocaml_parsing ocaml_utils)) + (libraries merlin_utils ocaml_compression ocaml_parsing ocaml_utils))