Fix generation of the alias module with 4.02 (#549)

This commit is contained in:
Jérémie Dimino 2018-02-25 12:58:40 +00:00 committed by GitHub
parent fbafb3d47a
commit 4cf7dc558b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,10 @@
1.0+beta18 (25/02/2018)
-----------------------
- Fix generation of the implicit alias module with 4.02. With 4.02 it
must have an implementation while with OCaml >= 4.03 it can be an
interface only module (#549)
- Let the parser distinguish quoted strings from atoms. This makes
possible to use "${v}" to concatenate the list of values provided by
a split-variable. Concatenating split-variables with text is also

View File

@ -321,12 +321,18 @@ module Gen(P : Params) = struct
String_map.mem main_module_name modules) then
None
else if String_map.mem main_module_name modules then
let file ext =
Some { Module.File.
name = sprintf "%s__%s-gen" lib.name ext
; syntax = OCaml
}
in
(* The tests don't pass with 4.02 if we don't do that *)
let needs_impl = ctx.version < (4, 03, 0) in
Some
{ Module.name = main_module_name ^ "__"
; impl = None
; intf = Some { name = lib.name ^ "__.mli-gen"
; syntax = OCaml
}
; impl = if needs_impl then file ".ml" else None
; intf = if not needs_impl then file ".mli" else None
; obj_name = lib.name ^ "__"
}
else

View File

@ -49,7 +49,7 @@
(alias
((name runtest)
(deps (path.mlt
(glob_files ${SCOPE_ROOT}/src/*.cmi)
(glob_files ${SCOPE_ROOT}/src/.jbuilder.objs/*.cmi)
(glob_files ${SCOPE_ROOT}/vendor/re/*.cmi)))
(action (chdir ${SCOPE_ROOT}
(progn