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/09/01 19:31:29 UTC

[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #411: Added SDWs for discouraged assert and discriminator placements

mbeckerle commented on a change in pull request #411:
URL: https://github.com/apache/incubator-daffodil/pull/411#discussion_r481381261



##########
File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/SequenceGroup.scala
##########
@@ -147,6 +151,20 @@ abstract class SequenceGroupTermBase(
     }
   }.value
 
+  /**
+   * Provides validation for assert and discriminator placement
+   */
+  protected final lazy val checkIfNonEmptyAndDiscrimsOrAsserts: Unit = {
+      checkDiscrimAndAssertPlacement
+  }
+
+  private lazy val checkDiscrimAndAssertPlacement: Unit = {
+    if (groupMembers.size > 0 && discriminatorStatements.size > 0)
+      SDW(WarnID.DiscouragedDiscriminatorPlacement, "The recommended placement is after the target element.")
+    if (groupMembers.size > 0 && assertStatements.size > 0)
+      SDW(WarnID.DiscouragedAssertPlacement, "The recommended placement is after the target element.")
+  }
+

Review comment:
       I'm good with that phrasing. It's only 2 lines of text. 




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