-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation with different versions of OCaml
- Loading branch information
Showing
8 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
(*BEGIN LETOP*) | ||
let (let$) : 'a Lwd.t -> ('a -> 'b) -> 'b Lwd.t = Lwd.Infix.(>|=) | ||
let (and$) : 'a Lwd.t -> 'b Lwd.t -> ('a * 'b) Lwd.t = Lwd.pair | ||
let (let$*) : 'a Lwd.t -> ('a -> 'b Lwd.t) -> 'b Lwd.t = Lwd.Infix.(>>=) | ||
(*END*) | ||
|
||
let ($=) : 'a Lwd.var -> 'a -> unit = Lwd.set | ||
let ($<-) : 'a Lwd_table.row -> 'a -> unit = Lwd_table.set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
let version = | ||
Scanf.sscanf Sys.ocaml_version "%d.%d" (fun major minor -> (major, minor)) | ||
|
||
let ic = | ||
if Array.length Sys.argv = 1 then ( | ||
Printf.eprintf | ||
"Usage: %s <input-file>\n\ | ||
Expecting a filename as argument.\n" | ||
Sys.argv.(0); | ||
exit 1 | ||
) else if not (Sys.file_exists Sys.argv.(1)) then ( | ||
Printf.eprintf | ||
"Usage: %s <input-file>\n\ | ||
Cannot find file %S.\n" | ||
Sys.argv.(0) | ||
Sys.argv.(1); | ||
exit 1 | ||
) else | ||
open_in_bin Sys.argv.(1) | ||
|
||
let () = | ||
let enable_output = ref true in | ||
let change_output v = | ||
print_newline (); | ||
enable_output := v | ||
in | ||
try | ||
while true do | ||
match input_line ic with | ||
| "(*BEGIN LETOP*)" -> change_output (version >= (4, 08)) | ||
| "(*BEGIN INJECTIVITY*)" -> change_output (version >= (4, 12)) | ||
| "(*ELSE*)" -> change_output (not !enable_output) | ||
| "(*END*)" -> change_output true | ||
| line -> if !enable_output then print_endline line | ||
done | ||
with End_of_file -> () |