Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Feb 22, 2024
1 parent 1a21ca9 commit aaa41db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions compiler/src/typed/cmi_format.re
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/utils/wasm_utils.re
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/utils/wasm_utils.rei
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit aaa41db

Please sign in to comment.