Skip to content

Commit a11f295

Browse files
author
Hongbo Zhang
committed
more ocaml less typescript
1 parent 3eeec5d commit a11f295

File tree

104 files changed

+1205
-2370
lines changed

Some content is hidden

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

104 files changed

+1205
-2370
lines changed

jscomp/js_config.ml

+6-4
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,29 @@ let runtime_set = String_set.of_list [
8686
"caml_array.js";
8787
"caml_float.js";
8888
"caml_obj_runtime.js";
89-
(* "caml_sys.js"; *)
9089
"caml_bigarray.js";
9190
"caml_format.js";
9291
"caml_oo.js";
93-
(* "caml_unix.js"; *)
9492
"caml_c_ffi.js";
9593
"caml_int64.js";
9694
"caml_primitive.js";
9795
"caml_utils.js";
96+
"caml_builtin_exceptions.js";
9897
"caml_exceptions.js";
99-
(* "caml_io.js"; *)
10098
"caml_curry.js";
10199
"caml_file.js";
102100
"caml_lexer.js";
103101
"caml_string.js"
102+
(* "caml_sys.js"; *)
103+
(* "caml_unix.js"; *)
104+
(* "caml_io.js"; *)
104105
]
105106

106107

107108
let prim = "Caml_primitive"
108109

109-
let exceptions = "Caml_exceptions"
110+
let builtin_exceptions = "Caml_builtin_exceptions"
111+
110112

111113
let io = "Caml_io"
112114

jscomp/js_config.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ val stdlib_set : String_set.t
3232

3333
val prim : string
3434

35-
val exceptions : string
35+
val builtin_exceptions : string
3636

3737
val io : string
3838

jscomp/lam_compile_global.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let get_exp (key : Lam_compile_env.key) : J.expression =
4949
if Ident.is_predef_exn id
5050
then
5151
begin
52-
E.runtime_ref Js_config.exceptions id.name
52+
E.runtime_ref Js_config.builtin_exceptions id.name
5353
end
5454
else
5555
Lam_compile_env.query_and_add_if_not_exist (Lam_module_ident.of_ml id) env

jscomp/lam_dispatch_primitive.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,18 @@ let query (prim : Lam_compile_env.primitive_description)
417417
_} as v
418418
]
419419
->
420-
(* Caml_exceptions.caml_oo_last_id++*)
420+
421421
{v with expression_desc =
422422
J.Array
423423
([ tag; str ;
424424
E.prefix_inc
425425
(E.runtime_var_vid
426-
Js_config.exceptions
426+
Js_config.builtin_exceptions
427427
"caml_oo_last_id")
428428
], flag)
429429
}
430430
| _ ->
431-
E.runtime_call Js_config.exceptions prim.prim_name args
431+
E.runtime_call Js_config.builtin_exceptions prim.prim_name args
432432
end
433433

434434
| "caml_sys_const_big_endian" ->

jscomp/lam_runtime.mli

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(* OCamlScript compiler
2+
* Copyright (C) 2015-2016 Bloomberg Finance L.P.
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU Lesser General Public License as published by
6+
* the Free Software Foundation, with linking exception;
7+
* either version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17+
*)
18+
19+
(* Author: Hongbo Zhang *)
20+

jscomp/runtime/.depend

+5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
caml_array.cmi :
2+
caml_exceptions.cmi :
23
caml_oo.cmi :
34
caml_string.cmi :
45
caml_array.cmo : caml_array.cmi
56
caml_array.cmx : caml_array.cmi
67
caml_curry.cmo :
78
caml_curry.cmx :
9+
caml_exceptions.cmo : caml_exceptions.cmi
10+
caml_exceptions.cmx : caml_exceptions.cmi
811
caml_oo.cmo : caml_oo.cmi
912
caml_oo.cmx : caml_oo.cmi
1013
caml_string.cmo : caml_string.cmi
@@ -13,6 +16,8 @@ caml_array.cmo : caml_array.cmi
1316
caml_array.cmj : caml_array.cmi
1417
caml_curry.cmo :
1518
caml_curry.cmj :
19+
caml_exceptions.cmo : caml_exceptions.cmi
20+
caml_exceptions.cmj : caml_exceptions.cmi
1621
caml_oo.cmo : caml_oo.cmi
1722
caml_oo.cmj : caml_oo.cmi
1823
caml_string.cmo : caml_string.cmi

jscomp/runtime/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SOURCE_LIST := $(shell cat runtime.mllib)
66

77
RUNTIME := $(addsuffix .cmj, $(SOURCE_LIST))
88

9+
910
$(RUNTIME): $(CAMLC)
1011

1112
all: $(RUNTIME)

0 commit comments

Comments
 (0)