You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/01/20 18:47:57 UTC

[GitHub] [incubator-daffodil] jadams-tresys commented on a change in pull request #473: Implement variable direction property

jadams-tresys commented on a change in pull request #473:
URL: https://github.com/apache/incubator-daffodil/pull/473#discussion_r561194965



##########
File path: daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ExpressionEvaluatingUnparsers.scala
##########
@@ -77,30 +76,52 @@ final class SetVariableUnparser(
 
 }
 
+final class NewVariableInstanceSuspendableExpression(
+  override val expr: CompiledExpression[AnyRef],
+  override val rd: VariableRuntimeData)
+  extends SuspendableExpression {
+
+  override protected def processExpressionResult(ustate: UState, v: DataValuePrimitive): Unit = {
+    ustate.variableMap.newVariableInstance(rd, v)
+  }
+
+  override protected def maybeKnownLengthInBits(ustate: UState) = MaybeULong(0)
+}
+

Review comment:
       Hm, I think you might be right.  What probably needs to be done is to add an additional variable state, VariableSuspended, which is then changed once the expression evaluates.  Attempting to read or set a variable that is suspended would then also need to trigger a suspension.




----------------------------------------------------------------
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