diff -uNr ppx_sexp_message-113.33.00/_oasis ppx_sexp_message-113.33.00+4.03/_oasis --- ppx_sexp_message-113.33.00/_oasis 2016-03-09 16:44:54.000000000 +0100 +++ ppx_sexp_message-113.33.00+4.03/_oasis 2016-03-22 15:13:51.000000000 +0100 @@ -1,8 +1,8 @@ OASISFormat: 0.4 -OCamlVersion: >= 4.02.3 +OCamlVersion: >= 4.03.0 FindlibVersion: >= 1.3.2 Name: ppx_sexp_message -Version: 113.33.00 +Version: 113.33.00+4.03 Synopsis: A ppx rewriter for easy construction of s-expressions Authors: Jane Street Group, LLC Copyrights: (C) 2015-2016 Jane Street Group LLC diff -uNr ppx_sexp_message-113.33.00/opam ppx_sexp_message-113.33.00+4.03/opam --- ppx_sexp_message-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100 +++ ppx_sexp_message-113.33.00+4.03/opam 2016-03-22 17:51:37.000000000 +0100 @@ -18,4 +18,4 @@ "ppx_sexp_conv" "ppx_tools" {>= "0.99.3"} ] -available: [ ocaml-version >= "4.02.3" ] +available: [ ocaml-version >= "4.03.0" ] diff -uNr ppx_sexp_message-113.33.00/src/ppx_sexp_message.ml ppx_sexp_message-113.33.00+4.03/src/ppx_sexp_message.ml --- ppx_sexp_message-113.33.00/src/ppx_sexp_message.ml 2016-03-09 16:44:54.000000000 +0100 +++ ppx_sexp_message-113.33.00+4.03/src/ppx_sexp_message.ml 2016-03-22 15:13:51.000000000 +0100 @@ -42,13 +42,10 @@ eapply ~loc (evar ~loc ("Sexplib.Conv.sexp_of_" ^ typ)) [pexp_constant ~loc const] in match const with - | Const_int _ -> f "int" - | Const_char _ -> f "char" - | Const_string _ -> f "string" - | Const_float _ -> f "float" - | Const_int32 _ -> f "int32" - | Const_int64 _ -> f "int64" - | Const_nativeint _ -> f "nativeint" + | Pconst_integer _ -> f "int" + | Pconst_char _ -> f "char" + | Pconst_string _ -> f "string" + | Pconst_float _ -> f "float" ;; let rewrite_here e = @@ -62,7 +59,7 @@ let e = rewrite_here e in let loc = e.pexp_loc in match e.pexp_desc with - | Pexp_constant (Const_string ("", _)) -> + | Pexp_constant (Pconst_string ("", _)) -> None | Pexp_constant const -> Some (sexp_of_constant ~loc const) @@ -71,18 +68,6 @@ | _ -> Some [%expr Sexplib.Conv.sexp_of_string [%e e]] ;; -type arg_label = - | Nolabel - | Labelled of string - | Optional - -(* Will help with the switch to 4.03 *) -let arg_label_of_string = function - | "" -> Nolabel - | s when s.[0] = '?' -> Optional - | s -> Labelled s -;; - let sexp_of_labelled_expr (label, e) = let loc = e.pexp_loc in match label, e.pexp_desc with @@ -97,7 +82,7 @@ | Labelled label, _ -> Some (sexp_inline ~loc (sexp_atom ~loc (estring ~loc label) :: List.of_option (sexp_of_expr e))) - | Optional, _ -> + | Optional _, _ -> (* Could be used to encode sexp_option if that's ever needed. *) Location.raise_errorf ~loc "ppx_sexp_value: optional argument not allowed here" @@ -112,7 +97,7 @@ let labelled_exprs = match e.pexp_desc with | Pexp_apply (f, args) -> - (Nolabel, f) :: List.map args ~f:(fun (label, e) -> arg_label_of_string label, e) + (Nolabel, f) :: args | _ -> (Nolabel, e) :: [] in