stevedlawrence commented on a change in pull request #143: Support
dfdl:length="prefixed"
URL: https://github.com/apache/incubator-daffodil/pull/143#discussion_r239923098
##########
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:
I don't think there is any property combining going on. Some properties just
aren't allowed to be on the prefix type (e.g. alignment,separator, initiators,
leading/trailing skip). These all seem related to framing which kindof makes
sense since the prefix type is withing the framing of the element. So any
framing must comes from the element, and that surrounds both the prefix length
and the element. If framing properties were allowed on the prefix element then
you would have framing for the prefix inside framing of the elemtn, which seems
a bit odd. I imagine this was just to simplify things--prefix lenghts are
already kindof complicated.
For the example textNumberJustification/textTrimKind, that works as one
would expected (I have tests for this). If those properties are on the the
element then it affects the parsing of the element, if they are on the
simpleType then it affects the parsing of the prefix length.
----------------------------------------------------------------
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