<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_ascii_block(self, block_length, data):
 """ add a block of ASCII BASIC source code lines. 41 41 Bytes parsed 10 PRINT "TEST" 20 PRINT "HELLO WORLD!" """

        data = iter(data)

        data.next() # Skip first \r
        byte_count = 1 # incl. first \r
        while True:
            code = iter(data.next, 0xd) # until \r
            code = "".join([chr(c) for c in code])

            if not code:
                log.warning("code ended.")
                break

            byte_count += len(code) + 1 # and \r consumed in iter()

            try:
                line_number, code = code.split(" ", 1)
            except ValueError, err:
                print "\nERROR: Splitting linenumber in %s: %s" % (repr(code), err)
                break

            try:
                line_number = int(line_number)
            except ValueError, err:
                print "\nERROR: Part '%s' is not a line number!" % repr(line_number)
                continue

            self.code_lines.append(
                CodeLine(None, line_number, code)
            )

        print "%i Bytes parsed" % byte_count
        if block_length != byte_count:
            log.error(
                "Block length value %i is not equal to parsed bytes!" % block_length
            )