stevedlawrence commented on a change in pull request #143: Support
dfdl:length="prefixed"
URL: https://github.com/apache/incubator-daffodil/pull/143#discussion_r239891770
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/AlignedMixin.scala
##########
@@ -125,8 +126,8 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
}
private lazy val priorAlignmentApprox: AlignmentMultipleOf = {
- if (this.isInstanceOf[Root]) {
- AlignmentMultipleOf(0) // root is aligned with anything
+ if (this.isInstanceOf[Root] || this.isInstanceOf[DetachedElementDecl]) {
+ AlignmentMultipleOf(0) // root and detached elements are aligned with
anything
Review comment:
As I read the spec, alignment doesn't really apply to prefix lengths. When
parsing an element that has prefix length, alignment bits are skipped if
necessary based on the alignment of the element. Then the prefix length is
immediately parsed, then the element is immediately parsed. To ensure no
alignment is done, we just pretened that the prefixed element is aligned with
everything.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services