Thank you. I tested the life example manually and it does seem to build and run. I need to research how to drive it from the keyboard still but this work is ready to be merged I think.
Great to hear it actually runs! That's a satisfying result — from "doesn't parse" to interactive terminal program.
Let me merge the PR.
git -C /home/david/projects/code-associates/occam2go checkout main && git -C /home/david/projects/code-associates/occam2go pull 2>&1
Switched to branch 'main' Your branch is up to date with 'origin/main'. From associate-1.github.com:codeassociates/occam2go 3540129..814db69 main -> origin/main Updating 3540129..814db69 Fast-forward ast/ast.go | 15 ++++--- codegen/codegen.go | 25 +++++++---- historical-examples/life.occ | 103 +++++++++++++++++++++++++++++-------------- parser/parser.go | 13 +++--- 4 files changed, 102 insertions(+), 54 deletions(-)
Merged and up to date. As for driving it — based on the source, once running it should respond to keyboard input: E to enter edit mode (arrow keys to move, */space to toggle cells), R to run, S to stop, and Q to quit. You may need to put the terminal in raw mode first so single keypresses get through without waiting for Enter.
You're welcome! It's all right there in the source code — the new.activity function maps the keys, and the editor proc handles arrow keys and cell toggling. The original book actually documents it nicely with those inline comments. Enjoy experimenting with it!