From 1017f4533d9461e21b40e9aa8554390b48508b99 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Mon, 16 Dec 2019 18:37:55 +0800 Subject: [PATCH] Some fixes --- .travis.yml | 4 +--- ppx_deriving.opam | 5 ++--- src/api/ppx_deriving.cppo.ml | 9 ++++----- src_test/api/test_api.cppo.ml | 4 ---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index f46a0a35..b3a7484a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,10 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.t script: bash -ex .travis-opam.sh env: matrix: - - OCAML_VERSION=4.02 # we require >=4.02.2 but this picks 4.02.3 - - OCAML_VERSION=4.03 - - OCAML_VERSION=4.04 - OCAML_VERSION=4.05 - OCAML_VERSION=4.06 - OCAML_VERSION=4.07 - OCAML_VERSION=4.08 + - OCAML_VERSION=4.09 os: - linux diff --git a/ppx_deriving.opam b/ppx_deriving.opam index 3529c337..3ae82b40 100644 --- a/ppx_deriving.opam +++ b/ppx_deriving.opam @@ -14,15 +14,14 @@ build: [ ["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc} ] depends: [ - "dune" {build >= "1.6.3"} - "cppo" {build} + "dune" { >= "1.6.3"} "ppxfind" {build} "ocaml-migrate-parsetree" "ppx_derivers" "ppxlib" {>= "0.9.0"} "result" "ounit" {with-test} - "ocaml" {>= "4.04.1"} + "ocaml" {>= "4.05.0"} ] synopsis: "Type-driven code generation for OCaml >=4.04.1" description: """ diff --git a/src/api/ppx_deriving.cppo.ml b/src/api/ppx_deriving.cppo.ml index f51923b4..40b695b9 100644 --- a/src/api/ppx_deriving.cppo.ml +++ b/src/api/ppx_deriving.cppo.ml @@ -1,9 +1,5 @@ open Ppxlib -#define Attribute_expr(loc_, txt_, payload) { attr_name = \ - { txt = txt_; loc = loc_ }; \ - attr_payload = payload; \ - attr_loc = loc_ } #define Attribute_patt(loc_, txt_, payload) { attr_name = \ { txt = txt_; loc = loc_ }; \ attr_payload = payload; \ @@ -301,7 +297,10 @@ end let attr_warning expr = let loc = !default_loc in let structure = {pstr_desc = Pstr_eval (expr, []); pstr_loc = loc} in - Attribute_expr(loc, "ocaml.warning", PStr [structure]) + { attr_name = { txt = "ocaml.warning"; loc; }; + attr_payload = PStr [structure]; + attr_loc = loc; + } type quoter = { mutable next_id : int; diff --git a/src_test/api/test_api.cppo.ml b/src_test/api/test_api.cppo.ml index 49053a93..edc6a434 100644 --- a/src_test/api/test_api.cppo.ml +++ b/src_test/api/test_api.cppo.ml @@ -2,11 +2,7 @@ open Parsetree open OUnit2 let string_of_tyvar tyvar = -#if OCAML_VERSION >= (4, 05, 0) tyvar.Location.txt -#else - tyvar -#endif let test_free_vars ctxt = let loc = !Ast_helper.default_loc in