Skip to content

Commit da986a5

Browse files
committed
format
1 parent 15a4b71 commit da986a5

34 files changed

+32881
-31793
lines changed

jscomp/bsb_helper/bsb_db_decode.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ let read_build_cache ~dir : t =
8282
let all_content = Ext_io.load_file (Filename.concat dir bsbuild_cache) in
8383
decode all_content
8484

85-
type module_info = { case : bool; (* which is Bsb_db.case*)
86-
dir_name : string }
85+
type module_info = { case : bool; (* which is Bsb_db.case*) dir_name : string }
8786

8887
let find_opt ({ content = whole } as db : t) lib (key : string) :
8988
module_info option =

jscomp/bsb_helper/bsb_helper_depfile_gen.ml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ let oc_cmi buf namespace source =
9393
Ext_buffer.add_string buf Literals.suffix_cmi
9494

9595
(* For cases with self cycle
96-
e.g, in b.ml
97-
{[
98-
include B
99-
]}
100-
When ns is not turned on, it makes sense that b may come from third party package.
101-
Hoever, this case is wont supported.
102-
It complicates when it has interface file or not.
103-
- if it has interface file, the current interface will have priority, failed to build?
104-
- if it does not have interface file, the build will not open this module at all(-bs-read-cmi)
96+
e.g, in b.ml
97+
{[
98+
include B
99+
]}
100+
When ns is not turned on, it makes sense that b may come from third party package.
101+
Hoever, this case is wont supported.
102+
It complicates when it has interface file or not.
103+
- if it has interface file, the current interface will have priority, failed to build?
104+
- if it does not have interface file, the build will not open this module at all(-bs-read-cmi)
105105
106-
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
107-
it can be errored out earlier
106+
When ns is turned on, `B` is interprted as `Ns-B` which is a cyclic dependency,
107+
it can be errored out earlier
108108
109-
#5368: It turns out there are many false positives on detecting self-cycles (see: `jscomp/build_tests/zerocycle`)
110-
To properly solve this, we would need to `jscomp/ml/depend.ml` because
111-
cmi and cmj is broken in the first place (same problem as in ocaml/ocaml#4618).
112-
So we will just ignore the self-cycles. Even if there is indeed a self-cycle, it should fail to compile anyway.
109+
#5368: It turns out there are many false positives on detecting self-cycles (see: `jscomp/build_tests/zerocycle`)
110+
To properly solve this, we would need to `jscomp/ml/depend.ml` because
111+
cmi and cmj is broken in the first place (same problem as in ocaml/ocaml#4618).
112+
So we will just ignore the self-cycles. Even if there is indeed a self-cycle, it should fail to compile anyway.
113113
*)
114114
let oc_deps (ast_file : string) (is_dev : bool) (db : Bsb_db_decode.t)
115115
(namespace : string option) (buf : Ext_buffer.t) (kind : [ `impl | `intf ])
@@ -138,26 +138,26 @@ let oc_deps (ast_file : string) (is_dev : bool) (db : Bsb_db_decode.t)
138138
while !offset < size do
139139
let next_tab = String.index_from s !offset magic_sep_char in
140140
let dependent_module = String.sub s !offset (next_tab - !offset) in
141-
if dependent_module = cur_module_name then
142-
(*prerr_endline ("FAILED: " ^ cur_module_name ^ " has a self cycle");
143-
exit 2*)
144-
(* #5368 ignore self dependencies *) ()
141+
(if dependent_module = cur_module_name then
142+
(*prerr_endline ("FAILED: " ^ cur_module_name ^ " has a self cycle");
143+
exit 2*)
144+
(* #5368 ignore self dependencies *) ()
145145
else
146-
(match Bsb_db_decode.find db dependent_module is_dev with
147-
| None -> ()
148-
| Some { dir_name; case } ->
149-
Lazy.force at_most_once;
150-
let source =
151-
Filename.concat dir_name
152-
(if case then dependent_module
153-
else Ext_string.uncapitalize_ascii dependent_module)
154-
in
155-
Ext_buffer.add_char buf ' ';
156-
if kind = `impl then (
157-
output_file buf source namespace;
158-
Ext_buffer.add_string buf Literals.suffix_cmj);
159-
(* #3260 cmj changes does not imply cmi change anymore *)
160-
oc_cmi buf namespace source);
146+
match Bsb_db_decode.find db dependent_module is_dev with
147+
| None -> ()
148+
| Some { dir_name; case } ->
149+
Lazy.force at_most_once;
150+
let source =
151+
Filename.concat dir_name
152+
(if case then dependent_module
153+
else Ext_string.uncapitalize_ascii dependent_module)
154+
in
155+
Ext_buffer.add_char buf ' ';
156+
if kind = `impl then (
157+
output_file buf source namespace;
158+
Ext_buffer.add_string buf Literals.suffix_cmj);
159+
(* #3260 cmj changes does not imply cmi change anymore *)
160+
oc_cmi buf namespace source);
161161
offset := next_tab + 1
162162
done;
163163
if Lazy.is_val at_most_once then Ext_buffer.add_char buf '\n'

jscomp/dune

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
1-
(dirs
2-
bsb
3-
bsb_helper
4-
common
5-
core
6-
depends
7-
ext
8-
frontend
9-
gentype
10-
js_parser
11-
main
12-
ml
13-
napkin
14-
ounit
15-
ounit_tests
16-
stubs
17-
outcome_printer
18-
super_errors)
1+
(dirs bsb bsb_helper common core depends ext frontend gentype js_parser main
2+
ml napkin ounit ounit_tests stubs outcome_printer super_errors)
193

204
(copy_files# bsb/*.{ml,mli})
215

@@ -54,10 +38,8 @@
5438
(library
5539
(name jscomp)
5640
(flags "-w" "+26+27+32+33+39-d")
57-
(modules_without_implementation
58-
Jscmj_main
59-
Lam_pass_unused_params
60-
Lam_runtime)
41+
(modules_without_implementation Jscmj_main Lam_pass_unused_params
42+
Lam_runtime)
6143
(foreign_stubs
6244
(language c)
6345
(names ext_basic_hash_stubs)

0 commit comments

Comments
 (0)