-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
34 lines (33 loc) · 989 Bytes
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>UPL JS Test</title>
</head>
<body>
<script type="text/javascript" src="./target/scala-2.13/upl-fastopt/main.js"></script>
<script type="text/javascript">
var prog = null
function check() {
var pS = document.getElementById("progIn").value
prog = UPL.checkProgram(pS)
document.getElementById("progOut").value = UPL.print(prog)
}
function eval() {
var eS = document.getElementById("in").value
var eI = UPL.runIn(prog, eS)
document.getElementById("out").value = UPL.print(eI)
}
</script>
<div>
<textarea id="progIn">module M {x = 1}</textarea>
<button onclick="check()">Check</button>
<textarea id="progOut"></textarea>
</div>
<div>
<textarea id="in">M.x</textarea>
<button onclick="eval()">Evaluate</button>
<textarea id="out"></textarea>
</div>
</body>
</html>