Skip to content

Commit 8613328

Browse files
committed
clean up unused pattern, sync jsx ppx interface
1 parent 1b638b8 commit 8613328

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

jscomp/bsb/bsb_ninja_rule.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
145145
Ext_buffer.add_string buf " $out_last");
146146
Ext_buffer.contents buf
147147
in
148-
let mk_ast ~has_reason_react_jsx : string =
148+
let mk_ast =
149149
Ext_buffer.clear buf;
150150
Ext_buffer.add_string buf bsc;
151151
Ext_buffer.add_char_string buf ' ' warnings;
@@ -163,11 +163,11 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
163163
| None -> ()
164164
| Some flag ->
165165
Ext_buffer.add_char_string buf ' ' (Bsb_build_util.pp_flag flag));
166-
(match (has_reason_react_jsx, reason_react_jsx, jsx_version) with
167-
| _, _, Some Jsx_v3 -> Ext_buffer.add_string buf " -bs-jsx 3"
168-
| _, _, Some Jsx_v4 -> Ext_buffer.add_string buf " -bs-jsx 4"
169-
| _, Some Jsx_v3, None -> Ext_buffer.add_string buf " -bs-jsx 3"
170-
| _ -> ());
166+
(match (reason_react_jsx, jsx_version) with
167+
| _, Some Jsx_v3 -> Ext_buffer.add_string buf " -bs-jsx 3"
168+
| _, Some Jsx_v4 -> Ext_buffer.add_string buf " -bs-jsx 4"
169+
| Some Jsx_v3, None -> Ext_buffer.add_string buf " -bs-jsx 3"
170+
| None, None -> ());
171171
(match jsx_module with
172172
| None -> ()
173173
| Some React -> Ext_buffer.add_string buf " -bs-jsx-module react");
@@ -180,10 +180,8 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
180180
Ext_buffer.add_string buf " -absname -bs-ast -o $out $i";
181181
Ext_buffer.contents buf
182182
in
183-
let build_ast = define ~command:(mk_ast ~has_reason_react_jsx:false) "ast" in
184-
let build_ast_from_re =
185-
define ~command:(mk_ast ~has_reason_react_jsx:true) "astj"
186-
in
183+
let build_ast = define ~command:mk_ast "ast" in
184+
let build_ast_from_re = define ~command:mk_ast "astj" in
187185

188186
let copy_resources =
189187
define

lib/4.06.1/rescript.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11748,7 +11748,7 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
1174811748
Ext_buffer.add_string buf " $out_last");
1174911749
Ext_buffer.contents buf
1175011750
in
11751-
let mk_ast ~has_reason_react_jsx : string =
11751+
let mk_ast =
1175211752
Ext_buffer.clear buf;
1175311753
Ext_buffer.add_string buf bsc;
1175411754
Ext_buffer.add_char_string buf ' ' warnings;
@@ -11766,11 +11766,11 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
1176611766
| None -> ()
1176711767
| Some flag ->
1176811768
Ext_buffer.add_char_string buf ' ' (Bsb_build_util.pp_flag flag));
11769-
(match (has_reason_react_jsx, reason_react_jsx, jsx_version) with
11770-
| _, _, Some Jsx_v3 -> Ext_buffer.add_string buf " -bs-jsx 3"
11771-
| _, _, Some Jsx_v4 -> Ext_buffer.add_string buf " -bs-jsx 4"
11772-
| _, Some Jsx_v3, None -> Ext_buffer.add_string buf " -bs-jsx 3"
11773-
| _ -> ());
11769+
(match (reason_react_jsx, jsx_version) with
11770+
| _, Some Jsx_v3 -> Ext_buffer.add_string buf " -bs-jsx 3"
11771+
| _, Some Jsx_v4 -> Ext_buffer.add_string buf " -bs-jsx 4"
11772+
| Some Jsx_v3, None -> Ext_buffer.add_string buf " -bs-jsx 3"
11773+
| None, None -> ());
1177411774
(match jsx_module with
1177511775
| None -> ()
1177611776
| Some React -> Ext_buffer.add_string buf " -bs-jsx-module react");
@@ -11783,10 +11783,8 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
1178311783
Ext_buffer.add_string buf " -absname -bs-ast -o $out $i";
1178411784
Ext_buffer.contents buf
1178511785
in
11786-
let build_ast = define ~command:(mk_ast ~has_reason_react_jsx:false) "ast" in
11787-
let build_ast_from_re =
11788-
define ~command:(mk_ast ~has_reason_react_jsx:true) "astj"
11789-
in
11786+
let build_ast = define ~command:mk_ast "ast" in
11787+
let build_ast_from_re = define ~command:mk_ast "astj" in
1179011788

1179111789
let copy_resources =
1179211790
define

lib/4.06.1/whole_compiler.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306038,7 +306038,7 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
306038306038

306039306039
"-bs-jsx-module", string_call (fun i ->
306040306040
(if i <> "react" then Bsc_args.bad_arg (" Not supported jsx-module : " ^ i));
306041-
Js_config.jsx_mode := i),
306041+
Js_config.jsx_module := i),
306042306042
"*internal* Set jsx module";
306043306043

306044306044
"-bs-jsx-mode", string_call (fun i ->

0 commit comments

Comments
 (0)