cs: eval multiple expressions provided with -e

This commit is contained in:
Matthew Flatt 2019-12-17 07:30:47 -07:00
parent 899aa24756
commit d7f2bd3e15

View File

@ -371,10 +371,14 @@
(set! loads (set! loads
(cons (cons
(lambda () (lambda ()
(define i (open-input-string expr))
(let loop ()
(define expr (read i))
(unless (eof-object? expr)
(call-with-values (lambda () (call-with-values (lambda ()
(call-with-continuation-prompt (call-with-continuation-prompt
(lambda () (lambda ()
(eval `(|#%top-interaction| . ,(read (open-input-string expr))))) (eval `(|#%top-interaction| . ,expr)))
(default-continuation-prompt-tag) (default-continuation-prompt-tag)
(lambda (proc) (lambda (proc)
;; continue escape to set error status: ;; continue escape to set error status:
@ -383,7 +387,8 @@
(for-each (lambda (v) (for-each (lambda (v)
(|#%app| (current-print) v) (|#%app| (current-print) v)
(flush-output)) (flush-output))
vals)))) vals)))
(loop))))
loads)) loads))
(flags-loop rest-args (see saw 'non-config)))] (flags-loop rest-args (see saw 'non-config)))]
[("-k") [("-k")