Skip to content

Commit a3a3f36

Browse files
Merge pull request #82 from thibautbenjamin/windows-compat
Windows compat
2 parents 5e20146 + ad97133 commit a3a3f36

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ result*
3535
/coq-plugin/theories/Loader.vok
3636
/coq-plugin/theories/Loader.vos
3737
catt-web.opam
38+
_opam/

lib/prover.ml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ let parse s =
2222
option '--no-builtins' to deactivate the use of built-ins"
2323
x)
2424

25-
let parse_file f =
26-
let sin =
27-
let fi = open_in f in
28-
let flen = in_channel_length fi in
29-
let buf = Bytes.create flen in
30-
really_input fi buf 0 flen;
31-
close_in fi;
32-
buf
25+
let read_file_to_string path =
26+
let rec read_stream stream =
27+
try
28+
let line = input_line stream in
29+
line :: (read_stream stream)
30+
with End_of_file ->
31+
[]
3332
in
34-
parse (Bytes.to_string sin)
33+
let stream = open_in path in
34+
String.concat "\n" (read_stream stream)
35+
36+
let parse_file f = parse (read_file_to_string f)
3537

3638
let reset () =
3739
Environment.reset ();

0 commit comments

Comments
 (0)