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_r285129128
 
 

 ##########
 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:
   This seems to duplicate a lot of work that we already do in our 
terminator/separator evaluatables (e.g. evaluateng expression, cooking values). 
Would it make sense to just check if the ev's are both constant, and if so, get 
the delimiters and compare those?
   
   Also, what about more complex cases like ``FOO%WSP*;FOO`` and 
``FOO%WSP;FOO``? These are technically distict, but can still create 
ambiguities between separators and terminators. Should these cause an error?

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