(self)
Return signed value as integer token.
Return signed value as integer token.
Return signed value as integer token .
def to_token(self):
        """Return signed value as integer token."""
        if bytearray(self._buffer)[1] == 0:
            byte = bytearray(self._buffer)[0]
            # although there is a one-byte token for '10', we don't write it.
            if byte < 10:
                return int2byte(ord(tk.C_0) + byte)
            else:
                return tk.T_BYTE + int2byte(bytearray(self._buffer)[0])
        else:
            return tk.T_INT + self._buffer.tobytes()
def to_token ( self ) : if bytearray ( self . _buffer ) [ 1 ] == 0 : byte = bytearray ( self . _buffer ) [ 0 ] # although there is a one-byte token for '10', we don't write it. if byte < 10 : return int2byte ( ord ( tk . C_0 ) + byte ) else : return tk . T_BYTE + int2byte ( bytearray ( self . _buffer ) [ 0 ] ) else : return tk . T_INT + self . _buffer . tobytes ( )