stevedlawrence commented on a change in pull request #214: Sequences and 
Separators Refactoring and Rewrite
URL: https://github.com/apache/incubator-daffodil/pull/214#discussion_r285135563
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SequenceGroup.scala
 ##########
 @@ -103,39 +101,44 @@ abstract class SequenceGroupTermBase(
 
   protected def hiddenGroupRefOption: PropertyLookupResult
 
-  /**
-   * True if this sequence group has syntactic features itself or
-   * within itself.
-   */
-  final lazy val hasStaticallyRequiredOccurrencesInDataRepresentation = {
-    // true if there are syntactic features
-    hasInitiator || hasTerminator ||
-      // or if any child of the sequence has statically required instances.
-      groupMembers.exists { 
_.hasStaticallyRequiredOccurrencesInDataRepresentation }
-  }
-
-  final override def hasKnownRequiredSyntax = LV('hasKnownRequiredSyntax) {
-    lazy val memberHasRequiredSyntax = 
groupMembers.exists(_.hasKnownRequiredSyntax)
-    lazy val prefixOrPostfixAndStaticallyRequiredInstance =
-      groupMembers.filter { _.isRepresented }.exists { 
_.hasStaticallyRequiredOccurrencesInDataRepresentation } &&
-        (hasPrefixSep || hasPostfixSep)
-    lazy val infixAnd2OrMoreStaticallyRequiredInstances =
-      groupMembers.filter { m => m.isRepresented && 
m.hasStaticallyRequiredOccurrencesInDataRepresentation }.length > 1 && 
hasInfixSep
-    lazy val sepAndArryaWith2OrMoreStaticallyRequiredInstances =
-      groupMembers.filter { m =>
-        m.isRepresented && 
m.hasStaticallyRequiredOccurrencesInDataRepresentation && (m match {
-          case e: ElementBase => e.minOccurs > 1
-          case _ => false
-        })
-      }.length > 0 && hasSeparator
-    val res =
-      hasInitiator ||
-        hasTerminator ||
+  final protected lazy val prefixOrPostfixAndStaticallyRequiredInstance =
+    representedMembers.exists { member =>
+      val res = member.hasStaticallyRequiredOccurrencesInDataRepresentation
+      res
+    } &&
+      (hasPrefixSep || hasPostfixSep)
+
+  final protected lazy val infixAndTwoOrMoreStaticallyRequiredInstances =
+    representedMembers.filter { m =>
+      val res = m.hasStaticallyRequiredOccurrencesInDataRepresentation
+      res
+    }.length > 1 && hasInfixSep
+
+  final protected lazy val sepAndArrayaWith2OrMoreStaticallyRequiredInstances =
+    representedMembers.filter { m =>
+      val res = m.hasStaticallyRequiredOccurrencesInDataRepresentation && (m 
match {
+        case e: ElementBase => e.minOccurs > 1
 
 Review comment:
   Same here, change to ``>= 2``?

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