Skip to content

Fix guarded SKIP in ALT to respect guard expression#82

Merged
associate-1 merged 1 commit intomainfrom
fix/guarded-skip-alt-77
Feb 23, 2026
Merged

Fix guarded SKIP in ALT to respect guard expression#82
associate-1 merged 1 commit intomainfrom
fix/guarded-skip-alt-77

Conversation

@associate-1
Copy link
Member

Summary

  • Fixes Support SKIP guard in ALT (condition & SKIP) #77: condition & SKIP in ALT now respects the guard expression instead of always executing the SKIP body
  • When a SKIP case has a guard, the generated default: body is wrapped in if guard { ... } so a false guard prevents execution
  • Adds parser test (TestAltBlockWithGuardedSkip) and two E2E tests covering guard TRUE and guard FALSE scenarios

Test plan

  • go test ./parser -run TestAltBlock — parser tests pass (including new guarded SKIP test)
  • go test ./codegen -run TestE2E_AltGuardedSkip — all three E2E ALT SKIP tests pass
  • go test ./... — full test suite passes

🤖 Generated with Claude Code

The codegen was emitting `default:` unconditionally for SKIP cases,
ignoring the guard expression. Now wraps the body in `if guard { ... }`
when a guard is present, so `FALSE & SKIP` correctly prevents the
SKIP branch from executing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@associate-1 associate-1 merged commit 5ded5ab 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 SKIP guard in ALT (condition & SKIP)

2 participants