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_r175471532
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/PrimitivesElementKinds.scala
 ##########
 @@ -113,22 +113,21 @@ case class SequenceCombinator(sq: SequenceTermBase, 
rawTerms: Seq[Gram])
   extends Terminal(sq, true) {
 
   override lazy val isEmpty = {
-    val rt = rawTerms
-    val frt = rt.filterNot { _.isEmpty }
-    val res = frt.isEmpty
+    val ft = terms.filterNot { _.isEmpty }
+    val res = ft.isEmpty
     res
   }
 
-  private val mt: Gram = EmptyGram
-  lazy val body = rawTerms.foldRight(mt) { _ ~ _ }
-
-  lazy val terms = rawTerms.filterNot { _.isEmpty }
+  lazy val terms = rawTerms.filterNot{ _.isEmpty }
+  lazy val parsers = terms.map { term =>
+    term.parser
+  }.toVector
 
 Review comment:
   I have a comment below about things being a Seq[Parser]. So I guess although 
the type is a Seq, the underlying class will always be a Vector. I'd say we 
should be specific about the type and make it Vector[Parser]. Though, wondering 
if this should be an Array instead. If we're only using it for random access, I 
think Array is going to be more efficient.

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