fix exn raised in refab-struct read errors
Closes PR 11530
This commit is contained in:
parent
2b4f1a6908
commit
2ae9f14f9e
|
@ -1069,6 +1069,15 @@
|
|||
(err/rt-test (readstr "#s((v 0 (2 #f) #()) 1)") exn:fail:read?)
|
||||
(err/rt-test (readstr "#s((v 0 (2 #f) #(0)) 1)") exn:fail:read?)
|
||||
|
||||
(err/rt-test (readstr "#s(1 2)") (lambda (x)
|
||||
(and (exn:fail:read? x)
|
||||
(not (exn:fail:read:eof? x)))))
|
||||
(err/rt-test (readstr "#s(1 2") exn:fail:read:eof?)
|
||||
(err/rt-test (read-syntax 's (open-input-string "#s((a #(0)) 1)"))
|
||||
(lambda (x)
|
||||
(and (exn:fail:read? x)
|
||||
(not (exn:fail:read:eof? x)))))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -1321,7 +1321,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
st = NULL;
|
||||
|
||||
if (!st || (st->num_slots != (SCHEME_VEC_SIZE(v) - 1))) {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), EOF, indentation,
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
(SCHEME_VEC_SIZE(v)
|
||||
? (st
|
||||
? ("read: mismatch between structure description"
|
||||
|
@ -1332,7 +1332,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
}
|
||||
|
||||
if (stxsrc && !(MZ_OPT_HASH_KEY(&st->iso) & STRUCT_TYPE_ALL_IMMUTABLE)) {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), EOF, indentation,
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
"read: cannot read mutable `#s' form as syntax");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user