(define target (car (parse-args)))
(define file (cadr (parse-args)))
+(define (read-prog port)
+ (if (port-input-empty? port)
+ '()
+ (cons (read) (read-prog port))))
+
(compile-to-binary
(if (eqv? file 'stdin)
- (read)
- (call-with-input-file file read))
+ (read-prog (current-input-port))
+ (call-with-input-file file read-prog))
"a.out" target)