Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Oct 24, 2023
1 parent 4c58844 commit edcf68b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions compiler/src/typed/cmi_format.re
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open Wasm_utils;
[@deriving (sexp, yojson)]
type pers_flags =
| Opaque
| Unsafe_string;
| Unsafe_string;

type error =
| Not_an_interface(string)
Expand Down 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 edcf68b

Please sign in to comment.