Next / Previous / Contents / Shipman's homepage

31. Scan.__effPos(): Calculate an effective position

logscan.py
# - - -   S c a n . _ _ e f f P o s

    def __effPos(self, p):
        '''Return the equivalent position for position p.

          [ p is an int ->
              return effective-pos(p) ]
        '''

For the definition of the effective-pos verification function, see Section 21, “The Scan class”.

logscan.py
        if p < 0:
            return len(self.line) + 1 + p
        else:
            return p