Skip to content
Snippets Groups Projects
Commit e71cbc16 authored by charguer's avatar charguer
Browse files

generation_ok

parent 2f8ebcfe
No related branches found
No related tags found
No related merge requests found
- clean up stdlib.ml
- implement stdlib.js to match all functions of stdlib.ml
- remove JsNumber by binding a set of operations in stdlib.js
implemented using builtin JS primitives
- reactivate
default: throw "No matching case for switch";
......@@ -15,13 +21,11 @@
=> TODO: look for code that already does this for esprima.
- check in Shared.ml whether we need to take absolute values
let string_sub s n l =
substring (int_abs n) (int_abs l) s
-
- here:
string_sub str (int_of_float k0) 1
=> TODO: check k0 is not negative
......
......@@ -678,7 +678,10 @@ and js_of_expression ctx dest e =
| Texp_construct (p, cd, el) ->
let cstr_fullname = string_of_longident p.txt in
let cstr_name = cd.cstr_name in
let cstr_fullname = if cstr_fullname = "::" then "mk_cons" else cstr_fullname in (* TODO: clean up this hack *)
let cstr_fullname =
if cstr_fullname = "[]" then "mk_nil"
else if cstr_fullname = "::" then "mk_cons"
else cstr_fullname in (* TODO: clean up this hack *)
(*let styp = string_of_type_exp e.exp_type in*)
let sexp =
if is_sbool cstr_name then cstr_name else
......
var max_float = Number.MAX_VALUE; // TODO: find absolute value for this
var mk_nil = function() {
return { type: "list", tag: "[]" };
};
......
open Fappli_IEEE_bits
open LibReflect
let nat_eq = int_eq
let nat_eq x y = int_eq x y
type number = binary64
......
......@@ -52,5 +52,5 @@ let bool_comparable x y =
(** val prop_eq_decidable :
coq_Decidable -> coq_Decidable -> coq_Decidable **)
let prop_eq_decidable = bool_eq
let prop_eq_decidable x y = bool_eq x y
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment