mbeckerle commented on a change in pull request #561:
URL: https://github.com/apache/daffodil/pull/561#discussion_r631870984



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/dfa/Rules.scala
##########
@@ -123,6 +127,37 @@ abstract class State(states: => ArrayBuffer[State]) 
extends Serializable {
       }
     res
   }
+
+  object PauseRule extends Rule {
+    override def test(r: Registers): Boolean = couldBeFirstChar(r.data0, 
r.delimitersIter)
+
+    override def act(r: Registers): Unit = r.status = StateKind.Paused
+  }
+
+  object EndOfDataCharRule extends Rule {
+    override def test(r: Registers): Boolean = r.data0 == DFA.EndOfDataChar
+
+    override def act(r: Registers): Unit = r.nextState = DFA.EndOfData
+  }
+
+  object LookAheadEndOfDataCharRule extends Rule {
+    override def test(r: Registers): Boolean = r.data1 == DFA.EndOfDataChar
+
+    override def act(r: Registers): Unit = {
+      r.appendToField(r.data0)
+      r.nextState = DFA.EndOfData

Review comment:
       I really like this code cleanup.  
   
   I will create a separate JIRA issue about the codecov issues, because that's 
really not the responsibility of this change. It is of some concern to me if 
this specific code is not well covered by our tests. 




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


Reply via email to