Next / Previous / Contents / Shipman's homepage

32. Scan.isPos(): Is the current position a given value?

logscan.py
# - - -   S c a n . i s P o s

    def isPos(self, p):
        '''Is the current line at position p?
        '''

See Section 31, “Scan.__effPos(): Calculate an effective position” for the routine that converts negative positions to positive values.

logscan.py
        #-- 1 --
        # [ newP  :=  effective-pos(p) ]
        newP = self.__effPos(p)

        #-- 2 --
        return (self.pos == newP)