stevedlawrence commented on a change in pull request #74: Daffodil trailing sep
URL: https://github.com/apache/incubator-daffodil/pull/74#discussion_r195058616
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/Term.scala
 ##########
 @@ -359,6 +360,25 @@ trait Term
   def isKnownRequiredElement = false
   def hasKnownRequiredSyntax = false
 
+  def hasPotentiallyTrailingInstances: Boolean = false
+  final def isPotentiallyTrailing = LV('isPotentiallyTrailing) {
+    if (!isRequired) {
+      val es = nearestEnclosingSequence
+      val res = es match {
+        case None => true
+        case Some(s) => {
+          val allRequired = s.groupMembers.filter(_.isRequired)
+          val lastDeclaredRequired = allRequired.last
+          if (s.groupMembers.indexOf(lastDeclaredRequired) < 
s.groupMembers.indexOf(this)) true
+          else false
+        }
+      }
+      res
+      // Since we can't determine at compile time, return false so that we can 
continue processing.
+      // Runtime checks will make final determination.
 
 Review comment:
   Why can't it be determined at compile time? Since this is about 
*potentially*, shouldn't be be able to know if something might be trailing or 
not?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to