Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 1, 2026

Summary

  • Reorganize bytecode emission tests from inline to file-based snapshots
  • Delete dump_tests.rs, consolidate all tests into codegen_tests.rs
  • Comprehensive coverage organized by language feature (51 tests)
  • Improve dump format readability

Dump format changes

Section names simplified:

  • [header][flags]
  • [types.defs][type_defs]
  • [types.members][type_members]
  • [types.names][type_names]
  • [entry][entrypoints]
  • [code][transitions]

Type definitions use cleaner syntax:

- T03 = Struct(M0, 1)  ; { name }
+ T03 = Struct  M0[1]  ; { name }

Members/names use arrow syntax:

- M0 = (S01, T02)  ; name: str
+ M0: S01 → T02  ; name: str

Test organization

51 tests organized by language feature:

  1. Nodes (named, anonymous, wildcard, error, missing)
  2. Captures (basic, multiple, nested, typed)
  3. Fields (single, multiple, negated)
  4. Quantifiers (optional, star, plus, non-greedy)
  5. Sequences (basic, nested, with captures)
  6. Alternations (unlabeled, labeled, in quantifiers)
  7. Anchors (between siblings, first/last child)
  8. Named expressions (definitions, references)
  9. Recursion (simple, structured result)
  10. Optionals (first child, null injection)

Test plan

  • All 51 tests pass

@zharinov zharinov merged commit 41f5649 into master Jan 1, 2026
4 checks passed
@zharinov zharinov deleted the refactor/bytecode-tests branch January 1, 2026 17:37
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