(self, g)
Merge program from ascii or utf8 (if utf8_files is True) stream.
Merge program from ascii or utf8 (if utf8_files is True) stream.
Merge program from ascii or utf8 ( if utf8_files is True ) stream .
def merge(self, g):
        """Merge program from ascii or utf8 (if utf8_files is True) stream."""
        while True:
            line, cr = g.read_line()
            if not line and not cr:
                # end of file
                break
            elif cr is None:
                # line > 255 chars
                raise error.BASICError(error.LINE_BUFFER_OVERFLOW)
            linebuf = self.tokeniser.tokenise_line(line)
            if linebuf.read(1) == b'\0':
                # line starts with a number, add to program memory; store_line seeks to 1 first
                self.store_line(linebuf)
            else:
                # we have read the :
                if linebuf.skip_blank() not in tk.END_LINE:
                    raise error.BASICError(error.DIRECT_STATEMENT_IN_FILE)
def merge ( self , g ) : while True : line , cr = g . read_line ( ) if not line and not cr : # end of file break elif cr is None : # line > 255 chars raise error . BASICError ( error . LINE_BUFFER_OVERFLOW ) linebuf = self . tokeniser . tokenise_line ( line ) if linebuf . read ( 1 ) == b'\0' : # line starts with a number, add to program memory; store_line seeks to 1 first self . store_line ( linebuf ) else : # we have read the : if linebuf . skip_blank ( ) not in tk . END_LINE : raise error . BASICError ( error . DIRECT_STATEMENT_IN_FILE )