Skip to content

Commit e5c4875

Browse files
authored
Merge pull request rescript-lang#5166 from rescript-lang/embedding
2 parents b39896c + a768b23 commit e5c4875

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1446
-1655
lines changed

jscomp/bsb/bsb_config_parse.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ let interpret_json
290290

291291
: Bsb_config_types.t =
292292

293-
(** we should not resolve it too early,
293+
(* we should not resolve it too early,
294294
since it is external configuration, no {!Bsb_build_util.convert_and_resolve_path}
295295
*)
296296

@@ -377,7 +377,7 @@ let interpret_json
377377
files_to_install = Queue.create ();
378378
built_in_dependency = built_in_package;
379379
generate_merlin =
380-
extract_boolean map Bsb_build_schemas.generate_merlin true;
380+
extract_boolean map Bsb_build_schemas.generate_merlin false;
381381
reason_react_jsx ;
382382
generators = extract_generators map ;
383383
cut_generators ;

jscomp/bsb/bsb_file_groups.ml

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ let cons ~file_group ?globbed_dir (v : t) : t =
7777
| None -> v.globbed_dirs
7878
| Some f -> f :: v.globbed_dirs
7979
}
80+
8081
(** when [is_empty file_group]
8182
we don't need issue [-I] [-S] in [.merlin] file
8283
*)

jscomp/bsb/bsb_merlin_gen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ let merlin_file_gen ~per_proj_dir:(per_proj_dir:string)
182182
Buffer.add_string buffer merlin_b;
183183
Buffer.add_string buffer path ;
184184
);
185-
Ext_list.iter bs_dev_dependencies (**TODO: shall we generate .merlin for dev packages ?*)
185+
Ext_list.iter bs_dev_dependencies (*TODO: shall we generate .merlin for dev packages ?*)
186186
(fun package ->
187187
let path = package.package_install_path in
188188
Buffer.add_string buffer merlin_s ;

jscomp/bsb/bsb_namespace_map_gen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let write_file fname digest contents =
3434
output_char oc '\n';
3535
Ext_buffer.output_buffer oc contents;
3636
close_out oc
37-
(**
37+
(*
3838
TODO:
3939
sort filegroupts to ensure deterministic behavior
4040

jscomp/bsb/bsb_ninja_gen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ let output_ninja_and_namespace_map
268268
| None -> ()
269269
| Some x -> output_string oc ("cleaner = " ^ x.path ^ "\n"));
270270
output_static_resources static_resources rules.copy_resources oc ;
271-
(** Generate build statement for each file *)
271+
(* Generate build statement for each file *)
272272
Ext_list.iter bs_file_groups
273273
(fun files_per_dir ->
274274
Bsb_ninja_file_groups.handle_files_per_dir oc

jscomp/bsb/bsb_ninja_rule.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ type builtin = {
9191
(* build_ast_from_rei : t ; *)
9292

9393

94-
(** platform dependent, on Win32,
94+
(* platform dependent, on Win32,
9595
invoking cmd.exe
9696
*)
9797
copy_resources : t;
98-
(** Rules below all need restat *)
98+
(* Rules below all need restat *)
9999
build_bin_deps : t ;
100100
build_bin_deps_dev : t;
101101
mj : t;
@@ -134,7 +134,7 @@ let make_custom_rules
134134
builtin =
135135
let bs_dep = Ext_filename.maybe_quote Bsb_global_paths.vendor_bsdep in
136136
let bsc = Ext_filename.maybe_quote Bsb_global_paths.vendor_bsc in
137-
(** FIXME: We don't need set [-o ${out}] when building ast
137+
(* FIXME: We don't need set [-o ${out}] when building ast
138138
since the default is already good -- it does not*)
139139
let buf = Ext_buffer.create 100 in
140140
let ns_flag =
@@ -293,11 +293,11 @@ let make_custom_rules
293293
{
294294
build_ast ;
295295
build_ast_from_re ;
296-
(** platform dependent, on Win32,
296+
(* platform dependent, on Win32,
297297
invoking cmd.exe
298298
*)
299299
copy_resources;
300-
(** Rules below all need restat *)
300+
(* Rules below all need restat *)
301301
build_bin_deps ;
302302
build_bin_deps_dev;
303303
mj ;

jscomp/bsb/bsb_ninja_rule.mli

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ type builtin = {
3939
build_ast : t;
4040
build_ast_from_re : t ;
4141

42-
(** platform dependent, on Win32,
42+
(* platform dependent, on Win32,
4343
invoking cmd.exe
4444
*)
4545
copy_resources : t;
46-
(** Rules below all need restat *)
46+
(* Rules below all need restat *)
4747
build_bin_deps : t ;
4848
build_bin_deps_dev : t ;
4949
mj : t;
@@ -65,7 +65,7 @@ type builtin = {
6565
*)
6666

6767
type command = string
68-
(** Since now we generate ninja files per bsconfig.json in a single process,
68+
(* Since now we generate ninja files per bsconfig.json in a single process,
6969
we must make sure it is re-entrant
7070
*)
7171
val make_custom_rules :

jscomp/bsb/bsb_parse_sources.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ let rec
209209
let sources =
210210
match input.?(Bsb_build_schemas.files) with
211211
| None ->
212-
(** We should avoid temporary files *)
212+
(* We should avoid temporary files *)
213213
Ext_array.fold_left (Lazy.force base_name_array) output_sources (fun acc basename ->
214214
if is_input_or_output scanned_generators basename then acc
215215
else
@@ -233,7 +233,7 @@ let rec
233233
in
234234
let resources = extract_resources input in
235235
let public = extract_pub input sources in
236-
(** Doing recursive stuff *)
236+
(* Doing recursive stuff *)
237237
let children =
238238
match sub_dirs_field,
239239
cxt.traverse with
@@ -259,7 +259,7 @@ let rec
259259
| Some (False _), _ -> Bsb_file_groups.empty
260260
| Some s, _ -> parse_sources cxt s
261261
in
262-
(** Do some clean up *)
262+
(* Do some clean up *)
263263
(* prune_staled_bs_js_files cxt sources ; *)
264264
Bsb_file_groups.cons
265265
~file_group:{ dir ;

jscomp/bsb/bsb_pkg.ml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ let node_paths : string list Lazy.t =
3838
lazy (try Ext_string.split (Sys.getenv "NODE_PATH")
3939
(if Sys.win32 then ';' else ':')
4040
with _ -> [])
41+
4142
(** It makes sense to have this function raise, when [bsb] could not resolve a package, it used to mean
4243
a failure
4344
*)

jscomp/bsb/bsb_warning.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let from_map (m : Ext_json_types.t Map_string.t) =
8282
-> Warn_error_number str
8383
| Some x -> Bsb_exception.config_error x "expect true/false or string"
8484
| None -> Warn_error_false
85-
(** To make it less intrusive : warning error has to be enabled*)
85+
(* To make it less intrusive : warning error has to be enabled*)
8686
in
8787
let number =
8888
match number_opt with

jscomp/bspp/parser.ml

-125
This file was deleted.

jscomp/build_tests/custom_namespace/bsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"number" : "-40+6+7",
1717
"error" : true
1818
},
19-
"suffix": ".bs.js"
19+
"suffix": ".bs.js",
20+
"generate-merlin": true
2021
}

jscomp/build_tests/namespace/bsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"number" : "-40+6+7",
2020
"error" : true
2121
},
22-
"suffix": ".bs.js"
22+
"suffix": ".bs.js",
23+
"generate-merlin": true
2324
}

jscomp/bytecomp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ocaml/bytecomp

jscomp/core/js_analyzer.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let free_variables (stats : idents_stats) = {
6464
expression = begin fun self exp ->
6565
match exp.expression_desc with
6666
| Fun(_, _,_, env)
67-
(** a optimization to avoid walking into funciton again
67+
(* a optimization to avoid walking into funciton again
6868
if it's already comuted
6969
*)
7070
->
@@ -111,7 +111,7 @@ let rec no_side_effect_expression_desc (x : J.expression_desc) =
111111
| Array (xs,_mutable_flag)
112112
| Caml_block (xs, _mutable_flag, _, _)
113113
->
114-
(** create [immutable] block,
114+
(* create [immutable] block,
115115
does not really mean that this opreation itself is [pure].
116116
117117
the block is mutable does not mean this operation is non-pure

jscomp/core/js_cmj_load.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let load_unit_with_file unit_name : Js_cmj_format.cmj_load_info =
4949
| Some f
5050
->
5151
{package_path =
52-
(** hacking relying on the convention of pkg/lib/ocaml/xx.cmj*)
52+
(* hacking relying on the convention of pkg/lib/ocaml/xx.cmj*)
5353
Filename.dirname (Filename.dirname (Filename.dirname f));
5454
cmj_table = Js_cmj_format.from_file f}
5555
| None ->

jscomp/core/js_dump.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ and pp_function ~is_method
373373
optimize len ~p:(arity = NA && len <=8) cxt f v)
374374

375375
| _ ->
376-
let set_env : Set_ident.t = (** identifiers will be printed following*)
376+
let set_env : Set_ident.t = (* identifiers will be printed following*)
377377
match fn_state with
378378
| Is_return
379379
| No_name _ ->
@@ -730,7 +730,7 @@ and expression_desc cxt ~(level:int) f x : cxt =
730730
handle parens..
731731
*)
732732
->
733-
(** TODO: parenthesize when necessary *)
733+
(* TODO: parenthesize when necessary *)
734734
(match delta, op with
735735
| {expression_desc = Number (Int { i = 1l; _})}, Plus
736736
| {expression_desc = Number (Int { i = -1l; _})}, Minus
@@ -789,7 +789,7 @@ and expression_desc cxt ~(level:int) f x : cxt =
789789
P.space f;
790790
expression ~level:rght cxt f e2)
791791
| Array (el,_) ->
792-
(** TODO: simplify for singleton list *)
792+
(* TODO: simplify for singleton list *)
793793
(match el with
794794
| []| [ _ ] -> P.bracket_group f 1 (fun _ -> array_element_list cxt f el)
795795
| _ -> P.bracket_vgroup f 1 (fun _ -> array_element_list cxt f el))
@@ -892,7 +892,7 @@ and expression_desc cxt ~(level:int) f x : cxt =
892892
cxt)
893893

894894
| Length (e, _) ->
895-
(** Todo: check parens *)
895+
(*Todo: check parens *)
896896
P.cond_paren_group f (level > 15) 1 (fun _ ->
897897
let cxt = expression ~level:15 cxt f e in
898898
P.string f L.dot;

jscomp/core/js_exp_make.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ let bin ?comment (op : J.binop) (e0 : t) (e1 : t) : t =
639639
match op, e0.expression_desc, e1.expression_desc with
640640
| EqEqEq,_,_ -> triple_equal ?comment e0 e1
641641
| Ge, Length (e,_), Number (Int {i = 0l}) when no_side_effect e ->
642-
true_ (** x.length >=0 | [x] is pure -> true*)
642+
true_ (* x.length >=0 | [x] is pure -> true*)
643643
| Gt, Length (_,_), Number (Int {i = 0l}) ->
644644
(* [e] is kept so no side effect check needed *)
645645
{expression_desc = Bin(NotEqEq,e0, e1); comment }

0 commit comments

Comments
 (0)