(self, ins, outs)
Convert an ascii line number to tokenised start-of-line.
Convert an ascii line number to tokenised start-of-line.
Convert an ascii line number to tokenised start - of - line .
def _tokenise_line_number(self, ins, outs):
        """Convert an ascii line number to tokenised start-of-line."""
        linenum = ins.read_line_number()
        if linenum is not None:
            # NUL terminates last line and fills up the first char in the buffer
            # (that would be the magic number when written to file)
            # in direct mode, we'll know to expect a line number if the output
            # starts with a NUL
            # next two bytes are for internal use and at this point
            # can be anything nonzero; we use this.
            outs.write(b'\x00\xC0\xDE' + struct.pack('<H', linenum))
            # ignore single whitespace after line number, if any,
            # unless line number is zero (as does GW)
            if ins.peek() == b' ' and linenum != 0:
                ins.read(1)
        else:
            # direct line; internally, we need an anchor for the program pointer,
            # so we encode a ':'
            outs.write(b':')
def _tokenise_line_number ( self , ins , outs ) : linenum = ins . read_line_number ( ) if linenum is not None : # NUL terminates last line and fills up the first char in the buffer # (that would be the magic number when written to file) # in direct mode, we'll know to expect a line number if the output # starts with a NUL # next two bytes are for internal use and at this point # can be anything nonzero; we use this. outs . write ( b'\x00\xC0\xDE' + struct . pack ( '<H' , linenum ) ) # ignore single whitespace after line number, if any, # unless line number is zero (as does GW) if ins . peek ( ) == b' ' and linenum != 0 : ins . read ( 1 ) else : # direct line; internally, we need an anchor for the program pointer, # so we encode a ':' outs . write ( b':' )