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