Skip to content

Commit

Permalink
OCaml 4.12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Sep 6, 2020
1 parent b333879 commit d81f4a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler-stdlib/gen/gen.ml
Expand Up @@ -5,6 +5,7 @@ module Ocaml_version : sig

val v407 : t
val v408 : t
val v412 : t
val current : t
val compare : t -> t -> int
end = struct
Expand All @@ -26,6 +27,7 @@ end = struct

let v407 = parse "4.07"
let v408 = parse "4.08"
let v412 = parse "4.12"
let current = parse Sys.ocaml_version

let compare ((a1, b1) : t) ((a2, b2) : t) =
Expand Down Expand Up @@ -80,6 +82,10 @@ let () =
pr "module Result = struct end";
pr "module Unit = struct end";
pr "module Fun = struct end");
if Ocaml_version.(compare current v412) < 0
then (
pr "module Atomic = struct end";
pr "module Either = struct end");
pr "";
pr "exception Not_found = Not_found"
;;
2 changes: 2 additions & 0 deletions src/base.ml
Expand Up @@ -39,10 +39,12 @@ include (
end
(* Modules defined in Base *)
with module Array := Shadow_stdlib.Array
with module Atomic := Shadow_stdlib.Atomic
with module Bool := Shadow_stdlib.Bool
with module Buffer := Shadow_stdlib.Buffer
with module Bytes := Shadow_stdlib.Bytes
with module Char := Shadow_stdlib.Char
with module Either := Shadow_stdlib.Either
with module Float := Shadow_stdlib.Float
with module Hashtbl := Shadow_stdlib.Hashtbl
with module Int := Shadow_stdlib.Int
Expand Down
2 changes: 2 additions & 0 deletions src/import0.ml
Expand Up @@ -13,10 +13,12 @@ include (
with type ('a, 'b, 'c, 'd, 'e, 'f) format6 := ('a, 'b, 'c, 'd, 'e, 'f) format6
(* These modules are redefined in Base *)
with module Array := Shadow_stdlib.Array
with module Atomic := Shadow_stdlib.Atomic
with module Bool := Shadow_stdlib.Bool
with module Buffer := Shadow_stdlib.Buffer
with module Bytes := Shadow_stdlib.Bytes
with module Char := Shadow_stdlib.Char
with module Either := Shadow_stdlib.Either
with module Float := Shadow_stdlib.Float
with module Hashtbl := Shadow_stdlib.Hashtbl
with module Int := Shadow_stdlib.Int
Expand Down

0 comments on commit d81f4a0

Please sign in to comment.