Thank you. I noticed that you committed the changes locally on the main branch. I think it would be better to do this as a PR on a fix branch. Are you able to move the commit onto a new branch then create the associated PR?
git branch fix/multi-statement-bodies && git reset --hard HEAD~1 && git checkout fix/multi-statement-bodies
HEAD is now at 5cbfc5a Merge pull request #22 from codeassociates/docs/consolidate-todo-implemented Switched to branch 'fix/multi-statement-bodies'
b088adc Support multi-statement bodies in IF/CASE/WHILE/ALT and call-site channel direction 5cbfc5a Merge pull request #22 from codeassociates/docs/consolidate-todo-implemented 461e4a2 Remove completed course.module section from TODO.md
remote: remote: Create a pull request for 'fix/multi-statement-bodies' on GitHub by visiting: remote: https://github.com/codeassociates/occam2go/pull/new/fix/multi-statement-bodies remote: To associate-1.github.com:codeassociates/occam2go.git * [new branch] fix/multi-statement-bodies -> fix/multi-statement-bodies branch 'fix/multi-statement-bodies' set up to track 'origin/fix/multi-statement-bodies'.
gh pr create --title "Support multi-statement bodies and call-site channel direction" --body "$(cat <<'EOF' ## Summary - **Fix parser infinite loop**: `Body` fields in `IfChoice`, `CaseChoice`, `WhileLoop`, and `AltCase` changed from `ast.Statement` to `[]ast.Statement`. New `parseBodyStatements()` helper parses all statements at the body's indentation level (with a no-progress safety guard), replacing the single `parseStatement()` call that caused infinite loops when branch bodies contained scoped declarations before processes. - **Handle call-site channel direction**: `parseProcCall()` now consumes optional `!`/`?` annotations after arguments (e.g., `worker(out!, in?)`), which are informational and ignored in codegen. - **Codegen updated**: All generators and scanner functions (`containsPar`, `containsPrint`, `containsTimer`, `containsStop`, `containsMostExpr`, `collectChanProtocols`, `collectRecordVars`) iterate over body slices. ## Test plan - [x] All existing tests pass (`go test ./...`) - [x] New parser unit tests: `TestMultiStatementIfBody`, `TestChannelDirAtCallSite` - [x] New e2e tests: `TestE2E_MultiStatementIfBody`, `TestE2E_MultiStatementCaseBody`, `TestE2E_MultiStatementWhileBody`, `TestE2E_ChannelDirAtCallSite` 🤖 Generated with [Claude Code](https://claude.com/claude-code) EOF )"
Done: https://github.com/codeassociates/occam2go/pull/23
The commit is now on fix/multi-statement-bodies and main is back to where it was before.
Switched to branch 'main' Your branch is up to date with 'origin/main'. From associate-1.github.com:codeassociates/occam2go 5cbfc5a..857246b main -> origin/main Updating 5cbfc5a..857246b Fast-forward CLAUDE.md | 3 +- TODO.md | 10 +-- ast/ast.go | 22 +++--- codegen/codegen.go | 172 +++++++++++++++++++++++++++----------------- codegen/e2e_control_test.go | 81 +++++++++++++++++++++ parser/parser.go | 95 +++++++++++++++++------- parser/parser_test.go | 106 +++++++++++++++++++++++++-- 7 files changed, 374 insertions(+), 115 deletions(-)