jadams-tresys commented on a change in pull request #218: Implement
dfdl:choiceLength='explicit'
URL: https://github.com/apache/incubator-daffodil/pull/218#discussion_r286963866
##########
File path:
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SpecifiedLength2.scala
##########
@@ -460,6 +463,64 @@ class ElementUnusedUnparser(
}
+/**
+ * This is basically a simplified version of the
ElementUnusedUnparserSuspendableOperation.
+ * For explicit length choices, we do not need to handle length expressions,
choiceLength is
+ * simply a non-negative integer.
+ */
+class ChoiceUnusedUnparserSuspendableOperation(
+ override val rd: TermRuntimeData,
+ targetLengthInBits: Long)
+ extends SuspendableOperation {
+
+ /**
+ * determine delta between value length and target length
+ *
+ * and skip that many bits.
+ */
+ override def continuation(ustate: UState) {
+ val e = ustate.currentInfosetNode.asInstanceOf[DIElement]
Review comment:
I've pushed up a test and it does indeed demonstrate the issues with using
valueLength instead of the choiceLength.
Also, for some reason this conversation was hidden by default and I missed
it the first time around. Wonder if there is a setting to not hid conversations.
----------------------------------------------------------------
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