Skip to content

Support standalone timer AFTER wait (#43)#103

Merged
associate-1 merged 1 commit intomainfrom
feat/standalone-timer-after-43
Mar 4, 2026
Merged

Support standalone timer AFTER wait (#43)#103
associate-1 merged 1 commit intomainfrom
feat/standalone-timer-after-43

Conversation

@associate-1
Copy link
Member

Summary

  • Adds support for tim ? AFTER expr as a standalone statement (outside ALT blocks), enabling sort_inside_2.occ to transpile successfully
  • Maps to time.Sleep(time.Duration(deadline - time.Now().UnixMicro()) * time.Microsecond) in Go
  • Adds TimerAfterWait AST node, parser handling in parseTimerRead(), and codegen generation

Test plan

  • New e2e test TestE2E_TimerAfterWait for standalone timer AFTER wait
  • All existing tests pass (go test ./...)
  • sort_inside_2.occ transpiles and passes go vet
  • Course module still transpiles and passes go vet

🤖 Generated with Claude Code

Previously `tim ? AFTER expr` was only supported inside ALT cases.
This adds support for it as a regular statement (e.g. in SEQ blocks),
which is needed by sort_inside_2.occ's delay.2 proc. Maps to
time.Sleep with microsecond duration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@associate-1 associate-1 merged commit 3088527 into main Mar 4, 2026
1 check passed
@dboreham dboreham deleted the feat/standalone-timer-after-43 branch March 4, 2026 16:40
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.

2 participants