Skip to content

Commit c8f7903

Browse files
committed
fix refmt build issue
1 parent e5d7218 commit c8f7903

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

jscomp/all.depend

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,9 @@ bsb/bsb_ninja_gen.cmx : ext/string_map.cmx ext/literals.cmx \
892892
bsb/bsb_rule.cmx bsb/bsb_parse_sources.cmx bsb/bsb_ninja_util.cmx \
893893
bsb/bsb_ninja_global_vars.cmx bsb/bsb_ninja_file_groups.cmx \
894894
bsb/bsb_namespace_map_gen.cmx bsb/bsb_log.cmx bsb/bsb_exception.cmx \
895-
bsb/bsb_dir_index.cmx bsb/bsb_db.cmx bsb/bsb_config_types.cmx \
896-
bsb/bsb_config.cmx bsb/bsb_build_util.cmx bsb/bsb_build_schemas.cmx \
897-
bsb/bsb_ninja_gen.cmi
895+
bsb/bsb_dir_index.cmx bsb/bsb_default.cmx bsb/bsb_db.cmx \
896+
bsb/bsb_config_types.cmx bsb/bsb_config.cmx bsb/bsb_build_util.cmx \
897+
bsb/bsb_build_schemas.cmx bsb/bsb_ninja_gen.cmi
898898
bsb/bsb_ninja_global_vars.cmx :
899899
bsb/bsb_ninja_regen.cmx : ext/literals.cmx ext/ext_path.cmx \
900900
bsb/bsb_ninja_gen.cmx bsb/bsb_ninja_check.cmx bsb/bsb_merlin_gen.cmx \

jscomp/bsb/bsb_config_parse.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525
let config_file_bak = "bsconfig.json.bak"
26-
let refmt3_exe = "refmt3.exe"
27-
let refmt2_exe = "refmt.exe"
2826
let get_list_string = Bsb_build_util.get_list_string
2927
let (//) = Ext_path.combine
3028

jscomp/bsb/bsb_default.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ let bsc_flags =
5353

5454
let refmt_flags = ["--print"; "binary"]
5555

56-
56+
let refmt_v3 = "refmt.exe"
57+
let refmt_none = "refmt.exe"
5758

5859
let main_entries = [Bsb_config_types.JsTarget "Index"]

jscomp/bsb/bsb_default.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ val bsc_flags : string list
2828

2929
val refmt_flags : string list
3030

31+
val refmt_v3 : string
3132

33+
val refmt_none : string
3234

3335
val main_entries : Bsb_config_types.entries_t list

jscomp/bsb/bsb_ninja_gen.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ let output_ninja_and_namespace_map
126126
(match refmt with
127127
| Refmt_none ->
128128
Bsb_log.warn "@{<warning>Warning:@} refmt version missing. Please set it explicitly, since we may change the default in the future.@.";
129-
bsc_dir // "refmt.exe"
129+
bsc_dir // Bsb_default.refmt_none
130130
| Refmt_v3 ->
131-
bsc_dir // "refmt3.exe"
131+
bsc_dir // Bsb_default.refmt_v3
132132
| Refmt_custom x -> x );
133133
Bsb_ninja_global_vars.reason_react_jsx, reason_react_jsx_flag;
134134
Bsb_ninja_global_vars.refmt_flags, refmt_flags;

lib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bsb_helper.exe: bsb_helper.mli bsb_helper.ml
2020
$(NATIVE) $(OCAMLOPT_FLAGS) unix.cmxa -w -a $^ -o $@
2121

2222

23-
refmt3.exe: refmt_main3.mli refmt_main3.ml
23+
refmt.exe: refmt_main3.mli refmt_main3.ml
2424
$(NATIVE) -w -40-30 -no-alias-deps -I +compiler-libs ocamlcommon.cmxa $^ -o $@
2525

2626
reactjs_jsx_ppx_2.exe:reactjs_jsx_ppx_v2.mli reactjs_jsx_ppx_v2.ml
@@ -32,7 +32,7 @@ bsc.exe: whole_compiler.mli whole_compiler.ml
3232

3333

3434

35-
all: bsc.exe bsb.exe bsppx.exe bsb_helper.exe refmt.exe refmt3.exe reactjs_jsx_ppx_2.exe
35+
all: bsc.exe bsb.exe bsppx.exe bsb_helper.exe refmt.exe reactjs_jsx_ppx_2.exe
3636
# bspp.exe bsdep.exe
3737
# bspack.exe
3838
# bsppx.exe is needed for merlin

lib/bsb.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10165,7 +10165,9 @@ val bsc_flags : string list
1016510165

1016610166
val refmt_flags : string list
1016710167

10168+
val refmt_v3 : string
1016810169

10170+
val refmt_none : string
1016910171

1017010172
val main_entries : Bsb_config_types.entries_t list
1017110173

@@ -10226,7 +10228,8 @@ let bsc_flags =
1022610228

1022710229
let refmt_flags = ["--print"; "binary"]
1022810230

10229-
10231+
let refmt_v3 = "refmt.exe"
10232+
let refmt_none = "refmt.exe"
1023010233

1023110234
let main_entries = [Bsb_config_types.JsTarget "Index"]
1023210235

@@ -10587,8 +10590,6 @@ end = struct
1058710590
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
1058810591

1058910592
let config_file_bak = "bsconfig.json.bak"
10590-
let refmt3_exe = "refmt3.exe"
10591-
let refmt2_exe = "refmt.exe"
1059210593
let get_list_string = Bsb_build_util.get_list_string
1059310594
let (//) = Ext_path.combine
1059410595

@@ -12496,9 +12497,9 @@ let output_ninja_and_namespace_map
1249612497
(match refmt with
1249712498
| Refmt_none ->
1249812499
Bsb_log.warn "@{<warning>Warning:@} refmt version missing. Please set it explicitly, since we may change the default in the future.@.";
12499-
bsc_dir // "refmt.exe"
12500+
bsc_dir // Bsb_default.refmt_none
1250012501
| Refmt_v3 ->
12501-
bsc_dir // "refmt3.exe"
12502+
bsc_dir // Bsb_default.refmt_v3
1250212503
| Refmt_custom x -> x );
1250312504
Bsb_ninja_global_vars.reason_react_jsx, reason_react_jsx_flag;
1250412505
Bsb_ninja_global_vars.refmt_flags, refmt_flags;

lib/whole_compiler.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73694,6 +73694,14 @@ let rec if_ ?comment ?declaration ?else_ (e : J.expression) (then_ : J.block)
7369473694
when Js_analyzer.eq_statement then_ another_then
7369573695
->
7369673696
aux ?comment (E.or_ e pred) cont else_ acc
73697+
73698+
| _,
73699+
([ another_then] as cont),
73700+
[ {statement_desc = If (pred, then_, Some [else_] ) }]
73701+
when Js_analyzer.eq_statement else_ another_then
73702+
->
73703+
aux ?comment (E.or_ e (E.not pred)) cont then_ acc
73704+
7369773705
| _ ->
7369873706
let e = E.ocaml_boolean_under_condition e in
7369973707
{ statement_desc =

0 commit comments

Comments
 (0)