stevedlawrence commented on code in PR #1577:
URL: https://github.com/apache/daffodil/pull/1577#discussion_r2439933946
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -81,6 +82,20 @@ trait ElementBaseGrammarMixin
}
}
+ final lazy val checkDelimitedLengthEVDP: Unit = {
+ if (
+ optionEmptyValueDelimiterPolicy.isDefined
+ && emptyValueDelimiterPolicy != EmptyValueDelimiterPolicy.Both
+ && (hasInitiator || hasTerminator)
Review Comment:
In general I think we want to avoid checking if a property is defined, since
the property could be defined but not used, so we don't really care what its
value is. EVDP is only used if there are initiator/terminator delimiters, so I
think this could be something like:
```scala
if (
(hasInitiator || hasterminator) &&
emptyValueDelimiterPolicy != EmptyValueDelimiterPolicy.Both)
) {
SDW(...)
}
```
This way we only care about the value of EVDP if there are delimiters, and
if there are delimiters then it must exist and we warn if it's not "both".
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -81,6 +82,20 @@ trait ElementBaseGrammarMixin
}
}
+ final lazy val checkDelimitedLengthEVDP: Unit = {
+ if (
+ optionEmptyValueDelimiterPolicy.isDefined
+ && emptyValueDelimiterPolicy != EmptyValueDelimiterPolicy.Both
+ && (hasInitiator || hasTerminator)
+ ) {
+ SDW(
+ WarnID.EmptyValueDelimiterPolicyWarning,
+ "dfdl:emptyValueDelimiterPolicy='%s' will be ignored as it's only
implemented for 'both'",
+ emptyValueDelimiterPolicy
Review Comment:
We mention this in the unsupported features page.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]