-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
70 lines (61 loc) · 1.85 KB
/
index.html
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
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css">
</head>
<body>
<div id="root"></div>
<script id="sample-code" type="text/mono">Person(name, age, sub) {
return [name, age, sub || []]
}
flatten(hierarchy, result) {
push(result, hierarchy)
for (i, 0, len(hierarchy[2])) {
flatten(hierarchy[2][i], result)
}
}
main {
let hierarchy = Person('John', 35, [
Person('Jane', 25),
Person('Bob', 18, [
Person('Rick', 44)
]),
Person('Anna', 21)
])
let isUnder30 = ~p~ p[1] < 30
let getName = ~p~ p[0]
let byAge = ~p1, p2~ p2 - p1
let people = []
flatten(hierarchy, people)
let under30 = filter(people, isUnder30)
let namesByAge = map(sort(under30, byAge), getName)
map(namesByAge, prints)
let bye = byeGenerator()
prints(map(range(bye[1]), bye[0]))
}
byeGenerator {
let hello = '\nbye!'
let i = 0
return [
~~ hello[i++],
len(hello)
]
}</script>
<script>
modules = {}
</script>
<script src='lang/lexer.js'></script>
<script src='lang/parserScopeHelper.js'></script>
<script src='lang/parser.js'></script>
<script src='lang/stdlib.js'></script>
<script src='lang/evaluateHelpers.js'></script>
<script src='lang/evaluate.js'></script>
<script src='lang/executor.js'></script>
<script src='lang/debugger.js'></script>
<script src='ui/ha.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
<script src='ui/ui.js'></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>