From 2150e6521682d59062476ae35693ab5c3434c018 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Thu, 10 Sep 2020 07:51:00 -0700 Subject: [PATCH] Update to OCaml 4.11 AST Signed-off-by: Josh Berdine --- ppx_blob.opam | 2 +- src/ppx_blob.ml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ppx_blob.opam b/ppx_blob.opam index db6ce0e..9f093e6 100644 --- a/ppx_blob.opam +++ b/ppx_blob.opam @@ -12,7 +12,7 @@ build: [ depends: [ "ocaml" "dune" - "ocaml-migrate-parsetree" + "ocaml-migrate-parsetree" {>= "1.7.0"} "alcotest" {with-test} ] synopsis: "Include a file as a string at compile time" diff --git a/src/ppx_blob.ml b/src/ppx_blob.ml index d0d7020..7eaa36f 100644 --- a/src/ppx_blob.ml +++ b/src/ppx_blob.ml @@ -1,7 +1,7 @@ open Migrate_parsetree -open Ast_408 +open Ast_411 -let str ?loc ?attrs s = Ast_helper.Exp.constant ?loc ?attrs (Pconst_string (s, None)) +let str ?loc ?attrs s = Ast_helper.Exp.constant ?loc ?attrs (Ast_helper.Const.string ?loc s) let location_errorf ~loc = Format.ksprintf (fun err -> @@ -32,7 +32,7 @@ let mapper _config _cookies = begin match pstr with | PStr [{ pstr_desc = Pstr_eval ({ pexp_loc = loc; - pexp_desc = Pexp_constant (Pconst_string (file_name, _)); + pexp_desc = Pexp_constant (Pconst_string (file_name, _, _)); _ }, _); _ }] -> str (get_blob ~loc file_name) @@ -44,5 +44,5 @@ let mapper _config _cookies = let () = Driver.register ~name:"ppx_blob" - Versions.ocaml_408 + Versions.ocaml_411 mapper