mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Consider unterminated strings as read-error
This commit is contained in:
parent
104811942f
commit
ab39f12904
2 changed files with 3 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
||||||
(else (lp (cdr files) (append (read-sexps (car files) #t) res))))))))
|
(else (lp (cdr files) (append (read-sexps (car files) #t) res))))))))
|
||||||
|
|
||||||
(define (read-error? x)
|
(define (read-error? x)
|
||||||
(and (error-object? x) (eq? 'read (exception-kind x))))
|
(and (error-object? x) (memq (exception-kind x) '(read read-incomplete)) #t))
|
||||||
|
|
||||||
(define (file-error? x)
|
(define (file-error? x)
|
||||||
(and (error-object? x) (eq? 'file (exception-kind x))))
|
(and (error-object? x) (eq? 'file (exception-kind x))))
|
||||||
|
|
|
@ -1778,6 +1778,8 @@
|
||||||
(read-error? (guard (exn (else exn)) (error "BOOM!"))))
|
(read-error? (guard (exn (else exn)) (error "BOOM!"))))
|
||||||
(test #t
|
(test #t
|
||||||
(read-error? (guard (exn (else exn)) (read (open-input-string ")")))))
|
(read-error? (guard (exn (else exn)) (read (open-input-string ")")))))
|
||||||
|
(test #t
|
||||||
|
(read-error? (guard (exn (else exn)) (read (open-input-string "\"")))))
|
||||||
|
|
||||||
(define something-went-wrong #f)
|
(define something-went-wrong #f)
|
||||||
(define (test-exception-handler-1 v)
|
(define (test-exception-handler-1 v)
|
||||||
|
|
Loading…
Add table
Reference in a new issue