Skip to content

Commit 5377de1

Browse files
committed
move Js_array Js_re under Js, add docs
1 parent 60057b2 commit 5377de1

File tree

13 files changed

+52
-68
lines changed

13 files changed

+52
-68
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ jscomp/bin/compiler.ml binary
33
jscomp/bin/reason.ml binary
44
jscomp/bin/bs_ppx.ml binary
55
docs/js-demo/exports.js binary
6-
docs/reason-demo/exports.js binary
6+
docs/reason-demo/exports.js binary
7+
docs/Manual.html binary

docs/Manual.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,7 @@ <h3 id="_regex_support"><a class="anchor" href="#_regex_support"></a>Regex suppo
26462646
</div>
26472647
</div>
26482648
<div class="paragraph">
2649-
<p>The compiler will infer <code>f</code> has type <code>Js_re.t</code> and generate code as
2649+
<p>The compiler will infer <code>f</code> has type <code>Js.Re.t</code> and generate code as
26502650
below</p>
26512651
</div>
26522652
<div class="listingblock">
@@ -2661,7 +2661,7 @@ <h3 id="_regex_support"><a class="anchor" href="#_regex_support"></a>Regex suppo
26612661
<div class="title">Note</div>
26622662
</td>
26632663
<td class="content">
2664-
<code>Js_re.t</code> is an abstract type, we are working on providing
2664+
<code>Js.Re.t</code> is an abstract type, we are working on providing
26652665
bindings for it.
26662666
</td>
26672667
</tr>

jscomp/others/.depend

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ bs_node_module.cmj : bs_node.cmj bs_dict.cmj
1010
bs_node_module.cmx : bs_node.cmx bs_dict.cmx
1111
js_array.cmj :
1212
js_array.cmx :
13-
js_string.cmj : bs.cmj
14-
js_string.cmx : bs.cmx
13+
js_string.cmj : js_re.cmi
14+
js_string.cmx : js_re.cmx
1515
js_re.cmj : js_re.cmi
1616
js_re.cmx : js_re.cmi
1717
js_re.cmi :
@@ -27,7 +27,7 @@ bs_node_module.cmo : bs_node.cmo bs_dict.cmo
2727
bs_node_module.cmj : bs_node.cmj bs_dict.cmj
2828
js_array.cmo :
2929
js_array.cmj :
30-
js_string.cmo : bs.cmo
31-
js_string.cmj : bs.cmj
30+
js_string.cmo : js_re.cmi
31+
js_string.cmj : js_re.cmj
3232
js_re.cmo : js_re.cmi
3333
js_re.cmj : js_re.cmi

jscomp/others/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ include ../Makefile.shared
22

33
COMPILER=../bin/bsc
44

5-
MAP_FILES= bs_node bs
5+
MAP_FILES= bs_node
66

77
SOURCE_LIST= bs_node_path bs_node_fs bs_node_process bs_dict bs_node_module js_array js_string js_re
88

9-
$(addsuffix .cmj, $(SOURCE_LIST)): bs_node.cmj bs.cmj # TODO
9+
$(addsuffix .cmj, $(SOURCE_LIST)): $(addsuffix .cmj, $(MAP_FILES))
1010

1111
RUNTIME := $(addsuffix .cmj, $(SOURCE_LIST))
1212

jscomp/others/bs.ml

Lines changed: 0 additions & 38 deletions
This file was deleted.

jscomp/others/js_string.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ external lastIndexOf_from : t -> int -> int = "lastIndexOf" [@@bs.send.pipe: t]
6161

6262
external localeCompare : t -> float = "" [@@bs.send.pipe: t]
6363

64-
external replace : Bs.Re.t -> t -> t = "" [@@bs.send.pipe: t]
64+
external replace : Js_re.t -> t -> t = "" [@@bs.send.pipe: t]
6565
external replace_string : t -> t -> t = "replace" [@@bs.send.pipe: t]
6666

67-
external search : Bs.Re.t -> int = "" [@@bs.send.pipe: t]
67+
external search : Js_re.t -> int = "" [@@bs.send.pipe: t]
6868
external slice : int -> int -> t = "" [@@bs.send.pipe: t]
6969
external slice_end : int -> t = "slice" [@@bs.send.pipe: t]
7070

7171
external split : t -> t array = "" [@@bs.send.pipe: t]
7272
external split_limited : t -> int -> t array = "split" [@@bs.send.pipe: t]
73-
external split_by_reg : Bs.Re.t -> t array = "split" [@@bs.send.pipe: t]
74-
external split_regExpLimited : Bs.Re.t -> int -> t array = "" [@@bs.send.pipe: t]
73+
external split_by_reg : Js_re.t -> t array = "split" [@@bs.send.pipe: t]
74+
external split_regExpLimited : Js_re.t -> int -> t array = "" [@@bs.send.pipe: t]
7575

7676
external substring : int -> int -> t = "" [@@bs.send.pipe: t]
7777
external substring_toEnd : int -> t = "substring" [@@bs.send.pipe: t]

jscomp/runtime/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $(addsuffix .cmi, $(OTHERS)): js.cmi js_unsafe.cmj js_unsafe.cmi
2424

2525
RUNTIME := $(addsuffix .cmj, $(SOURCE_LIST))
2626

27-
BS_COMMON_FLAGS= -bs-no-version-header -bs-diagnose -bs-no-check-div-by-zero -bs-cross-module-opt -bs-package-name $(npm_package_name)
27+
BS_COMMON_FLAGS= -no-alias-deps -bs-no-version-header -bs-diagnose -bs-no-check-div-by-zero -bs-cross-module-opt -bs-package-name $(npm_package_name)
2828

2929
ifdef BS_RELEASE_BUILD
3030
BS_FLAGS= $(BS_COMMON_FLAGS) -bs-package-output lib/js -bs-package-output goog:lib/goog -bs-package-output amdjs:lib/amdjs

jscomp/runtime/js.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ end
8989

9090

9191

92+
module Dict = Bs_dict
93+
module Node = Bs_node
94+
module Array = Js_array
95+
module String = Js_string
96+
module Re = Js_re
97+
9298

9399

94100

jscomp/test/.depend

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ bigarray_test.cmx : ../stdlib/int32.cmx ../stdlib/complex.cmx \
8383
../stdlib/bigarray.cmx
8484
boolean_test.cmj : test_bool_equal.cmj mt.cmi
8585
boolean_test.cmx : test_bool_equal.cmx mt.cmx
86-
bs_array_test.cmj : ../runtime/js.cmj ../others/bs.cmj
87-
bs_array_test.cmx : ../runtime/js.cmx ../others/bs.cmx
86+
bs_array_test.cmj : ../runtime/js.cmj
87+
bs_array_test.cmx : ../runtime/js.cmx
8888
bs_rest_test.cmj :
8989
bs_rest_test.cmx :
90-
bs_string_test.cmj : ../runtime/js.cmj ../others/bs.cmj
91-
bs_string_test.cmx : ../runtime/js.cmx ../others/bs.cmx
90+
bs_string_test.cmj : ../runtime/js.cmj
91+
bs_string_test.cmx : ../runtime/js.cmx
9292
buffer_test.cmj : ../stdlib/string.cmi mt.cmi ../stdlib/bytes.cmi \
9393
../stdlib/buffer.cmi
9494
buffer_test.cmx : ../stdlib/string.cmx mt.cmx ../stdlib/bytes.cmx \
@@ -867,12 +867,12 @@ bigarray_test.cmj : ../stdlib/int32.cmj ../stdlib/complex.cmj \
867867
../stdlib/bigarray.cmj
868868
boolean_test.cmo : test_bool_equal.cmo mt.cmi
869869
boolean_test.cmj : test_bool_equal.cmj mt.cmj
870-
bs_array_test.cmo : ../runtime/js.cmo ../others/bs.cmo
871-
bs_array_test.cmj : ../runtime/js.cmj ../others/bs.cmj
870+
bs_array_test.cmo : ../runtime/js.cmo
871+
bs_array_test.cmj : ../runtime/js.cmj
872872
bs_rest_test.cmo :
873873
bs_rest_test.cmj :
874-
bs_string_test.cmo : ../runtime/js.cmo ../others/bs.cmo
875-
bs_string_test.cmj : ../runtime/js.cmj ../others/bs.cmj
874+
bs_string_test.cmo : ../runtime/js.cmo
875+
bs_string_test.cmj : ../runtime/js.cmj
876876
buffer_test.cmo : ../stdlib/string.cmi mt.cmi ../stdlib/bytes.cmi \
877877
../stdlib/buffer.cmi
878878
buffer_test.cmj : ../stdlib/string.cmj mt.cmj ../stdlib/bytes.cmj \

jscomp/test/bs_array_test.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
type 'a t = 'a Bs.Array.t
2+
type 'a t = 'a Js.Array.t
33
let () =
44
[| 1; 2; 3; 4 |]
5-
|> Bs.Array.filter (fun [@bs] x -> x > 2)
6-
|> Bs.Array.mapi (fun [@bs] x i -> x + i)
7-
|> Bs.Array.reduce (fun [@bs] x y -> x + y) 0
5+
|> Js.Array.filter (fun [@bs] x -> x > 2)
6+
|> Js.Array.mapi (fun [@bs] x i -> x + i)
7+
|> Js.Array.reduce (fun [@bs] x y -> x + y) 0
88
|> Js.log

0 commit comments

Comments
 (0)