Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OCaml 4.13 #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions metaquot/metaquot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ let quote_of_path (path : Path.t) : Ppxlib.expression =
let name =
match Untypeast.lident_of_path path with
| Lident name | Ldot (Lident "Asttypes", name) -> name
| Ldot (Lident "Location", "t") -> "location"
| Ldot (Lident "Longident", "t") -> "longident"
| Ldot (Lident "Location", "t") (* ppxlib < 0.23.0 *)
| Ldot (Ldot (Lident "Astlib__", "Location"), "t") -> (* ppxlib >= 0.23.0 *)
"location"
| Ldot (Lident "Longident", "t") (* ppxlib < 0.23.0 *)
| Ldot (Ldot (Lident "Astlib__", "Longident"), "t") -> (* ppxlib >= 0.23.0 *)
"longident"
| lident ->
failwith (Format.asprintf "quote_of_path: %s"
(String.concat "." (Longident.flatten lident))) in
Expand Down Expand Up @@ -243,7 +247,7 @@ let quote_of_declaration (prefix : Longident.t) (name : string)
(Metapp.apply
(quote_of_type_expr (Option.get declaration.type_manifest))
[Metapp.Exp.var "x"])]
| Type_variant ctors ->
| Type_variant (ctors, _) ->
List.map (case_of_ctor prefix) ctors
| Type_record (labels, _) ->
[quote_of_record prefix labels]
Expand Down
3 changes: 1 addition & 2 deletions ppx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
(ppx_runtime_libraries compiler-libs)
; -warning 40: Constructor or label name used out of scope. (OCaml <=4.06.0)
(flags -w -40)
(libraries ocaml-migrate-parsetree compiler-libs metapp stdcompat
metaquot))
(libraries compiler-libs metapp stdcompat metaquot))
2 changes: 1 addition & 1 deletion tests/for/for_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ let () =
| { pstr_desc = Pstr_type (Recursive, [
{ ptype_name = { txt = "t1"; _ }; _};
{ ptype_name = { txt = "t2"; _ }; _};
{ ptype_name = { txt = "t3"; _ }; _}])} -> ()
{ ptype_name = { txt = "t3"; _ }; _}]); _} -> ()
| _ -> assert false