From: Stephane Glondu <steph@glondu.net>
Date: Wed, 20 Aug 2025 10:37:35 +0200
Subject: Temporarily revert ppx_bitstring to 4.1.1 to support ppxlib 0.35.0

Forwarded: not-needed
---
 ppx/ppx_bitstring.ml | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/ppx/ppx_bitstring.ml b/ppx/ppx_bitstring.ml
index 058ca99..6fe2849 100644
--- a/ppx/ppx_bitstring.ml
+++ b/ppx/ppx_bitstring.ml
@@ -1,5 +1,5 @@
 (*
- * Copyright (c) 2016 Xavier R. Guérin <xguerin@users.noreply.github.com>
+ * Copyright (c) 2016 Xavier R. Guérin <copyright@applepine.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -212,24 +212,21 @@ let rec process_expr_loc ~loc expr =
         []
         ops
     in { expr with pexp_desc = Pexp_apply(lident, fld); pexp_loc = loc }
-  | { pexp_desc = Pexp_function(params, constraint_, Pfunction_body exp); _ } ->
-     let lparams = List.map (process_param_loc ~loc) params in
-     let lexp = process_expr_loc ~loc exp in
-     { expr with pexp_desc = Pexp_function (lparams, constraint_, Pfunction_body lexp); pexp_loc = loc }
-  | _ ->
-    { expr with pexp_loc = loc }
-
-and process_param_loc ~loc (param : function_param) = match param.pparam_desc with
-  | Pparam_val (ident, ops, { ppat_desc = Ppat_var pid; ppat_attributes; _ }) -> (
+  | { pexp_desc = Pexp_fun(ident, ops,
+                           { ppat_desc = Ppat_var(pid); ppat_loc; ppat_attributes;
+                           ppat_loc_stack = [] },
+                           exp); _ } ->
     let lpid = Loc.make pid.txt ~loc in
-    let lpat = { ppat_desc = Ppat_var lpid; ppat_loc = loc; ppat_attributes; ppat_loc_stack = [] } in
+    let lpat = { ppat_desc = Ppat_var lpid; ppat_loc = loc; ppat_attributes;
+    ppat_loc_stack = [] } in
     let lops = begin match ops with
       | Some o -> Some (process_expr_loc ~loc o)
       | None   -> None
     end in
-    { param with pparam_desc = Pparam_val (ident, lops, lpat) }
-  )
-  | _ -> param
+    let lexp = process_expr_loc ~loc exp in
+    { expr with pexp_desc = Pexp_fun(ident, lops, lpat, lexp); pexp_loc = loc }
+  | _ ->
+    { expr with pexp_loc = loc }
 ;;
 
 let parse_expr expr =
@@ -1206,7 +1203,7 @@ let expression_expander expr =
       expr
   | Pexp_match (ident, cases) ->
     gen_cases ~loc ident cases
-  | Pexp_function ([], _, Pfunction_cases (cases, _, _)) ->
+  | Pexp_function (cases) ->
     gen_function ~loc cases
   | _ ->
     location_exn ~loc
@@ -1228,7 +1225,7 @@ let structure_item_rule =
   Extension.V3.declare
     "bitstring"
     Extension.Context.structure_item
-    Ast_pattern.(pstr (pstr_value nonrecursive (value_binding ~constraint_:drop ~pat:__ ~expr:__ ^:: nil)  ^:: nil))
+    Ast_pattern.(pstr (pstr_value nonrecursive (value_binding ~pat:__ ~expr:__ ^:: nil)  ^:: nil))
     structure_item_rewriter
   |> Context_free.Rule.extension
 
