Skip to content

Commit

Permalink
Merge pull request #63 from tatchi/ocaml-4.13.x
Browse files Browse the repository at this point in the history
add support for OCaml 4.13
  • Loading branch information
ejgallego authored Jan 11, 2022
2 parents 1654b00 + 1f1c169 commit e38d184
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
- 4.10.0
- 4.11.1
- 4.12.0
- 4.13.0
- 4.13.1

runs-on: ${{ matrix.os }}

Expand Down
1 change: 1 addition & 0 deletions src/compat/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let make_version ~version f_prefix =
let include_table =
[ ("types_module_type", [(4, 10); (4, 8)])
; ("types_signature_item", [(4, 8)])
; ("types_type_kind", [(4, 13)])
; ("init_path", [(4, 9)])
; ("env_lookup", [(4, 10)]) ]

Expand Down
3 changes: 3 additions & 0 deletions src/compat/types_type_kind_ge_000.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type type_kind_412 = Types.type_kind

let migrate_type_kind : Types.type_kind -> type_kind_412 = fun x -> x
11 changes: 11 additions & 0 deletions src/compat/types_type_kind_ge_413.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type ('lbl, 'cstr) type_kind_412 =
| Type_abstract
| Type_record of 'lbl list * Types.record_representation
| Type_variant of 'cstr list
| Type_open

let migrate_type_kind : ('lbl, 'cstr) Types.type_kind -> ('lbl, 'cstr) type_kind_412 = function
| Type_abstract -> Type_abstract
| Type_record (lbl, repr) -> Type_record (lbl, repr)
| Type_variant (cstr, _) -> Type_variant cstr
| Type_open -> Type_open
2 changes: 1 addition & 1 deletion src/ppx_import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ let ptype_decl_of_ttype_decl ~manifest ~subst ptype_name
; pld_attributes = Tt.copy_attributes ld.ld_attributes })
in
Ppxlib.(
match ttype_decl.type_kind with
match Compat.migrate_type_kind ttype_decl.type_kind with
| Type_abstract -> Ptype_abstract
| Type_open -> Ptype_open
| Type_record (labels, _) -> Ptype_record (map_labels labels)
Expand Down

0 comments on commit e38d184

Please sign in to comment.