stevedlawrence commented on a change in pull request #55: Fixes the issue of 
separated empty optional elements, (ie. 1:2::4:5).
URL: https://github.com/apache/incubator-daffodil/pull/55#discussion_r175474249
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ElementKindParsers.scala
 ##########
 @@ -119,18 +119,26 @@ class DynamicEscapeSchemeParser(escapeScheme: 
EscapeSchemeParseEv,
   }
 }
 
-class SequenceCombinatorParser(rd: TermRuntimeData, bodyParser: Parser)
+class SequenceCombinatorParser(rd: TermRuntimeData, childParsers: Seq[Parser])
   extends CombinatorParser(rd) {
   override def nom = "Sequence"
 
   override lazy val runtimeDependencies = Nil
 
-  override lazy val childProcessors = Seq(bodyParser)
+  override lazy val childProcessors = childParsers
+
+  val numChildParsers = childParsers.size
 
   def parse(start: PState): Unit = {
+    var i: Int = 0
+
     start.mpstate.groupIndexStack.push(1L) // one-based indexing
 
-    bodyParser.parse1(start)
+    while (i < numChildParsers) {
+      val parser = childParsers(i)
 
 Review comment:
   I think this is wrong. Although the type is Seq, it is actually a Vector. 
I'd say change type to be Vector[Parser], or maybe Array[Parser]. I think 
Arrays or more efficient than vectors if all we need is random access.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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