aboutsummaryrefslogtreecommitdiffstats
path: root/examples/counter.aup
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-25 11:05:51 +0100
committereunhhu <[email protected]>2026-09-25 11:05:51 +0100
commit3e35975ee9120042baa0e8fe2bb2d52311204e84 (patch)
treec56902403251c964f493e69df7e343167e981a81 /examples/counter.aup
parente058795152fdb678aa71b67acd7a0fb44dabe747 (diff)
downloadaup-3e35975ee9120042baa0e8fe2bb2d52311204e84.tar.gz
aup-3e35975ee9120042baa0e8fe2bb2d52311204e84.zip
Compile v0a programs to verified Pure modules
aup check/build parse states, key inputs, views and handlers (with if/else and else-if), resolve names, generate forward-only stack code and encode a Pure module v1 deterministically. Diagnostics carry file:line:column. make check loads every module with Pure's verifier, checks determinism, 20 diagnostics and accepted forms, replacement by name, 600 generated programs and damaged sources (every emitted module verifies), and replays random event scripts against the workbench Zig engine: 16,667 snapshots across counter, toggle, charge, else-if and fault programs matched, including 921 failed events. The sanitizer-built compiler passes the same checks.
Diffstat (limited to 'examples/counter.aup')
-rw-r--r--examples/counter.aup9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/counter.aup b/examples/counter.aup
new file mode 100644
index 0000000..d966292
--- /dev/null
+++ b/examples/counter.aup
@@ -0,0 +1,9 @@
+# Space increments a count; views expose what a surface would show.
+state count = 0
+input tap = key Space
+view label = count
+view tile_width = 40 + min(count, 20) * 8
+
+on tap.down {
+ count = count + 1
+}