Skip to content

Conversation

@olabusayoT
Copy link
Contributor

  • Implement logic to calculate prefix, infix, and postfix separator alignments and lengths in sequence terms.
  • Updated priorAlignmentApprox and endingAlignmentApprox to incorporate separator alignments and lengths when determining alignment.
  • Refactored encodingLengthApprox to reuse new separator-related alignment methods.
  • Added new test cases test_sep_alignment_1, test_sep_alignment_2, and test_sep_alignment_3 for validation of separator alignments.
  • Updated TDML files with corresponding test data and schema definitions.

DAFFODIL-2295

(Need to add ticket numbers to to-do, and running regression test suite to see if this broke anything)

- Implement logic to calculate prefix, infix, and postfix separator alignments and lengths in sequence terms.
- Updated `priorAlignmentApprox` and `endingAlignmentApprox` to incorporate separator alignments and lengths when determining alignment.
- Refactored `encodingLengthApprox` to reuse new separator-related alignment methods.
- Added new test cases `test_sep_alignment_1`, `test_sep_alignment_2`, and `test_sep_alignment_3` for validation of separator alignments.
- Updated TDML files with corresponding test data and schema definitions.

DAFFODIL-2295
@olabusayoT olabusayoT force-pushed the daf-2295-separator-alignment branch from 848e35f to 7111fa5 Compare November 24, 2025 23:00
Copy link
Member

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, question if we also need to consider model groups with separators

}
}

private lazy val priorAlignmentWithLeadingSkipApprox: AlignmentMultipleOf = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rename this, since it's now a bit more than just prior alignment with leading skip. I think it's correct to all separators, leading skip, initiators (not currently implemented), etc. as "framing"? So maybe this wants to be priorAlignmentWithLeftFramingApprox?

+ separatorLengthApprox
endingAlignmentWithSeparatorApprox
}
case mg: ModelGroup => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe model groups can also have postfix separators if the model group is a child of a separated sequence, so the above logic can't just be for ElementBase.

Does the postifx separator mta and length always needs to be added to the result of the match case? So where this thing ends (whether it be an element or a model group) we add the approximate alignment?

- Added `test_sep_alignment_4` to validate postfix separator alignment with complex nested sequences.
- Refactored alignment logic, renaming `priorAlignmentWithLeadingSkipApprox` to `priorAlignmentWithLeftFramingApprox` and introducing `endingAlignmentWithRightFramingApprox` to handle right framing more intuitively.

DAFFODIL-2295
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