stevedlawrence commented on a change in pull request #218: Implement
dfdl:choiceLength='explicit'
URL: https://github.com/apache/incubator-daffodil/pull/218#discussion_r286264677
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/ChoiceCombinator.scala
##########
@@ -48,9 +50,22 @@ case class ChoiceCombinator(ch: ChoiceTermBase,
rawAlternatives: Seq[Gram])
override def isEmpty = super.isEmpty || alternatives.isEmpty
+ private lazy val bitsMultiplier = ch.lengthUnits match {
+ case LengthUnits.Bits => 1
+ case LengthUnits.Bytes => 8
+ case LengthUnits.Characters if ch.knownEncodingIsFixedWidth =>
ch.knownEncodingWidthInBits
+ case _ => 0 // zero means can't multiply to get width in bits.
+ }
Review comment:
Woudl that use lengthUnits, or what that use something like
choiceLengthUnits to match choiceLength? Our of curiosity, is there a reason
why we have both dfdl:choiceLength and dfdl:length?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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