Skip to content

Support scoped declarations in variant receive case bodies#87

Merged
associate-1 merged 1 commit intomainfrom
fix/variant-receive-scoped-decl-86
Feb 23, 2026
Merged

Support scoped declarations in variant receive case bodies#87
associate-1 merged 1 commit intomainfrom
fix/variant-receive-scoped-decl-86

Conversation

@associate-1
Copy link
Member

Summary

  • Fixes Support scoped declarations in variant receive case bodies #86: variant protocol receive (ch ? CASE) case bodies now support scoped declarations (e.g. BOOL x:, INT next:) followed by compound statements
  • Changes VariantCase.Body from single Statement to []Statement and uses parseBodyStatements(), matching the pattern already used by IF, CASE, and ALT
  • Updates all 7 codegen scanner/walker functions to iterate over the body slice

Test plan

  • New parser test (TestVariantReceiveScopedDecl) verifies multi-statement body parsing
  • New e2e test (TestE2E_VariantReceiveScopedDecl) transpiles, compiles, and runs a program with scoped declarations in variant case bodies
  • Full test suite passes (go test ./...)

🤖 Generated with Claude Code

Change VariantCase.Body from single Statement to []Statement and use
parseBodyStatements(), matching the pattern already used by IF, CASE,
and ALT. This allows case bodies to contain scoped declarations (e.g.
BOOL x:) followed by compound statements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@associate-1 associate-1 merged commit 32dedd5 into main Feb 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support scoped declarations in variant receive case bodies

2 participants