Skip to content

refactor: pre-create evaluator submodules for v0.2.0 features #62

@unclesp1d3r

Description

@unclesp1d3r

Summary

v0.2.0 adds comparison operators (#34), bitwise XOR/NOT (#35), indirect offsets (#37), and relative offsets (#38). These features will add significant code to files that are already oversized:

  • evaluator/operators.rs (1,620 lines) will grow with comparison and bitwise operators
  • evaluator/offset.rs (475 lines) will grow with indirect/relative offset evaluation

Pre-creating focused submodules prevents these files from becoming unmanageable.

Proposal

Create the following submodule structure:

evaluator/
├── mod.rs              # Public API (after #58 split)
├── engine.rs           # Core evaluation logic (after #58 split)
├── offset.rs           # Absolute + from-end offsets (existing)
├── offset_indirect.rs  # Indirect offset resolution (#37)
├── offset_relative.rs  # Relative offset resolution (#38)
├── operators.rs        # Equality + bitwise AND (existing)
├── comparison.rs       # Comparison operators: >, <, >=, <= (#34)
├── bitwise.rs          # Bitwise XOR, NOT, any-value (#35)
├── strength.rs         # Strength calculation (existing)
└── types.rs            # Type reading (existing)

Alternatively, if the split is too granular:

evaluator/
├── operators/
│   ├── mod.rs          # Re-exports
│   ├── equality.rs     # =, !=, & (existing logic)
│   ├── comparison.rs   # >, <, >=, <=
│   └── bitwise.rs      # ^, ~, any-value
├── offset/
│   ├── mod.rs          # Re-exports + resolve_offset dispatcher
│   ├── absolute.rs     # Absolute + from-end
│   ├── indirect.rs     # Indirect resolution
│   └── relative.rs     # Relative resolution

Depends On

Acceptance Criteria

  • Submodule files created with appropriate module declarations
  • Existing code redistributed into new submodules
  • Public API unchanged (re-exports in place)
  • All tests pass
  • Each file under 600 lines

Blocked By

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestevaluatorRule evaluation engine and logicpriority:normalStandard work itemsize:SThis PR changes 10-29 lines, ignoring generated files.

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions