Skip to content

Commit

Permalink
PR edits
Browse files Browse the repository at this point in the history
  • Loading branch information
KFoxder committed Apr 7, 2024
1 parent 7b0c187 commit e1af396
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions config/cfg_ppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ let apply_config_on_types (tds : type_declaration list) =
let apply_config_on_cases (cases : cases) =
List.filter
(fun case ->
if should_keep case.pc_rhs.pexp_attributes = `keep then true else false)
should_keep case.pc_rhs.pexp_attributes = `keep)
cases

let rec apply_config_on_expression (exp : expression) =
Expand All @@ -135,15 +135,12 @@ let rec apply_config_on_expression (exp : expression) =
Pexp_let (rec_flag, vbs, exp)
| _ -> exp.pexp_desc
in
let { pexp_loc; pexp_loc_stack; pexp_attributes; _ } = exp in
{ pexp_loc; pexp_loc_stack; pexp_attributes; pexp_desc }
{ exp with pexp_desc }

let apply_config_on_value_bindings (vbs : value_binding list) =
List.map
(fun vb ->
let { pvb_loc; pvb_attributes; pvb_pat; pvb_expr } = vb in
let _pvb_expr = apply_config_on_expression pvb_expr in
{ pvb_loc; pvb_attributes; pvb_pat; pvb_expr = _pvb_expr })
{ vb with pvb_expr = apply_config_on_expression vb.pvb_expr })
vbs

let apply_config_on_structure_item stri =
Expand Down

0 comments on commit e1af396

Please sign in to comment.