         j += 1
       }
       if j >= len {
-        r = savei
         if consume {
           currentIndex += len
         }
-      }
-    }
-    return r
+        return savei
+      }
+    }
+    return -1
   }
 
   public mutating func eatOnEitherString(string1: String, string2: String)

      i += 1
    }
    if i > savei {
      r = i - savei
      if consume {
        currentIndex = i
      }
    }
    return r
  }

  public mutating func seekContext(fn: (c: UInt8) -> Bool) -> Bool {


  public mutating func matchContext(consume: Bool = false,
      fn: (c: UInt8) -> Bool) -> Int {
    var i = currentIndex
    let len = lineEndIndex
    while i < len {
      if fn(c: _bytes[i]) {
        if consume {
          currentIndex = i
          startIndex = i
        }
        return i
      }
      i += 1
    }
    return -1
  }

  public mutating func maybeEat(fn: (inout ctx: ByteStream) -> Bool) -> Bool {
