stevedlawrence commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r318140182
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/grammar/SequenceGrammarMixin.scala
##########
@@ -135,7 +141,10 @@ trait SequenceGrammarMixin extends GrammarMixin { self:
SequenceTermBase =>
case (e: EB, Ordered__, TrailingStr, Implicit__, ___, UNB) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
case (e: EB, Ordered__, TrailingStr, Implicit__, ___, max) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
case (e: EB, Ordered__, Always_____, Implicit__, ___, max) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
- case (m: MG, Ordered__, ___________, __________, ___, __2) => new
ScalarOrderedSequenceChild(this, m, groupIndex)
+ case (e: EB, Unordered, ___________, Parsed____, ONE, ONE) => new
ScalarOrderedSequenceChild(this, e, groupIndex)
+ case (e: EB, Unordered, ___________, Parsed____, ___, max) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
+ case (e: EB, Unordered, ___________, __________, ___, __2) =>
e.SDE("When sequenceKind='unordered', occursCountKind must be 'parsed'")
Review comment:
This is interesting. I wonder if this is one of those cases where rather
than requiring that a property have a certain value (i.e.
occursCountKind="parse"), then instead we just assume that value? For example,
when type is xs:string we ignore dfdl:representation and just assume it has a
value.
Also, is seems odd that we have the case for Unordered, Parsed, ONE, ONE.
Since dfdl:occursCountKind="parsed" should ignore min/maxOccurs. Should we
have that case at all?
So, should there just be a single case that's something like:
```
case (e: EB, Unordered, ___________, __________, ___, __2) => new
RepOrderedWithMinMaxSequenceChild(this, e, groupIndex)
```
In otherwords, it doesn't care at all about occursCountKind or
min/maxOccurs. It also treats unordred elements the same?
----------------------------------------------------------------
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