stevedlawrence commented on a change in pull request #214: Sequences and
Separators Refactoring and Rewrite
URL: https://github.com/apache/incubator-daffodil/pull/214#discussion_r285159370
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/SequenceGrammarMixin.scala
##########
@@ -110,23 +110,32 @@ trait SequenceGrammarMixin extends GrammarMixin { self:
SequenceTermBase =>
case _ => (1, 1, null)
}
// don't require SSP unnecessarily
- val ssp = if (!hasSeparator) SeparatorSuppressionPolicy.AnyEmpty else
separatorSuppressionPolicy
+ val ssp =
+ if (!hasSeparator)
+ SeparatorSuppressionPolicy.AnyEmpty
+ else
+ separatorSuppressionPolicy
val res = (child, sequenceKind, ssp, ock, min, max) match {
case (e: EB, Ordered__, ___________, _________, ONE, ONE) => new
ScalarOrderedSequenceChild(this, e, groupIndex)
case (e: EB, _________, ___________, StopValue_, ___, __2) =>
e.subsetError("dfdl:occursCountKind 'stopValue' is not supported.")
case (_____, Unordered, ___________, __________, ___, __2) =>
this.subsetError("Unordered sequences are not supported.")
case (e: EB, Ordered__, ___________, Parsed____, ___, __2) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
case (e: EB, Ordered__, ___________, Fixed_____, ___, UNB) =>
e.SDE("occursCountKind='fixed' not allowed with unbounded maxOccurs")
+ case (e: EB, Ordered__, Never______, Implicit__, ___, UNB) if
!e.isLastDeclaredRepresentedInSequence => unboundedPositionalError(e)
+ case (e: EB, Ordered__, Trailing___, Implicit__, ___, UNB) if
!e.isLastDeclaredRepresentedInSequence => unboundedPositionalError(e)
+ case (e: EB, Ordered__, TrailingStr, Implicit__, ___, UNB) if
!e.isLastDeclaredRepresentedInSequence => unboundedPositionalError(e)
case (e: EB, Ordered__, ___________, Fixed_____, ___, `min`) => new
RepOrderedExactlyNSequenceChild(this, e, groupIndex, min)
case (e: EB, Ordered__, ___________, Fixed_____, ___, max) => {
Assert.invariant(min != max); e.SDE("occursCountKind='fixed' requires minOccurs
and maxOccurs to be equal (%d != %d)", min, max) }
case (e: EB, Ordered__, ___________, Expression, ___, __2) => new
RepOrderedExactlyTotalOccursCountSequenceChild(this, e, groupIndex)
case (e: EB, Ordered__, Never______, Implicit__, ___, UNB) =>
e.SDE("separatorSuppressionPolicy='never' with occursCountKind='implicit'
requires bounded maxOccurs.")
case (e: EB, Ordered__, Never______, Implicit__, ___, max) => new
RepOrderedExactlyNSequenceChild(this, e, groupIndex, max)
case (e: EB, Ordered__, Never______, ock /****/ , ___, __2) if (ock ne
null) => e.SDE("separatorSuppressionPolicy='never' not allowed in combination
with occursCountKind='" + ock + "'.")
- case (e: EB, Ordered__, Trailing___, Implicit__, ___, UNB) if
!e.isLastDeclaredRequiredElementOfSequence => e.SDE("occursCountKind='implicit'
with unbounded maxOccurs only allowed for last element of a sequence")
+ // case (e: EB, Ordered__, Trailing___, Implicit__, ___, UNB) if
!e.isLastDeclaredRepresentedInSequence =>
+ // e.SDE("occursCountKind='implicit' with unbounded maxOccurs
only allowed for last element of a sequence")
case (e: EB, Ordered__, Trailing___, Implicit__, ___, max) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
- case (e: EB, Ordered__, TrailingStr, Implicit__, ___, UNB) if
!e.isLastDeclaredRequiredElementOfSequence => e.SDE("occursCountKind='implicit'
with unbounded maxOccurs only allowed for last element of a sequence")
+ // case (e: EB, Ordered__, TrailingStr, Implicit__, ___, UNB) if
!e.isLastDeclaredRepresentedInSequence =>
+ // e.SDE("occursCountKind='implicit' with unbounded maxOccurs
only allowed for last element of a sequence")
Review comment:
Remove comments.
----------------------------------------------------------------
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