Skip to content

more ocaml less typescript #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions jscomp/js_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,29 @@ let runtime_set = String_set.of_list [
"caml_array.js";
"caml_float.js";
"caml_obj_runtime.js";
(* "caml_sys.js"; *)
"caml_bigarray.js";
"caml_format.js";
"caml_oo.js";
(* "caml_unix.js"; *)
"caml_c_ffi.js";
"caml_int64.js";
"caml_primitive.js";
"caml_utils.js";
"caml_builtin_exceptions.js";
"caml_exceptions.js";
(* "caml_io.js"; *)
"caml_curry.js";
"caml_file.js";
"caml_lexer.js";
"caml_string.js"
(* "caml_sys.js"; *)
(* "caml_unix.js"; *)
(* "caml_io.js"; *)
]


let prim = "Caml_primitive"

let exceptions = "Caml_exceptions"
let builtin_exceptions = "Caml_builtin_exceptions"


let io = "Caml_io"

Expand Down
2 changes: 1 addition & 1 deletion jscomp/js_config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val stdlib_set : String_set.t

val prim : string

val exceptions : string
val builtin_exceptions : string

val io : string

Expand Down
2 changes: 1 addition & 1 deletion jscomp/lam_compile_global.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let get_exp (key : Lam_compile_env.key) : J.expression =
if Ident.is_predef_exn id
then
begin
E.runtime_ref Js_config.exceptions id.name
E.runtime_ref Js_config.builtin_exceptions id.name
end
else
Lam_compile_env.query_and_add_if_not_exist (Lam_module_ident.of_ml id) env
Expand Down
6 changes: 3 additions & 3 deletions jscomp/lam_dispatch_primitive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,18 @@ let query (prim : Lam_compile_env.primitive_description)
_} as v
]
->
(* Caml_exceptions.caml_oo_last_id++*)

{v with expression_desc =
J.Array
([ tag; str ;
E.prefix_inc
(E.runtime_var_vid
Js_config.exceptions
Js_config.builtin_exceptions
"caml_oo_last_id")
], flag)
}
| _ ->
E.runtime_call Js_config.exceptions prim.prim_name args
E.runtime_call Js_config.builtin_exceptions prim.prim_name args
end

| "caml_sys_const_big_endian" ->
Expand Down
20 changes: 20 additions & 0 deletions jscomp/lam_runtime.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(* OCamlScript compiler
* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)

(* Author: Hongbo Zhang *)

5 changes: 5 additions & 0 deletions jscomp/runtime/.depend
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
caml_array.cmi :
caml_exceptions.cmi :
caml_oo.cmi :
caml_string.cmi :
caml_array.cmo : caml_array.cmi
caml_array.cmx : caml_array.cmi
caml_curry.cmo :
caml_curry.cmx :
caml_exceptions.cmo : caml_exceptions.cmi
caml_exceptions.cmx : caml_exceptions.cmi
caml_oo.cmo : caml_oo.cmi
caml_oo.cmx : caml_oo.cmi
caml_string.cmo : caml_string.cmi
Expand All @@ -13,6 +16,8 @@ caml_array.cmo : caml_array.cmi
caml_array.cmj : caml_array.cmi
caml_curry.cmo :
caml_curry.cmj :
caml_exceptions.cmo : caml_exceptions.cmi
caml_exceptions.cmj : caml_exceptions.cmi
caml_oo.cmo : caml_oo.cmi
caml_oo.cmj : caml_oo.cmi
caml_string.cmo : caml_string.cmi
Expand Down
1 change: 1 addition & 0 deletions jscomp/runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SOURCE_LIST := $(shell cat runtime.mllib)

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


$(RUNTIME): $(CAMLC)

all: $(RUNTIME)
Expand Down
Loading