tuxji commented on code in PR #981:
URL: https://github.com/apache/daffodil/pull/981#discussion_r1129895637
##########
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/unparsers/runtime1/DelimiterUnparsers.scala:
##########
@@ -54,6 +55,15 @@ class DelimiterTextUnparser(
s"Unparsing starting at bit position:
${state.dataOutputStream.maybeAbsBitPos0b}",
)
+ // Do not emit the delimiter if the value is empty and the
emptyValueDelimiterPolicy
+ // indicates it should be suppressed
+ if (state.currentInfosetNode.isSimple) {
+ val node = state.currentInfosetNode.asSimple
+ if (node.hasValue && node.isEmpty && !requiredOnEmptyValue) {
+ return
Review Comment:
Good point. The whole function is about 60 lines long and the return occurs
10 lines into the function's body. The rest of the function would have to be
wrapped in an if-block, or the function refactored to call sub-functions which
do the rest of the work. I'm fine with the return if others agree.
--
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]