-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvars.js
74 lines (68 loc) · 2.21 KB
/
vars.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
var constants = ["π", "e", "i", "∞", "🎲"];
var variables = ["x", "y", "k"];
var strRepl = [
{from: ["\n"], to: ""},
{from: ["*", "times"], to: "×"},
{from: ["sqrt", "squareroot", "rt", "root"], to: "√"},
{from: ["curt", "crt", "cuberoot", "thrt", "thirdroot"], to: "∛"},
{from: ["tert", "tesseractroot", "frt", "fourthroot"], to: "∜"},
{from: ["pi"], to: "π"},
{from: ["infinity", "inf"], to: "∞"},
{from: ["sine"], to: "sin"},
{from: ["cosine"], to: "cos"},
{from: ["tangent"], to: "tan"},
{from: ["arc"], to: "a"},
{from: ["and", "&&", "⋏&", "&"], to: "⋏"},
{from: ["or", "||"], to: "⋎"},
{from: ["xor"], to: "⊻"},
{from: ["not"], to: "¬"},
{from: ["sign"], to: "sgn"},
{from: ["floor(", "floor", "trunc(", "trunc"], to: "⌊"},
{from: ["endfloor", "efl"], to: "⌋"},
{from: ["ceiling(", "ceiling", "ceil(", "ceil"], to: "⌈"},
{from: ["endceil", "ecl"], to: "⌉"},
{from: ["!!"], to: "‼"},
{from: ["sum", "sigma"], to: "Σ"},
{from: ["product", "prod"], to: "Π"},
{from: ["~"], to: "≈"},
{from: ["<_", "=<", "<⋎=", "=⋎<"], to: "≤"},
{from: [">_", ">=", ">⋎=", "=⋎>"], to: "≥"},
{ from: ["random", "rand"], to: "🎲" }
//{ from: ["date"], to: "📅"},
//{from: ["§§"], to: "½½½½½½"}
];
var parseList = [
[
{from: [","], to: parseBinOp}
],
[
{from: ["⋎", "⊻"], to: parseBinOp}
],
[
{from: ["⋏"], to: parseBinOp}
],
[
{from: ["=", "≈", "<", ">", "≤", "≥"], to: parseBinOp}
],
[
{from: ["+", "-" ], to: parseBinOp}
],
[
{from: ["×", "/"], to: parseBinOp}
],
[
{from: ["^"], to: parseBinOp}
],
[
{from: ["asin", "acos", "atan"], to: parseUnOp} //TODO: Arc functions shouldn't have their own list
],
[
{from: ["Σ", "Π", "lgn", "P", "C"], to: parseFunc}
],
[
{from: ["sin", "cos", "tan", "ln", "lg", "abs", "√", "∛", "∜", "¬", "sgn", "⌊", "⌈", "round", "!", "‼", "years", "months", "weeks", "days", "hours", "minutes", "seconds", "getSimpFail"], to: parseUnOp}
]
];
var x = "x";
var y = "y";
var k = "k";