@@ -60,10 +60,8 @@ module Compat = struct
6060 let concr_mem = Types.Meths. mem
6161 let csig_concr x = x.Types. csig_meths
6262 let eq_type = Types. eq_type
63- #if OCAML_VERSION > = (5 ,4 ,0 )
63+ #if OCAML_VERSION > = (5 ,4 ,0 ) || defined OXCAML
6464 let invisible_wrap ty = newty2 ~level: Btype. generic_level (Ttuple [None ,ty])
65- #elif OCAML_VERSION = (5 ,2 ,0 )
66- let invisible_wrap ty = newty2 ~level: Btype. generic_level (Ttuple [None , ty])
6765#else
6866 let invisible_wrap ty = newty2 ~level: Btype. generic_level (Ttuple [ty])
6967#endif
@@ -241,12 +239,12 @@ let mark_type ty =
241239 | Tarrow (_ , ty1 , ty2 , _ ) ->
242240 loop visited ty1;
243241 loop visited ty2
244- #if OCAML_VERSION > = (5 ,4 ,0 ) || OCAML_VERSION = ( 5 , 2 , 0 )
242+ #if OCAML_VERSION > = (5 ,4 ,0 ) || defined OXCAML
245243 | Ttuple tyl -> List. iter (fun (_lbl ,x ) -> loop visited x) tyl
246244#else
247245 | Ttuple tyl -> List. iter (loop visited) tyl
248246#endif
249- #if OCAML_VERSION = ( 5 , 2 , 0 )
247+ #if defined OXCAML
250248 | Tunboxed_tuple tyl -> List. iter (fun (_ , ty ) -> loop visited ty) tyl
251249#endif
252250 | Tconstr (_ , tyl , _ ) ->
@@ -285,7 +283,7 @@ let mark_type ty =
285283 | Tpoly (ty , tyl ) ->
286284 List. iter (fun t -> add_alias t) tyl;
287285 loop visited ty
288- #if OCAML_VERSION = ( 5 , 2 , 0 )
286+ #if defined OXCAML
289287 | Tunivar { name; _ } -> reserve_name name
290288#else
291289 | Tunivar name -> reserve_name name
@@ -305,7 +303,7 @@ let mark_type ty =
305303#else
306304 | Tsubst (ty ,_ ) -> loop visited ty
307305#endif
308- #if OCAML_VERSION = ( 5 , 2 , 0 )
306+ #if defined OXCAML
309307 | Tquote typ -> loop visited typ
310308 | Tsplice typ -> loop visited typ
311309#endif
@@ -504,13 +502,13 @@ let rec read_type_expr env typ =
504502 let res = read_type_expr env res in
505503 Arrow (lbl, arg, res)
506504 | Ttuple typs ->
507- #if OCAML_VERSION > = (5 ,4 ,0 ) || OCAML_VERSION = ( 5 , 2 , 0 )
505+ #if OCAML_VERSION > = (5 ,4 ,0 ) || defined OXCAML
508506 let typs = List. map (fun (lbl ,x ) -> lbl, read_type_expr env x) typs in
509507#else
510508 let typs = List. map (fun x -> None , read_type_expr env x) typs in
511509#endif
512510 Tuple typs
513- #if OCAML_VERSION = ( 5 , 2 , 0 )
511+ #if defined OXCAML
514512 | Tunboxed_tuple typs ->
515513 let typs = List. map (fun (l ,t ) -> l, read_type_expr env t) typs in
516514 Unboxed_tuple typs
@@ -556,7 +554,7 @@ let rec read_type_expr env typ =
556554#else
557555 | Tsubst (typ ,_ ) -> read_type_expr env typ
558556#endif
559- #if OCAML_VERSION = ( 5 , 2 , 0 )
557+ #if defined OXCAML
560558 | Tquote typ -> Quote (read_type_expr env typ)
561559 | Tsplice typ -> Splice (read_type_expr env typ)
562560#endif
@@ -685,7 +683,7 @@ let read_value_description ({ident_env ; warnings_tag} as env) parent id vd =
685683 let type_ = read_type_expr env vd.val_type in
686684 let value =
687685 match vd.val_kind with
688- #if OCAML_VERSION = ( 5 , 2 , 0 )
686+ #if defined OXCAML
689687 | Val_reg _ -> Value. Abstract
690688#else
691689 | Val_reg -> Value. Abstract
0 commit comments