     func void() -> Parser<()> {
         return (self) *> Parse.success(())
     }
+
+    func currentPosition() -> Parser<Int> {
+        return Parser { ($0.position, $0) }
+    }
+
+    func currentRow() -> Parser<Int> {
+        return Parser { ($0.row, $0) }
+    }
+
+    func currentCol() -> Parser<Int> {
+        return Parser { ($0.col, $0) }
+    }
+
+    func currentLocation() -> Parser<(row:Int, col:Int, pos:Int)> {
+        return tuple3 <§> currentRow() <*> currentCol() <*> currentPosition()
+    }
 }
 
 public postfix func *<PT:ParserType, T where PT.TokenType==T>(p:PT) -> Parser<List<T>> {


// MARK: ParserType extension

extension ParserType {
    func repeatMany() -> Parser<List<TokenType>> {
        return Parse.lazy(self.repeatOneOrMany()) <|> Parse.success(List<TokenType>.Nil)

    /// For backward compatiblity with prewritten tests.
    func parse(input: String) -> (token: Self.TokenType, output: String)? {
        let context = ParserContext(string: input)
        return self.parse(context).map { ($0.token, $0.output.string.substringFromIndex($0.output.index)) }
    }
}

public struct Parser<T> : ParserType {
