jadams-tresys commented on a change in pull request #570:
URL: https://github.com/apache/daffodil/pull/570#discussion_r638833958
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
##########
@@ -654,6 +655,36 @@ trait SequenceRuntimeValuedPropertiesMixin
}
}
+ def checkDelimiterEscapeConflict(childTerm: Term): Unit = {
+ if (childTerm.optionEscapeScheme.isDefined &&
+ (childTerm.optionEscapeScheme.get.escapeKind ==
EscapeKind.EscapeCharacter) &&
+ (hasTerminator || hasSeparator)) {
+ val ecEv = childTerm.optionEscapeScheme.get.escapeCharacterEv
+ if (ecEv.isConstant) {
+ val ec = ecEv.constValue
+ var delims = Set[String]()
+
+ val termEv = this.terminatorParseEv
+ if (termEv.isConstant)
+ delims = delims ++ termEv.constValue.map { _.lookingFor }
+
+ val sepEv = this.separatorParseEv
+ if (sepEv.isConstant)
+ delims = delims ++ sepEv.constValue.map { _.lookingFor }
+
+ if (delims.exists { _.startsWith(ec) } )
+ SDE("The dfdl:terminator and dfdl:separator may not begin with the
dfdl:escapeCharacter: '%s'.", ec)
+
+ /*val maybeEecEv =
childTerm.optionEscapeScheme.get.optionEscapeEscapeCharacterEv
+ if (maybeEecEv.isDefined && maybeEecEv.get.isConstant) {
+ val eec = maybeEecEv.get.constValue
+ if (delims.exists { _.startsWith(eec) } )
+ SDE("The dfdl:terminator and dfdl:separator may not begin with the
dfdl:escapeEscapeCharacter: '%s'.", eec)
Review comment:
Does anyone else have any thoughts on if this code should be added or
not? Perhaps I send a message to the dev list.
--
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]