stevedlawrence commented on a change in pull request #429:
URL: https://github.com/apache/incubator-daffodil/pull/429#discussion_r500518307
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/SequenceCombinator.scala
##########
@@ -98,8 +123,27 @@ class UnorderedSequence(sq: SequenceTermBase,
sequenceChildrenArg: Seq[SequenceC
import SeparatedSequenceChildBehavior._
+ private lazy val sepMtaGram = sq.delimMTA
+ // Note that we actually only every use one of these depending on depending
+ // on various factors. If there is an optional separtor and a suspension is
+ // used to unaprse that separator, then we cannot use the sepMtaUnaprser
+ // because it results in nested suspensions, which isn't allowed. In that
+ // case, the suspension ends up handling both the optional separator and
+ // alignment using sepMtaAlignmentMaybe.
+ private lazy val (sepMtaAlignmentMaybe, sepMtaUnparserMaybe) =
+ if (sepMtaGram.isEmpty) {
+ (MaybeInt.Nope, Maybe.Nope)
+ } else {
+ (MaybeInt(sq.knownEncodingAlignmentInBits), Maybe(sepMtaGram.unparser))
Review comment:
I've confirmed that we do not have any tests that trigger the situation
where we have a optional separator with MTA and a zero length field.
Maybe we can have string fields that are a non-byte size encoding, but
separators with byte size encoding? That would require MTA after unparsing a
field an before unparsing the separator. And we could have a field that is the
empty string, which should be zero 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]