code wiki / _hdl_build / _pe_pub.nx
_pe_pub.nx source
↩ module page · 11 lines · 523 B
1// AUTHORED BY THE NISHI BUILDER (pattern: STATE_FLOW) -- transitions-table state machine, no Claude logic
2// -1 = ILLEGAL transition (refused, caller must handle). Table is the single source of truth.
3import "nx_syscalls.nx"
4func _pe_pub_step(state: i64, ev: i64) -> i64 {
5 if state == 0 { if ev == 0 { return 0 } }
6 if state == 0 { if ev == 1 { return 1 } }
7 if state == 1 { if ev == 0 { return 0 } }
8 if state == 1 { if ev == 2 { return 2 } }
9 if state == 2 { if ev == 0 { return 0 } }
10 return 0 - 1
11}