'consume() ahead until p==index; can\'t just set p=index as we must
update line and charPositionInLine.'

def seek(self, index):

    if (index <= self.p):
        self.p = index
        return
    while (self.p < index):
        self.consume()
