You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/06/04 19:39:24 UTC

[GitHub] [incubator-daffodil] jadams-tresys commented on a change in pull request #218: Implement dfdl:choiceLength='explicit'

jadams-tresys commented on a change in pull request #218: Implement dfdl:choiceLength='explicit'
URL: https://github.com/apache/incubator-daffodil/pull/218#discussion_r290463690
 
 

 ##########
 File path: daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SpecifiedLengthUnparsers.scala
 ##########
 @@ -428,3 +429,20 @@ class SpecifiedLengthPrefixedUnparser(
   }
 
 }
+
+class ChoiceLengthUnparser(
+  eUnparser: Unparser,
+  rd: TermRuntimeData)
+  extends CombinatorUnparser(rd)
+  with CaptureUnparsingValueLength {
+
+  override lazy val runtimeDependencies = Vector()
+  override lazy val childProcessors = Vector(eUnparser)
+
+  override def unparse(state: UState): Unit = {
+    val elem = state.currentInfosetNode.asInstanceOf[DIElement]
+    captureValueLengthStart(state, elem)
+    eUnparser.unparse1(state)
+    captureValueLengthEnd(state, elem)
+  }
 
 Review comment:
   I believe I have now implemented this correctly in the most recent commit

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services