Skip to content

Commit

Permalink
Upgrade to OCaml 4.10 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate authored Feb 12, 2020
1 parent 69f8c67 commit 74fcf75
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ env:
- PACKAGE="ppx_tools"
- PRE_INSTALL_HOOK="cd /home/opam/opam-repository && git pull origin master && opam update -u -y"
matrix:
- DISTRO=ubuntu-16.04 OCAML_VERSION=4.08.0
- DISTRO=ubuntu-16.04 OCAML_VERSION=4.10.0+rc2 OCAML_BETA=enable
18 changes: 11 additions & 7 deletions ast_mapper_class.ml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ module CT = struct
(List.map (sub # class_type_field) pcsig_fields)
end

let map_functor_param sub = function
| Unit -> Unit
| Named (s, mt) -> Named (map_loc sub s, sub # module_type mt)

module MT = struct
(* Type expressions for the module language *)

Expand All @@ -173,10 +177,10 @@ module MT = struct
| Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
| Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
| Pmty_signature sg -> signature ~loc ~attrs (sub # signature sg)
| Pmty_functor (s, mt1, mt2) ->
functor_ ~loc ~attrs (map_loc sub s)
(map_opt (sub # module_type) mt1)
(sub # module_type mt2)
| Pmty_functor (param, mt) ->
functor_ ~loc ~attrs
(map_functor_param sub param)
(sub # module_type mt)
| Pmty_with (mt, l) ->
with_ ~loc ~attrs (sub # module_type mt)
(List.map (sub # with_constraint) l)
Expand Down Expand Up @@ -227,9 +231,9 @@ module M = struct
match desc with
| Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
| Pmod_structure str -> structure ~loc ~attrs (sub # structure str)
| Pmod_functor (arg, arg_ty, body) ->
functor_ ~loc ~attrs (map_loc sub arg)
(map_opt (sub # module_type) arg_ty)
| Pmod_functor (param, body) ->
functor_ ~loc ~attrs
(map_functor_param sub param)
(sub # module_expr body)
| Pmod_apply (m1, m2) ->
apply ~loc ~attrs (sub # module_expr m1) (sub # module_expr m2)
Expand Down
2 changes: 1 addition & 1 deletion genlifter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module Main : sig end = struct
if Hashtbl.mem printed ty then ()
else let tylid = Longident.parse ty in
let td =
try Env.find_type (Env.lookup_type tylid env) env
try snd (Env.find_type_by_name tylid env)
with Not_found ->
Format.eprintf "** Cannot resolve type %s@." ty;
exit 2
Expand Down
2 changes: 1 addition & 1 deletion ppx_tools.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ bug-reports: "https://github.com/ocaml-ppx/ppx_tools/issues"
dev-repo: "git://github.com/ocaml-ppx/ppx_tools.git"
build: ["dune" "build" "-p" name "-j" jobs]
depends: [
"ocaml" {>= "4.08.0"}
"ocaml" {>= "4.10.0"}
"dune" {>= "1.6"}
]

0 comments on commit 74fcf75

Please sign in to comment.