Skip to content

Commit

Permalink
Move Core Global into Pervasives
Browse files Browse the repository at this point in the history
  • Loading branch information
cknitt committed Oct 20, 2024
1 parent 29311db commit 01daa07
Show file tree
Hide file tree
Showing 17 changed files with 606 additions and 1,004 deletions.
1 change: 0 additions & 1 deletion lib/es6/Global.js

This file was deleted.

29 changes: 5 additions & 24 deletions lib/es6/Pervasives.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


import * as $$Error from "./Error.js";
import * as Primitive_exceptions from "./Primitive_exceptions.js";

function failwith(s) {
Expand All @@ -18,7 +19,7 @@ function invalid_arg(s) {
};
}

let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Pervasives.Exit");
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Exit");

function abs(x) {
if (x >= 0) {
Expand Down Expand Up @@ -115,28 +116,6 @@ function $at(l1, l2) {
}
}

let Pervasives = {
failwith: failwith,
invalid_arg: invalid_arg,
Exit: Exit,
abs: abs,
lnot: lnot,
max_int: 2147483647,
min_int: min_int,
infinity: Infinity,
neg_infinity: -Infinity,
max_float: 1.79769313486231571e+308,
min_float: 2.22507385850720138e-308,
epsilon_float: 2.22044604925031308e-16,
classify_float: classify_float,
char_of_int: char_of_int,
string_of_bool: string_of_bool,
bool_of_string: bool_of_string,
bool_of_string_opt: bool_of_string_opt,
int_of_string_opt: int_of_string_opt,
$at: $at
};

let max_int = 2147483647;

let infinity = Infinity;
Expand All @@ -149,8 +128,9 @@ let min_float = 2.22507385850720138e-308;

let epsilon_float = 2.22044604925031308e-16;

let panic = $$Error.panic;

export {
Pervasives,
failwith,
invalid_arg,
Exit,
Expand All @@ -170,5 +150,6 @@ export {
bool_of_string_opt,
int_of_string_opt,
$at,
panic,
}
/* No side effect */
142 changes: 0 additions & 142 deletions lib/es6/RescriptCore.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/js/Global.js

This file was deleted.

29 changes: 5 additions & 24 deletions lib/js/Pervasives.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

let $$Error = require("./Error.js");
let Primitive_exceptions = require("./Primitive_exceptions.js");

function failwith(s) {
Expand All @@ -18,7 +19,7 @@ function invalid_arg(s) {
};
}

let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Pervasives.Exit");
let Exit = /* @__PURE__ */Primitive_exceptions.create("Pervasives.Exit");

function abs(x) {
if (x >= 0) {
Expand Down Expand Up @@ -115,28 +116,6 @@ function $at(l1, l2) {
}
}

let Pervasives = {
failwith: failwith,
invalid_arg: invalid_arg,
Exit: Exit,
abs: abs,
lnot: lnot,
max_int: 2147483647,
min_int: min_int,
infinity: Infinity,
neg_infinity: -Infinity,
max_float: 1.79769313486231571e+308,
min_float: 2.22507385850720138e-308,
epsilon_float: 2.22044604925031308e-16,
classify_float: classify_float,
char_of_int: char_of_int,
string_of_bool: string_of_bool,
bool_of_string: bool_of_string,
bool_of_string_opt: bool_of_string_opt,
int_of_string_opt: int_of_string_opt,
$at: $at
};

let max_int = 2147483647;

let infinity = Infinity;
Expand All @@ -149,7 +128,8 @@ let min_float = 2.22507385850720138e-308;

let epsilon_float = 2.22044604925031308e-16;

exports.Pervasives = Pervasives;
let panic = $$Error.panic;

exports.failwith = failwith;
exports.invalid_arg = invalid_arg;
exports.Exit = Exit;
Expand All @@ -169,4 +149,5 @@ exports.bool_of_string = bool_of_string;
exports.bool_of_string_opt = bool_of_string_opt;
exports.int_of_string_opt = int_of_string_opt;
exports.$at = $at;
exports.panic = panic;
/* No side effect */
Loading

0 comments on commit 01daa07

Please sign in to comment.