Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 3, 2026

Summary

  • Use NonZeroU16 for StepId and StringId to make terminal state (0) unrepresentable
  • Add .get() accessor and ::new() constructor for type safety
  • Remove StepId::ACCEPT and Label::ACCEPT sentinels - terminal is now absence (empty successors)
  • Colorize dump output using the merged Colors module
  • Use shared formatting utilities from the merged format module

Changes

  • bytecode/ids.rs: StepId and StringId now wrap NonZeroU16
  • bytecode/dump.rs: Colorized output, uses format module utilities
  • bytecode/module.rs: Rename decode_step_viewdecode_step, add get_by_index for strings
  • compile/expressions.rs, emit/: Updated to use new API

Test plan

  • All 681 tests pass
  • Clippy passes

@zharinov zharinov enabled auto-merge (squash) January 3, 2026 12:10
@zharinov zharinov merged commit b58350c into master Jan 3, 2026
4 checks passed
@zharinov zharinov deleted the refactor/bytecode-nonzero branch January 3, 2026 12:11
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