Skip to content

Commit

Permalink
Merge pull request ocaml#3529 from rgrinberg/cram
Browse files Browse the repository at this point in the history
[cram] file generation
  • Loading branch information
rgrinberg authored Jun 26, 2020
2 parents c38df3d + d86d26f commit 47649a3
Show file tree
Hide file tree
Showing 18 changed files with 509 additions and 203 deletions.
8 changes: 4 additions & 4 deletions boot/duneboot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ end = struct
tmp_files := Files.empty;
Files.iter fns ~f:(fun fn -> try Sys.remove fn with _ -> ()))

let create prefix suffix =
let file prefix suffix =
let fn = Filename.temp_file prefix suffix in
tmp_files := Files.add fn !tmp_files;
fn

let destroy fn =
let destroy_file fn =
(try Sys.remove fn with _ -> ());
tmp_files := Files.remove fn !tmp_files
end
Expand Down Expand Up @@ -444,15 +444,15 @@ end = struct
done

let open_temp_file () =
let out = Temp.create "duneboot-" ".output" in
let out = Temp.file "duneboot-" ".output" in
let fd =
Unix.openfile out [ O_WRONLY; O_CREAT; O_TRUNC; O_SHARE_DELETE ] 0o666
in
(out, fd)

let read_temp fn =
let s = read_file fn in
Temp.destroy fn;
Temp.destroy_file fn;
s

let initial_cwd = Sys.getcwd ()
Expand Down
6 changes: 3 additions & 3 deletions otherlibs/cram/bin/cram_lexer.mli
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(** .t file parser *)

(** A command or comment. Output blocks are skipped *)
type block =
| Command of string list
type 'command block =
| Command of 'command
| Comment of string list

val block : Lexing.lexbuf -> block option
val block : Lexing.lexbuf -> string list block option
4 changes: 2 additions & 2 deletions otherlibs/cram/bin/cram_lexer.mll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
type block =
| Command of string list
type 'command block =
| Command of 'command
| Comment of string list
}

Expand Down
Loading

0 comments on commit 47649a3

Please sign in to comment.