Support upcoming ppxlib (was "ppx_base") (#554)

This commit is contained in:
Xavier Clerc 2018-02-27 12:56:47 +00:00 committed by Jérémie Dimino
parent ebce85137d
commit c324736d11
2 changed files with 6 additions and 2 deletions

View File

@ -1082,7 +1082,11 @@ module Gen(P : Params) = struct
if List.exists deps ~f:(function
| "ppx_driver" | "ppx_type_conv" -> true
| _ -> false) then
pps @ [(Loc.none, Pp.of_string "ppx_driver.runner")]
pps @ [match Scope.name scope with
| Some "ppxlib" ->
Loc.none, Pp.of_string "ppxlib.runner"
| _ ->
Loc.none, Pp.of_string "ppx_driver.runner"]
else
pps
in

View File

@ -926,7 +926,7 @@ module PP = struct
let uses_ppx_driver ~pps =
match (List.last pps : (_ * Pp.t) option :> (_ * string) option) with
| Some (_, "ppx_driver.runner") -> true
| Some (_, ("ppx_driver.runner" | "ppxlib.runner")) -> true
| Some _ | None -> false
let promote_correction ~uses_ppx_driver fn build =