Skip to content

Commit

Permalink
missing-file
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Sep 19, 2024
1 parent 90aa8a7 commit f970d94
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions compiler/tests-dynlink-js/effects_flags.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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 l =
match l with
| [ "using-effects" ] -> major >= 5
| _ -> false
in
let aux l = enable (has_effect l) "effects" in
match Sys.argv |> Array.to_list |> List.tl with
| "txt" :: rest -> List.iter print_endline (aux rest)
| "sexp" :: rest ->
print_endline "(";
List.iter print_endline (aux rest);
print_endline ")"
| _ -> assert false

0 comments on commit f970d94

Please sign in to comment.