stevedlawrence commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r318531351
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/SequenceParserBases.scala
##########
@@ -44,6 +49,23 @@ abstract class SequenceParserBase(
override lazy val childProcessors = childParsers
}
+abstract class UnorderedSequenceParserBase(
+ srd: SequenceRuntimeData,
+ choiceParser: ChoiceParser,
+ childParsersArg: Vector[Parser])
+ extends SequenceParserBase(srd, childParsersArg) {
+
+ override protected def parse(pstate: PState) = {
+
+ do {
+ choiceParser.parse(pstate)
+ } while (pstate.processorStatus eq Success)
Review comment:
Looking at this again, I have concerns this isn't right. This lass extends
SequenceParserBase, but the parse function doesn't use anything from that
class. It just calls the choiceParser a bunch. So all the logic related to
separators is never used. I suspect this tests only work because you prepend
the seprator parser ato the ChoiceParser children. But I think that ignores all
the separatorsuppresssion, prefix/infix/postfix, etc. logic that the separator
parsers implement.
I'm thinking what this really wants to do is do something like super.parse()
so that the Sequence separator logic is all handled by the sequence parsers,
and then do the sort at the end?
----------------------------------------------------------------
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