(self, ins, lead, output)
Convert number token to Python string.
Convert number token to Python string.
Convert number token to Python string .
def _detokenise_number(self, ins, lead, output):
        """Convert number token to Python string."""
        ntrail = tk.PLUS_BYTES.get(lead, 0)
        trail = ins.read(ntrail)
        if lead == tk.T_OCT:
            output += b'&O' + self._values.from_bytes(trail).to_oct()
        elif lead == tk.T_HEX:
            output += b'&H' + self._values.from_bytes(trail).to_hex()
        elif lead == tk.T_BYTE:
            output += b'%d' % (ord(trail),)
        elif tk.C_0 <= lead <= tk.C_10:
            output += b'%d' % (ord(lead) - ord(tk.C_0),)
        elif lead in tk.LINE_NUMBER:
            # 0D: line pointer (unsigned int) - this token should not be here;
            #     interpret as line number and carry on
            # 0E: line number (unsigned int)
            output += b'%d' % (struct.unpack('<H', trail)[0],)
        elif lead in (tk.T_SINGLE, tk.T_DOUBLE, tk.T_INT):
            output += self._values.from_bytes(trail).to_str(leading_space=False, type_sign=True)
def _detokenise_number ( self , ins , lead , output ) : ntrail = tk . PLUS_BYTES . get ( lead , 0 ) trail = ins . read ( ntrail ) if lead == tk . T_OCT : output += b'&O' + self . _values . from_bytes ( trail ) . to_oct ( ) elif lead == tk . T_HEX : output += b'&H' + self . _values . from_bytes ( trail ) . to_hex ( ) elif lead == tk . T_BYTE : output += b'%d' % ( ord ( trail ) , ) elif tk . C_0 <= lead <= tk . C_10 : output += b'%d' % ( ord ( lead ) - ord ( tk . C_0 ) , ) elif lead in tk . LINE_NUMBER : # 0D: line pointer (unsigned int) - this token should not be here; #     interpret as line number and carry on # 0E: line number (unsigned int) output += b'%d' % ( struct . unpack ( '<H' , trail ) [ 0 ] , ) elif lead in ( tk . T_SINGLE , tk . T_DOUBLE , tk . T_INT ) : output += self . _values . from_bytes ( trail ) . to_str ( leading_space = False , type_sign = True )