copied from js_of_ocaml/toplevel/examples/lwt_toplevel

This commit is contained in:
cqc
2024-02-10 16:52:36 -06:00
commit 0f1fd67e8a
20 changed files with 1391 additions and 0 deletions

15
effects_flags.ml Normal file
View File

@ -0,0 +1,15 @@
let enable b n =
let f = if b then "--enable" else "--disable" in
[ f; n ]
let () =
let major = String.split_on_char '.' Sys.ocaml_version |> List.hd |> int_of_string in
let has_effect = major >= 5 in
let l = enable has_effect "effects" in
match Sys.argv |> Array.to_list |> List.tl with
| "txt" :: [] -> List.iter print_endline l
| "sexp" :: [] ->
print_endline "(";
List.iter print_endline l;
print_endline ")"
| _ -> assert false