increment line counter only on real inputs (not evaluator messages)

svn: r12363
This commit is contained in:
Eli Barzilay 2008-11-09 07:25:36 +00:00
parent 1e3517d904
commit f85ab5567c

View File

@ -463,7 +463,8 @@
(and coverage? (lambda (es+get) (set! uncovered es+get)))) (and coverage? (lambda (es+get) (set! uncovered es+get))))
(channel-put result-ch 'ok)) (channel-put result-ch 'ok))
;; finally wait for interaction expressions ;; finally wait for interaction expressions
(let loop ([n 1]) (let ([n 0])
(let loop ()
(let ([expr (channel-get input-ch)]) (let ([expr (channel-get input-ch)])
(when (eof-object? expr) (channel-put result-ch expr) (user-kill)) (when (eof-object? expr) (channel-put result-ch expr) (user-kill))
(with-handlers ([void (lambda (exn) (with-handlers ([void (lambda (exn)
@ -473,6 +474,7 @@
(apply (evaluator-message-msg expr) (apply (evaluator-message-msg expr)
(evaluator-message-args expr))) (evaluator-message-args expr)))
(lambda () (lambda ()
(set! n (add1 n))
(eval* (input->code (list expr) 'eval n))))] (eval* (input->code (list expr) 'eval n))))]
[sec (and limits (car limits))] [sec (and limits (car limits))]
[mb (and limits (cadr limits))] [mb (and limits (cadr limits))]
@ -481,7 +483,7 @@
run)]) run)])
(channel-put result-ch (channel-put result-ch
(cons 'vals (call-with-values run list))))) (cons 'vals (call-with-values run list)))))
(loop (add1 n))))) (loop)))))
(define (user-eval expr) (define (user-eval expr)
(let ([r (if user-thread (let ([r (if user-thread
(begin (channel-put input-ch expr) (begin (channel-put input-ch expr)