summaryrefslogtreecommitdiffstats
path: root/main.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-08-22 13:38:47 -0400
committerBrian Cully <bjc@spork.org>2025-08-22 14:42:36 -0400
commit79441128958669b16ce8dfe39a3684069921f604 (patch)
tree4112092916e7bf568cc67e6bcd0621779e2d6eae /main.mjs
parent4f7bbbf4ee269ef6638c69fc5982b0dfe4b8b947 (diff)
downloadautomathon-79441128958669b16ce8dfe39a3684069921f604.tar.gz
automathon-79441128958669b16ce8dfe39a3684069921f604.zip
make compile button actually compile
Diffstat (limited to 'main.mjs')
-rw-r--r--main.mjs21
1 files changed, 11 insertions, 10 deletions
diff --git a/main.mjs b/main.mjs
index 2df434f..c07dccd 100644
--- a/main.mjs
+++ b/main.mjs
@@ -1,21 +1,22 @@
-import init from './pkg/automathon.js';
+import init, { compile, run, tick } from './pkg/automathon.js';
async function loaded() {
console.debug('running init');
const mod = await init();
console.debug('init done', mod);
- document.querySelector("#compile").onclick = e => {
- console.debug("compile clicked", e);
- mod.compile();
+ document.querySelector('#compile').onclick = e => {
+ console.debug('compile clicked', e);
+ let text = document.querySelector('textarea').textContent;
+ compile(text);
};
- document.querySelector("#tick").onclick = e => {
- console.debug("tick clicked", e);
- mod.tick();
+ document.querySelector('#tick').onclick = e => {
+ console.debug('tick clicked', e);
+ tick();
};
- document.querySelector("#run").onclick = e => {
- console.debug("run clicked", e);
- mod.run();
+ document.querySelector('#run').onclick = e => {
+ console.debug('run clicked', e);
+ run();
};
}