build with trunk

This commit is contained in:
Jeremie Dimino 2015-03-18 16:47:29 +00:00
parent c4bf0cc25e
commit 90ffbe737a
4 changed files with 33 additions and 3 deletions

2
_tags
View File

@ -3,5 +3,7 @@
<src/**/*.ml{,i}>: cppo_V_OCAML, package(compiler-libs)
<src/camlp5/**/*.ml{,i}>: use_camlp5
<**/*.ml>: warn(-3-40)
# OASIS_START
# OASIS_STOP

View File

@ -288,6 +288,12 @@ let with_loc loc str = {
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
errors. *)
let check_phrase phrase =
@ -342,7 +348,7 @@ let check_phrase phrase =
with_default_loc loc
(fun () ->
Str.eval
(Exp.fun_ "" None (Pat.construct unit None)
(Exp.fun_ nolabel None (Pat.construct unit None)
(Exp.letmodule (with_loc loc "_")
(Mod.structure (item :: items))
(Exp.construct unit None))))

View File

@ -737,12 +737,22 @@ let rec labels_of_type acc type_expr =
| Tpoly (te, _) ->
labels_of_type acc te
| Tarrow(label, _, te, _) ->
#if OCAML_VERSION < (4, 03, 0)
if label = "" then
labels_of_type acc te
else if label.[0] = '?' then
labels_of_type (String_map.add (String.sub label 1 (String.length label - 1)) Optional acc) te
else
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
match lookup_env Env.find_type path !Toploop.toplevel_env with
| None

View File

@ -283,6 +283,9 @@ let rec map_items unwrap wrap items =
| Outcometree.Osig_modtype (name, _)
| Outcometree.Osig_value (name, _, _) ->
(name, Outcometree.Orec_not)
#if OCAML_VERSION >= (4, 03, 0)
| Outcometree.Osig_ellipsis -> ("", Outcometree.Orec_not)
#endif
in
let keep = name = "" || name.[0] <> '_' in
if keep then
@ -320,6 +323,9 @@ let rec map_items unwrap wrap items =
| Outcometree.Osig_typext _
#else
| Outcometree.Osig_exception _
#endif
#if OCAML_VERSION >= (4, 03, 0)
| Outcometree.Osig_ellipsis
#endif
| Outcometree.Osig_modtype _
| Outcometree.Osig_value _ ->
@ -393,6 +399,12 @@ let wrap_unit loc e =
}
#endif
#if OCAML_VERSION >= (4, 03, 0)
let nolabel = Asttypes.Nolabel
#else
let nolabel = ""
#endif
let () =
(* Rewrite Lwt.t expressions to Lwt_main.run <expr> *)
Hashtbl.add rewrite_rules (Longident.Ldot (Longident.Lident "Lwt", "t")) {
@ -408,7 +420,7 @@ let () =
#else
let open Ast_helper in
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
);
@ -434,7 +446,7 @@ let () =
with_default_loc loc (fun () ->
Exp.apply
(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
);