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

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
 ##########
 @@ -596,6 +596,35 @@ trait SequenceRuntimeValuedPropertiesMixin
   with Sequence_AnnotationMixin
   with RawSequenceRuntimeValuedPropertiesMixin { decl: SequenceTermBase =>
 
+  final lazy val checkSeparatorTerminatorConflict: Unit = {
+    // if there is a possible terminator that could be after this,
+    // or enclosing group separator, that could be after this,
+    // then it has to not be ambiguous with this sequence's separator.
+    //
+    // TODO: The enclosing sequence object should really be passing a list of
+    // possible terminating markup down to each sequence child object.
+    // Those that aren't runtime-valued exprsesions could be checked for
+    // ambiguity.
+    //
+    // For now, we just check if this sequence itself has a constant
+    // separator and terminator that are the same.
+    if (hasTerminator) {
+      val termIsExpr = terminatorRaw.value.startsWith("{") &&
+        !terminatorRaw.value.startsWith("{{")
 
 Review comment:
   I'll fix the code duplication, and add points here to the scaladoc as to why 
this is not trying harder.
   
   In general it is hard to tell if two of these regex-ish delimiter things are 
going to accept overlapping strings, and since we can't really know until 
run-time anyway, and DFDL is defined to NOT actually check this at runtime, but 
to let the chips fall where they may given this sort of ambiguity...... I 
decided not to over invest in this checking.
   
   I think the goal is to check for silly cut-paste type mistakes. I.e., user 
accidently is using the same string for separator and terminator. Not really to 
try to see if two complex delimiters , one might accept a prefix of what the 
other accepts. 

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