(self)
return word
Read decimal literal.
Read decimal literal.
Read decimal literal .
def _read_dec(self):
        """Read decimal literal."""
        have_exp = False
        have_point = False
        word = b''
        while True:
            c = self.read(1).upper()
            if not c:
                break
            elif c == b'.' and not have_point and not have_exp:
                have_point = True
                word += c
            elif c in b'ED' and not have_exp:
                # there's a special exception for number followed by EL or EQ
                # presumably meant to protect ELSE and maybe EQV ?
                if c == b'E' and self.peek().upper() in (b'L', b'Q'):
                    self.seek(-1, 1)
                    break
                else:
                    have_exp = True
                    word += c
            elif c in b'-+' and (not word or word[-1:] in b'ED'):
                # must be first character or in exponent
                word += c
            elif c in DIGITS + self.blanks + b'\x1c\x1d\x1f':
                # '\x1c\x1d\x1f' are ASCII separators
                # - these cause string representations to evaluate to zero
                # we'll remove blanks later but need to keep it for now
                # so we can reposition the stream on removing trailing whitespace
                word += c
            elif c in b'!#' and not have_exp:
                word += c
                # must be last character
                break
            elif c == b'%':
                # swallow a %, but break parsing
                break
            else:
                self.seek(-1, 1)
                break
        # don't claim trailing whitespace
        trimword = word.rstrip(self.blanks)
        self.seek(-len(word) + len(trimword), 1)
        # remove all internal whitespace
        word = trimword.strip(self.blanks)
        return word
def _read_dec ( self ) : have_exp = False have_point = False word = b'' while True : c = self . read ( 1 ) . upper ( ) if not c : break elif c == b'.' and not have_point and not have_exp : have_point = True word += c elif c in b'ED' and not have_exp : # there's a special exception for number followed by EL or EQ # presumably meant to protect ELSE and maybe EQV ? if c == b'E' and self . peek ( ) . upper ( ) in ( b'L' , b'Q' ) : self . seek ( - 1 , 1 ) break else : have_exp = True word += c elif c in b'-+' and ( not word or word [ - 1 : ] in b'ED' ) : # must be first character or in exponent word += c elif c in DIGITS + self . blanks + b'\x1c\x1d\x1f' : # '\x1c\x1d\x1f' are ASCII separators # - these cause string representations to evaluate to zero # we'll remove blanks later but need to keep it for now # so we can reposition the stream on removing trailing whitespace word += c elif c in b'!#' and not have_exp : word += c # must be last character break elif c == b'%' : # swallow a %, but break parsing break else : self . seek ( - 1 , 1 ) break # don't claim trailing whitespace trimword = word . rstrip ( self . blanks ) self . seek ( - len ( word ) + len ( trimword ) , 1 ) # remove all internal whitespace word = trimword . strip ( self . blanks ) return word