-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fix #203 Port to ppxlib - continuation of #206 #210
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,10 @@ depends: [ | |
"ppxfind" {build} | ||
"ocaml-migrate-parsetree" | ||
"ppx_derivers" | ||
"ppxlib" {>= "0.9.0"} | ||
"ppxlib" {>= "0.9.0"} | ||
"result" | ||
"ounit" {with-test} | ||
"ocaml" {>= "4.04.1"} | ||
"ounit" {with-test} | ||
"ocaml" {>= "4.05.0"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why should we reject OCaml 4.04? The current code looks actually to work fine on 4.04 (even on 4.04.0). Anyway, if we want to constrain users to use OCaml 4.05, I think we should update the synopsis as well. |
||
] | ||
synopsis: "Type-driven code generation for OCaml >=4.04.1" | ||
description: """ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ open Parsetree | |
open Ast_helper | ||
open Ppx_deriving.Ast_convenience | ||
|
||
#if OCAML_VERSION < (4, 08, 0) | ||
module Stdlib = Pervasives | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we want to get rid of cppo, we could instead add the following binding at the beginning of the module: let stdlib_compare = compare There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this one could also depend on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree on moving to stdlib-shims. It will solve this particular |
||
|
||
let deriver = "enum" | ||
let raise_errorf = Ppx_deriving.raise_errorf | ||
|
||
|
@@ -71,7 +75,7 @@ let mappings_of_type type_decl = | |
| _ :: rest -> check_dup rest | ||
| [] -> () | ||
in | ||
mappings |> List.stable_sort (fun (a,_) (b,_) -> compare a b) |> check_dup; | ||
mappings |> List.stable_sort (fun (a,_) (b,_) -> Stdlib.compare a b) |> check_dup; | ||
kind, mappings | ||
|
||
let str_of_type ~options ~path ({ ptype_loc = loc } as type_decl) = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could maintain compatibility with OCaml 4.04 (see below).