forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb.js
85 lines (76 loc) · 1.33 KB
/
bb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
'use strict';
var Caml_builtin_exceptions = require("../../lib/js/caml_builtin_exceptions.js");
function f(x) {
if (x !== 98) {
if (x >= 99) {
return "c";
} else {
return "a";
}
} else {
return "b";
}
}
function ff(x) {
switch (x) {
case "a" :
return /* a */97;
case "b" :
return /* b */98;
case "c" :
return /* c */99;
default:
throw [
Caml_builtin_exceptions.assert_failure,
[
"bb.ml",
17,
9
]
];
}
}
function test(x) {
var match;
switch (x) {
case "a" :
match = /* a */97;
break;
case "b" :
match = /* b */98;
break;
case "c" :
match = /* c */99;
break;
default:
throw [
Caml_builtin_exceptions.assert_failure,
[
"bb.ml",
26,
13
]
];
}
if (match !== 98) {
if (match >= 99) {
return "c";
} else {
return "a";
}
} else {
return "b";
}
}
var test_poly = "a";
var c = f(/* a */97);
var d = f(/* b */98);
var e = f(/* c */99);
exports.f = f;
exports.ff = ff;
exports.test = test;
exports.test_poly = test_poly;
exports.c = c;
exports.d = d;
exports.e = e;
/* c Not a pure module */