jadams-tresys commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r320275655
 
 

 ##########
 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:
   While I am not 100%, I think most of the complicated separator logic is 
handled by the separator parser.  The OrderedSequnceParser also just prepends 
the separator parser to the list of sequence child parsers.
   From what I can tell, the complicated logic in the ordered parser simply 
isn't applicable to the unordered stuff as elements may not be in order and 
arrays may not be contiguous.  I've added several more tests to verify that 
separators are handled correctly and everything seems to be working correctly.

----------------------------------------------------------------
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

Reply via email to