build with trunk
This commit is contained in:
parent
c4bf0cc25e
commit
90ffbe737a
2
_tags
2
_tags
|
@ -3,5 +3,7 @@
|
||||||
<src/**/*.ml{,i}>: cppo_V_OCAML, package(compiler-libs)
|
<src/**/*.ml{,i}>: cppo_V_OCAML, package(compiler-libs)
|
||||||
<src/camlp5/**/*.ml{,i}>: use_camlp5
|
<src/camlp5/**/*.ml{,i}>: use_camlp5
|
||||||
|
|
||||||
|
<**/*.ml>: warn(-3-40)
|
||||||
|
|
||||||
# OASIS_START
|
# OASIS_START
|
||||||
# OASIS_STOP
|
# OASIS_STOP
|
||||||
|
|
|
@ -288,6 +288,12 @@ let with_loc loc str = {
|
||||||
Location.loc = loc;
|
Location.loc = loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OCAML_VERSION >= (4, 03, 0)
|
||||||
|
let nolabel = Asttypes.Nolabel
|
||||||
|
#else
|
||||||
|
let nolabel = ""
|
||||||
|
#endif
|
||||||
|
|
||||||
(* Check that the given phrase can be evaluated without typing/compile
|
(* Check that the given phrase can be evaluated without typing/compile
|
||||||
errors. *)
|
errors. *)
|
||||||
let check_phrase phrase =
|
let check_phrase phrase =
|
||||||
|
@ -342,7 +348,7 @@ let check_phrase phrase =
|
||||||
with_default_loc loc
|
with_default_loc loc
|
||||||
(fun () ->
|
(fun () ->
|
||||||
Str.eval
|
Str.eval
|
||||||
(Exp.fun_ "" None (Pat.construct unit None)
|
(Exp.fun_ nolabel None (Pat.construct unit None)
|
||||||
(Exp.letmodule (with_loc loc "_")
|
(Exp.letmodule (with_loc loc "_")
|
||||||
(Mod.structure (item :: items))
|
(Mod.structure (item :: items))
|
||||||
(Exp.construct unit None))))
|
(Exp.construct unit None))))
|
||||||
|
|
|
@ -737,12 +737,22 @@ let rec labels_of_type acc type_expr =
|
||||||
| Tpoly (te, _) ->
|
| Tpoly (te, _) ->
|
||||||
labels_of_type acc te
|
labels_of_type acc te
|
||||||
| Tarrow(label, _, te, _) ->
|
| Tarrow(label, _, te, _) ->
|
||||||
|
#if OCAML_VERSION < (4, 03, 0)
|
||||||
if label = "" then
|
if label = "" then
|
||||||
labels_of_type acc te
|
labels_of_type acc te
|
||||||
else if label.[0] = '?' then
|
else if label.[0] = '?' then
|
||||||
labels_of_type (String_map.add (String.sub label 1 (String.length label - 1)) Optional acc) te
|
labels_of_type (String_map.add (String.sub label 1 (String.length label - 1)) Optional acc) te
|
||||||
else
|
else
|
||||||
labels_of_type (String_map.add label Required acc) te
|
labels_of_type (String_map.add label Required acc) te
|
||||||
|
#else
|
||||||
|
(match label with
|
||||||
|
| Nolabel ->
|
||||||
|
labels_of_type acc te
|
||||||
|
| Optional label ->
|
||||||
|
labels_of_type (String_map.add label Optional acc) te
|
||||||
|
| Labelled label ->
|
||||||
|
labels_of_type (String_map.add label Required acc) te)
|
||||||
|
#endif
|
||||||
| Tconstr(path, _, _) -> begin
|
| Tconstr(path, _, _) -> begin
|
||||||
match lookup_env Env.find_type path !Toploop.toplevel_env with
|
match lookup_env Env.find_type path !Toploop.toplevel_env with
|
||||||
| None
|
| None
|
||||||
|
|
|
@ -283,6 +283,9 @@ let rec map_items unwrap wrap items =
|
||||||
| Outcometree.Osig_modtype (name, _)
|
| Outcometree.Osig_modtype (name, _)
|
||||||
| Outcometree.Osig_value (name, _, _) ->
|
| Outcometree.Osig_value (name, _, _) ->
|
||||||
(name, Outcometree.Orec_not)
|
(name, Outcometree.Orec_not)
|
||||||
|
#if OCAML_VERSION >= (4, 03, 0)
|
||||||
|
| Outcometree.Osig_ellipsis -> ("", Outcometree.Orec_not)
|
||||||
|
#endif
|
||||||
in
|
in
|
||||||
let keep = name = "" || name.[0] <> '_' in
|
let keep = name = "" || name.[0] <> '_' in
|
||||||
if keep then
|
if keep then
|
||||||
|
@ -320,6 +323,9 @@ let rec map_items unwrap wrap items =
|
||||||
| Outcometree.Osig_typext _
|
| Outcometree.Osig_typext _
|
||||||
#else
|
#else
|
||||||
| Outcometree.Osig_exception _
|
| Outcometree.Osig_exception _
|
||||||
|
#endif
|
||||||
|
#if OCAML_VERSION >= (4, 03, 0)
|
||||||
|
| Outcometree.Osig_ellipsis
|
||||||
#endif
|
#endif
|
||||||
| Outcometree.Osig_modtype _
|
| Outcometree.Osig_modtype _
|
||||||
| Outcometree.Osig_value _ ->
|
| Outcometree.Osig_value _ ->
|
||||||
|
@ -393,6 +399,12 @@ let wrap_unit loc e =
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OCAML_VERSION >= (4, 03, 0)
|
||||||
|
let nolabel = Asttypes.Nolabel
|
||||||
|
#else
|
||||||
|
let nolabel = ""
|
||||||
|
#endif
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
(* Rewrite Lwt.t expressions to Lwt_main.run <expr> *)
|
(* Rewrite Lwt.t expressions to Lwt_main.run <expr> *)
|
||||||
Hashtbl.add rewrite_rules (Longident.Ldot (Longident.Lident "Lwt", "t")) {
|
Hashtbl.add rewrite_rules (Longident.Ldot (Longident.Lident "Lwt", "t")) {
|
||||||
|
@ -408,7 +420,7 @@ let () =
|
||||||
#else
|
#else
|
||||||
let open Ast_helper in
|
let open Ast_helper in
|
||||||
with_default_loc loc (fun () ->
|
with_default_loc loc (fun () ->
|
||||||
Exp.apply (Exp.ident (with_loc loc longident_lwt_main_run)) [("", e)]
|
Exp.apply (Exp.ident (with_loc loc longident_lwt_main_run)) [(nolabel, e)]
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
@ -434,7 +446,7 @@ let () =
|
||||||
with_default_loc loc (fun () ->
|
with_default_loc loc (fun () ->
|
||||||
Exp.apply
|
Exp.apply
|
||||||
(Exp.ident (with_loc loc longident_async_thread_safe_block_on_async_exn))
|
(Exp.ident (with_loc loc longident_async_thread_safe_block_on_async_exn))
|
||||||
[("", Exp.fun_ "" None punit e)]
|
[(nolabel, Exp.fun_ nolabel None punit e)]
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue