You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/01/02 14:25:31 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #309: Fixed incorrect separator suppression with ock=expression

mbeckerle commented on a change in pull request #309: Fixed incorrect separator suppression with ock=expression
URL: https://github.com/apache/incubator-daffodil/pull/309#discussion_r362489668
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/SequenceChild.scala
 ##########
 @@ -532,15 +532,28 @@ class RepOrderedExactlyNSequenceChild(sq: SequenceTermBase, e: ElementBase, grou
 
 }
 
-class RepOrderedExactlyTotalOccursCountSequenceChild(sq: SequenceTermBase, e: ElementBase, groupIndex: Int)
+class RepOrderedExpressionOccursCountSequenceChild(sq: SequenceTermBase, e: ElementBase, groupIndex: Int)
   extends RepElementSequenceChild(sq, e, groupIndex) {
 
   lazy val sequenceChildParser: SequenceChildParser = sq.hasSeparator match {
-    case true => new RepOrderedExactlyTotalOccursCountSeparatedSequenceChildParser(
+    case true => new RepOrderedExpressionOccursCountSeparatedSequenceChildParser(
       childParser, e.occursCountEv, srd, erd, sepParser, sq.separatorPosition, separatedHelper)
-    case false => new RepOrderedExactlyTotalOccursCountUnseparatedSequenceChildParser(childParser, e.occursCountEv, srd, erd,
+    case false => new RepOrderedExpressionOccursCountUnseparatedSequenceChildParser(childParser, e.occursCountEv, srd, erd,
       unseparatedHelper)
   }
+
+  // This class is only used for sequences with occursCountKind="expression",
+  // which means that the separatorSuppressionPolicy is not applicable and the
+  // implied behavior is separatorSuppresionPolicy="never"
+  override lazy val sequenceChildUnparser: SequenceChildUnparser = sq.hasSeparator match {
 
 Review comment:
   Looks like this crazy factoring of the sequences stuff does work. This fix was straightforward and didn't require any refactoring. 

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


With regards,
Apache Git Services