Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 7, 2026

Summary

  • Add explicit Nav::Epsilon variant for epsilon transitions (replaces implicit detection via 3 conditions)
  • Add NodeTypeIR enum to distinguish Any/Named/Anonymous node constraints in Match instructions
  • Update bytecode header to 2+2+4 bit layout (segment, node_kind, opcode)

Why

Epsilon transitions were detected implicitly by checking nav == Stay && node_type == 0 && node_field.is_none(). This was fragile and spread across multiple locations. Explicit Nav::Epsilon makes the intent clear and simplifies is_epsilon() to a single comparison.

Similarly, node type constraints conflated "any node" (_), "any named node" ((_)), and "specific type" into a single u16 field using magic values. NodeTypeIR makes the three cases explicit and enables proper handling of anonymous nodes ("text" literals).

@zharinov zharinov force-pushed the refactor/node-type-ir branch 4 times, most recently from 13f519b to e69571f Compare January 7, 2026 20:19
- Add Nav::Epsilon variant for epsilon transitions
- Add NodeTypeIR enum to distinguish Any/Named/Anonymous node constraints
- Epsilon transitions no longer show `_` pattern (no node interaction)
- Add trace_nav_failure to show failed navigation attempts
- Update bytecode header to 2+2+4 bit layout
@zharinov zharinov force-pushed the refactor/node-type-ir branch from e69571f to e242e52 Compare January 7, 2026 20:21
@zharinov zharinov enabled auto-merge (squash) January 7, 2026 20:23
@zharinov zharinov changed the title refactor: Add explicit Nav::Epsilon and NodeTypeIR enum refactor: Change bytecode to distinguish named and anonymous nodes Jan 7, 2026
@zharinov zharinov merged commit 097dde7 into master Jan 7, 2026
4 checks passed
@zharinov zharinov deleted the refactor/node-type-ir branch January 7, 2026 20:24
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