(self, ins, bytepos=None)
return current_line, linum + line, textpos + len(linum) + 1
Convert a tokenised program line to ascii text.
Convert a tokenised program line to ascii text.
Convert a tokenised program line to ascii text .
def detokenise_line(self, ins, bytepos=None):
        """Convert a tokenised program line to ascii text."""
        current_line = self.detokenise_line_number(ins)
        if current_line < 0:
            # detokenise_line_number has returned -1 and left us at: .. 00 | _00_ 00 1A
            # stream ends or end of file sequence \x00\x00\x1A
            return -1, b'', 0
        elif current_line == 0 and ins.peek() == b' ':
            # ignore up to one space after line number 0
            ins.read(1)
        linum = bytearray(b'%d' % (current_line,))
        # write one extra whitespace character after line number
        # unless first char is TAB
        if ins.peek() != b'\t':
            linum += bytearray(b' ')
        line, textpos = self.detokenise_compound_statement(ins, bytepos)
        return current_line, linum + line, textpos + len(linum) + 1
def detokenise_line ( self , ins , bytepos = None ) : current_line = self . detokenise_line_number ( ins ) if current_line < 0 : # detokenise_line_number has returned -1 and left us at: .. 00 | _00_ 00 1A # stream ends or end of file sequence \x00\x00\x1A return - 1 , b'' , 0 elif current_line == 0 and ins . peek ( ) == b' ' : # ignore up to one space after line number 0 ins . read ( 1 ) linum = bytearray ( b'%d' % ( current_line , ) ) # write one extra whitespace character after line number # unless first char is TAB if ins . peek ( ) != b'\t' : linum += bytearray ( b' ' ) line , textpos = self . detokenise_compound_statement ( ins , bytepos ) return current_line , linum + line , textpos + len ( linum ) + 1