mbeckerle commented on a change in pull request #88: Daffodil 1919 separators
URL: https://github.com/apache/incubator-daffodil/pull/88#discussion_r209076450
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ParticleMixin.scala
 ##########
 @@ -117,23 +140,31 @@ trait ParticleMixin extends RequiredOptionalMixin { 
self: ElementBase =>
       case _ => max.toInt
     }
   }
+  
+  /**
+   * Can have a varying number of occurrences.
+   */
+  final override lazy val isVariableOccurrences = minOccurs != maxOccurs
 
   final lazy val isFixedOccurrences = {
-    // TODO optimizations to take scope into consideration. E.g.,
+    // TODO maybe do optimizations to take scope into consideration. E.g.,
     // We could be in a context where the value of our occursCount expression
     // will always be a constant.
     occursCountKind == OccursCountKind.Fixed
   }
 
   /**
-   * Does this node have statically required instances.
+   * Does this node have statically required instances in the data stream.
+   *
+   * This excludes elements that have no representation e.g., elements with 
dfdl:inputValueCalc.
    */
   final def hasStaticallyRequiredInstances = 
LV('hasStaticallyRequiredInstances) {
+    // TODO: Rename to hasStaticallyRequiredOccurrencesInDataRepresentation
     val res =
       if (!isRepresented) false // if there's no rep, then it's not statically 
required.
       else if (isScalar) true
       else if (isFixedOccurrences) true
-      else if (minOccurs > 0) true
+      else if (minOccurs > 0) true // FIXME: should call isRequiredArrayElement
 
 Review comment:
   Nothing breaks.
   
   Done

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