Skip to content

Commit 6f7f4a2

Browse files
authored
Clean up jsx ppx (just a refactor) (#6035)
* Clean up jsx ppx: unused mapper in signature. * Clean up check for multiple react components. * Rename items. * Clean up toplevel processing of bidnings. * Move out modifiedBinding * Move out vbMatch * Move out mapBinding * Cleanup: mapBinding returns a single binding.
1 parent 0555147 commit 6f7f4a2

File tree

3 files changed

+447
-494
lines changed

3 files changed

+447
-494
lines changed

res_syntax/src/reactjs_jsx_ppx.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ let getMapper ~config =
108108
| Psig_attribute attr -> processConfigAttribute attr config
109109
| _ -> ());
110110
let item = default_mapper.signature_item mapper item in
111-
if config.version = 3 then transformSignatureItem3 mapper item
112-
else if config.version = 4 then transformSignatureItem4 mapper item
111+
if config.version = 3 then transformSignatureItem3 item
112+
else if config.version = 4 then transformSignatureItem4 item
113113
else [item])
114114
items
115115
|> List.flatten

res_syntax/src/reactjs_jsx_v3.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ let jsxMapper ~config =
10191019
| _ -> [item]
10201020
in
10211021

1022-
let transformSignatureItem _mapper item =
1022+
let transformSignatureItem item =
10231023
match item with
10241024
| {
10251025
psig_loc;

0 commit comments

Comments
 (0)