You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by ja...@apache.org on 2020/07/31 14:41:18 UTC

[incubator-daffodil] 02/02: Added comment about PState.Mark's

This is an automated email from the ASF dual-hosted git repository.

jadams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git

commit 05d430d2b6f9c9c8c654f08a96d08ca630d0a5b6
Author: Josh Adams <ja...@tresys.com>
AuthorDate: Fri Jul 31 09:57:26 2020 -0400

    Added comment about PState.Mark's
---
 .../main/scala/org/apache/daffodil/processors/parsers/PState.scala   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PState.scala b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PState.scala
index 6cf5d64..8b3d8d7 100644
--- a/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PState.scala
+++ b/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PState.scala
@@ -169,7 +169,10 @@ final class PState private (
   /**
    * This stack tracks variables that have changed within the current point of
    * uncertainty. This tracking is necessary to revert changes made to variables
-   * when the parser needs to backtrack.
+   * when the parser needs to backtrack. This stack needs to be pushed when a
+   * new mark is created and popped when it is discarded or reset. It is
+   * necessary for every mark to either be discarded or reset to inorder for
+   * this stack to funciton correctly.
    */
   private val changedVariablesStack = new MStackOf[mutable.MutableList[GlobalQName]]()
   changedVariablesStack.push(mutable.MutableList[GlobalQName]())