(accept-token redcode-irx #t)
(let loop ((instrs '())
(offset 0)
- (name '())
- (author '()))
+ (name #f)
+ (author "Unspecified"))
(let ((this-line (line)))
(if this-line
(case (car this-line)
((comment) (loop instrs offset name author))
((org) (loop instrs (cdr this-line) name author))
((instr) (loop (cons (cdr this-line) instrs) offset name author)))
- (make-prog name author (reverse instrs) offset)))))
+ (begin
+ (if (and name (not (null? instrs)))
+ (make-prog name author (reverse instrs) offset)
+ (error "Failed to parse name and/or instructions")))))))
(define (line)
(or (name-line)