Skip to content

Commit

Permalink
Compat with older ppxlib
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed May 24, 2024
1 parent 714df5d commit 6cda70d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions native/lib/ppx_deriving_router_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ let attr_prefix =

let attr_body =
let name = "router.body" in
Attribute.declare_flag name Attribute.Context.Label_declaration
let context = Attribute.Context.Label_declaration in
let payload_pattern = Ast_pattern.(pstr nil) in
Attribute.declare name context payload_pattern ()

let to_supported_arg_type (t : core_type) =
let loc = t.ptyp_loc in
Expand Down Expand Up @@ -252,9 +254,9 @@ let extract td =
in
let lds, l_body =
List.partition_filter_map lds ~f:(fun ld ->
match Attribute.has_flag attr_body ld with
| false -> `Left ld
| true -> `Right ld)
match Attribute.get attr_body ld with
| None -> `Left ld
| Some () -> `Right ld)
in
let l_body =
match l_body, l_method_ with
Expand Down

0 comments on commit 6cda70d

Please sign in to comment.