# - - - S c a n . t a b
def tab ( self, p ):
'''Move to position p in the current line.
'''
#-- 1 --
# [ newPos := effective-pos(p) ]
newPos = self.__effPos ( p )
The rest of the logic is similar to Section 28, “Scan.move(): Advance the scan position”, as if we were moving the position by an amount newPos-self.pos).
#-- 2 --
# [ if newPos is within the current line ->
# self := self positioned at newPos in the current line
# return text between self's current position and newPos
# else -> raise IndexError ]
return self.move ( newPos - self.pos )