stevedlawrence commented on a change in pull request #130: Initial commit
URL: https://github.com/apache/incubator-daffodil/pull/130#discussion_r229727631
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/EvDelimiters.scala
##########
@@ -65,10 +65,10 @@ abstract class DelimiterParseEv(delimType:
DelimiterTextType.Type, override val
}
val converterResult = evalAndConvert(state)
- if (converterResult.length == 1 && converterResult(0) == "") {
- Array()
- } else {
- CreateDelimiterDFA(delimType, trd, converterResult, ignoreCase)
+ (converterResult.length, converterResult(0)) match {
+ case (1, "") => Array()
+ case (_, "") => state.SDE("The string \"\" can only be used when
specified as the only delimiter, not as a member of a list of delimiters")
+ case (_, _) => CreateDelimiterDFA(delimType, trd, converterResult,
ignoreCase)
Review comment:
This fixes this for delimiters, but I wonder if there are other properties
that also handle leading/trailing spaces incorrectly? The various Cookers in
EntityReplacer.scala are the things that actually "cook" the properties values.
For example, ListOfStringLiteralBase splits a property value on whitespace. I
wonder if somewhere in those cookers would be a better place for the
leading/trailing whitespace check. That way this issue would be resolved for
all properties and not just delimiters.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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