fix: add dist-check guard + List<T> type parsing + state machine examples
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s
- check-dist.sh: Prevents DIST DESYNC by verifying all dist/*.js files
are newer than their src/*.ts sources. Fails build if stale.
- Makefile: Standard build targets (build/check-dist/test/recompile/clean)
- src/index.ts: Integrated dist freshness check before compilation
- src/parser.ts: Added List<T> type parsing alongside existing Set<T>/Map<K,V>
(e.g., 'log: List<LogEntry>' now parses as { type: 'list', elementType })
- examples/: Restored v0.3 state machine specs (TigerBeetleLedger,
AccountLedger, ToggleSwitch, TwoPhaseCommit)
- DIST DESYNC is a known recurring anti-pattern — this guard prevents it
Tests: 39/41 pass (2 pre-existing E2E WASM failures due to missing wabt)
This commit is contained in:
parent
7230650628
commit
a2f7b7b2e9
16 changed files with 408 additions and 9 deletions
30
examples/ToggleSwitch.speck
Normal file
30
examples/ToggleSwitch.speck
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
speck ToggleSwitch {
|
||||
// Simplest possible state machine: on/off toggle
|
||||
// Demonstrates the v0.3 imperative action body syntax
|
||||
|
||||
state {
|
||||
isOn: Bool
|
||||
}
|
||||
|
||||
init {
|
||||
isOn == false
|
||||
}
|
||||
|
||||
invariant SwitchConsistent {
|
||||
isOn in {true, false}
|
||||
}
|
||||
|
||||
action TurnOn {
|
||||
require not isOn
|
||||
isOn := true
|
||||
return isOn
|
||||
}
|
||||
|
||||
action TurnOff {
|
||||
require isOn
|
||||
isOn := false
|
||||
return isOn
|
||||
}
|
||||
|
||||
next: TurnOn | TurnOff
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue