mbeckerle commented on a change in pull request #207: Added support for 
enumerations and TypeValueCalc
URL: https://github.com/apache/incubator-daffodil/pull/207#discussion_r275559617
 
 

 ##########
 File path: daffodil-lib/src/main/scala/org/apache/daffodil/util/Cursor.scala
 ##########
 @@ -160,18 +196,24 @@ trait CursorImplMixin[AccessorType <: 
Accessor[AccessorType]] { self: Cursor[Acc
     val res = priorOpKind match {
       case Advance => {
         priorOpKind = Inspect
-        doAdvance(true)
+        doAdvance(true, true)
       }
-      case Inspect => true // inspect again does nothing.
+      case InspectPure => {
+        priorOpKind = Inspect
+        doAdvance(true, advanceInput=false)
+      }
+      case Inspect      => true // inspect again does nothing.
       case Unsuccessful => return false
     }
     // successful
     Assert.invariant(isFilled == true || !res)
     res
   }
 
-  private def doAdvance(isFilledValue: Boolean) = {
-    val res = fill()
+  //inpsectPure implemented in InfosetInputter.scala
+
+  private def doAdvance(isFilledValue: Boolean, advanceInput: Boolean) = {
 
 Review comment:
   The point of cursor is that unlike hasNext() and next() style APIs, one can 
advance cursors without any little crud objects being allocated. You advance 
the cursor and an accessor is modified to provide access to what is now "under" 
the cursor. This is ordinary APIs for big-data, e.g., database cursors. Inspect 
gives a 1 object look-ahead capability.  What does inspectPure add to this? 
Does it NOT provide access to the data being inspected? Is it just a test for 
whether there is or isn't a next?

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


With regards,
Apache Git Services

Reply via email to