-
-
Notifications
You must be signed in to change notification settings - Fork 2
Evaluator: implement relative offset resolution #38
Copy link
Copy link
Labels
compatibilitylibmagic compatibility and migrationlibmagic compatibility and migrationenhancementNew feature or requestNew feature or requestevaluatorRule evaluation engine and logicRule evaluation engine and logicpriority:highImportant, significant compatibility or architecture impactImportant, significant compatibility or architecture impact
Milestone
Metadata
Metadata
Assignees
Labels
compatibilitylibmagic compatibility and migrationlibmagic compatibility and migrationenhancementNew feature or requestNew feature or requestevaluatorRule evaluation engine and logicRule evaluation engine and logicpriority:highImportant, significant compatibility or architecture impactImportant, significant compatibility or architecture impact
Type
Fields
Give feedbackNo fields configured for Feature.
Summary
Implement evaluation of relative offsets. The AST representation (
OffsetSpec::Relative) already exists, but the evaluator returns a "not yet implemented" error atsrc/evaluator/offset.rs:167.Context
Relative offsets use the syntax
&+Nor&-Nto reference positions relative to the end of the previous match. This enables sequential field parsing where each field follows the previous one without hardcoding absolute positions.Current state: AST variant defined, evaluation stubbed with TODO.
Acceptance Criteria
resolve_offset()handlesOffsetSpec::Relativeusing the previous match's end positionImpact
MEDIUM-HIGH - Used in nested rule structures where child rules reference positions relative to parent matches.
Files to Modify
src/evaluator/offset.rs- Implement relative resolution (line ~167)src/evaluator/mod.rs- Track match position in evaluation contextReferences