jadams-tresys commented on a change in pull request #473:
URL: https://github.com/apache/incubator-daffodil/pull/473#discussion_r561195468
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/VariableMap1.scala
##########
@@ -344,6 +346,16 @@ class VariableMap private(vTable: Map[GlobalQName,
ArrayBuffer[VariableInstance]
*/
def readVariable(vrd: VariableRuntimeData, referringContext: ThrowsSDE,
maybeState: Maybe[ParseOrUnparseState]): DataValuePrimitive = {
val varQName = vrd.globalQName
+ if (maybeState.isDefined) {
+ vrd.direction match {
+ case VariableDirection.ParseOnly if
(!maybeState.get.isInstanceOf[PState]) =>
+ maybeState.get.SDW("Attempting to read variable %s which is marked
as parseOnly during unparsing".format(varQName))
+ case VariableDirection.UnparseOnly if
(!maybeState.get.isInstanceOf[UState]) =>
+ maybeState.get.SDW("Attempting to read variable %s which is marked
as unparseOnly during parsing".format(varQName))
+ case _ => // Do nothing
Review comment:
This is the one thing I'm not sure about. It's an easy change to make,
but given that there is no spec for this feature I wasn't sure what we would
want to happen here.
----------------------------------------------------------------
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]