Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 6, 2026

Summary

  • Split 989-line emit/mod.rs into focused modules: error.rs, string_table.rs, type_table.rs, emitter.rs
  • Renamed codegen_tests.rsemit_tests.rs for searchability (and all 58 snapshot files)
  • Added unit tests for StringTableBuilder (8 tests) and TypeTableBuilder (3 tests)
  • Removed decorative // ==== block separators from test files

Why

Fat mod.rs files make navigation harder and obscure module boundaries. The "thin mod.rs" pattern (re-exports only) improves discoverability and makes each component independently testable.

Notes

The new structure:

emit/
├── mod.rs              # 31 lines - only mod declarations + pub use
├── error.rs            # EmitError enum
├── string_table.rs     # StringTableBuilder + EASTER_EGG
├── type_table.rs       # TypeTableBuilder + DFS helpers
├── emitter.rs          # emit(), emit_linked() + serialization
├── layout.rs           # (unchanged)
├── emit_tests.rs       # Module-level integration tests
├── string_table_tests.rs  # Unit tests
└── type_table_tests.rs    # Unit tests

@zharinov zharinov enabled auto-merge (squash) January 6, 2026 14:01
@zharinov zharinov merged commit 23dadde into master Jan 6, 2026
4 checks passed
@zharinov zharinov deleted the refactor/emit-decompose branch January 6, 2026 14:02
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