diff --git a/bench/vendored/ppx_sexp_conv.v0.15.1/expander/conversion.ml b/bench/vendored/ppx_sexp_conv.v0.15.1/expander/conversion.ml index a02385f6..08c0b304 100644 --- a/bench/vendored/ppx_sexp_conv.v0.15.1/expander/conversion.ml +++ b/bench/vendored/ppx_sexp_conv.v0.15.1/expander/conversion.ml @@ -49,7 +49,7 @@ module Lambda = struct let maybe_apply_generic ~loc ~binds maybe_arg cases = let expr = match maybe_arg with - | None -> pexp_function ~loc cases + | None -> pexp_function_cases ~loc cases | Some arg -> pexp_match ~loc arg cases in with_let ~loc ~binds expr diff --git a/bench/vendored/ppx_sexp_conv.v0.15.1/expander/expand_of_sexp.ml b/bench/vendored/ppx_sexp_conv.v0.15.1/expander/expand_of_sexp.ml index 84d2851f..2da07093 100644 --- a/bench/vendored/ppx_sexp_conv.v0.15.1/expander/expand_of_sexp.ml +++ b/bench/vendored/ppx_sexp_conv.v0.15.1/expander/expand_of_sexp.ml @@ -842,7 +842,7 @@ module Str_generate_of_sexp = struct [%expr let rec [%p Fresh_name.pattern fresh_iter] = [%e - pexp_function + pexp_function_cases ~loc [ [%pat? Sexplib0.Sexp.List diff --git a/src/ast_builder.ml b/src/ast_builder.ml index 04c3eeb0..459270e8 100644 --- a/src/ast_builder.ml +++ b/src/ast_builder.ml @@ -43,7 +43,7 @@ module Default = struct pexp_desc = Pexp_function ([ case ], None, Pfunction_body e); } - let pexp_function ~loc cases = + let pexp_function_cases ~loc cases = { pexp_loc_stack = []; pexp_attributes = []; @@ -51,6 +51,8 @@ module Default = struct pexp_desc = Pexp_function ([], None, Pfunction_cases (cases, loc, [])); } + let pexp_function ~loc cases = pexp_function_cases ~loc cases + let value_binding ~loc ~pat ~expr = value_binding ~loc ~pat ~expr ~constraint_:None diff --git a/src/ast_builder.mli b/src/ast_builder.mli index 461f1cc7..e2190eac 100644 --- a/src/ast_builder.mli +++ b/src/ast_builder.mli @@ -64,6 +64,15 @@ module Default : sig loc:location -> longident loc -> pattern option -> pattern val pexp_function : loc:location -> Import.cases -> expression + [@@ocaml.deprecated "use pexp_function_cases instead."] + (** @deprecated + This function will be used to construct a {! Parsetree.Pexp_function } + in the next release, to retain its current functionality migrate to + {! pexp_function_cases}. *) + + val pexp_function_cases : loc:location -> Import.cases -> expression + (** [pexp_function_cases] builds an expression in the shape + [function C1 -> E1 | ...]. *) val constructor_declaration : loc:location ->