diff --git a/compiler/src/typed/cmi_format.re b/compiler/src/typed/cmi_format.re index f1f36f0316..1e2e377f33 100644 --- a/compiler/src/typed/cmi_format.re +++ b/compiler/src/typed/cmi_format.re @@ -20,7 +20,7 @@ open Wasm_utils; [@deriving (sexp, yojson)] type pers_flags = | Opaque - | Unsafe_string; + | Unsafe_string; type error = | Not_an_interface(string) @@ -102,22 +102,21 @@ let input_cmi = ic => | Result.Error(e) => raise(Invalid_argument(e)) }; -let deserialize_cmi = ic => size => { +let deserialize_cmi = (ic, size) => { let size = ref(size); - let lexbuf = Lexing.from_function (buf => n => { - let n = min (n, size^); - let read = input(ic, buf, 0, n); - size := size^ - read; - read - }); - let state = Yojson.init_lexer (); - switch ( - cmi_infos_of_yojson @@ Yojson.Safe.from_lexbuf(state, lexbuf) - ) { + let lexbuf = + Lexing.from_function((buf, n) => { + let n = min(n, size^); + let read = input(ic, buf, 0, n); + size := size^ - read; + read; + }); + let state = Yojson.init_lexer(); + switch (cmi_infos_of_yojson @@ Yojson.Safe.from_lexbuf(state, lexbuf)) { | Result.Ok(x) => x | Result.Error(e) => raise(Invalid_argument(e)) - } }; +}; let serialize_cmi = ( diff --git a/compiler/src/utils/wasm_utils.re b/compiler/src/utils/wasm_utils.re index 4ace57c18e..47bcef0b89 100644 --- a/compiler/src/utils/wasm_utils.re +++ b/compiler/src/utils/wasm_utils.re @@ -413,7 +413,7 @@ module type BinarySectionSpec = { type t; let name: string; - let deserialize: in_channel => int => t; + let deserialize: (in_channel, int) => t; let accepts_version: abi_version => bool; let serialize: t => bytes; }; diff --git a/compiler/src/utils/wasm_utils.rei b/compiler/src/utils/wasm_utils.rei index 8b0545c3a4..a5f3765df8 100644 --- a/compiler/src/utils/wasm_utils.rei +++ b/compiler/src/utils/wasm_utils.rei @@ -57,7 +57,7 @@ module type BinarySectionSpec = { type t; let name: string; - let deserialize: in_channel => int => t; + let deserialize: (in_channel, int) => t; let accepts_version: abi_version => bool; let serialize: t => bytes; };