fix `read-syntax' on a vector with a size and no given elements
Closes PR 13720
This commit is contained in:
parent
de96643fbe
commit
176ff287a8
|
@ -438,6 +438,8 @@
|
|||
(test 0 vector-ref (readstr "#2()") 1)
|
||||
(test 2 vector-length (readstr "#000000000000000000000000000000002()"))
|
||||
|
||||
(test 0 syntax->datum (vector-ref (syntax-e (read-syntax #f (open-input-string "#2()"))) 1))
|
||||
|
||||
(err/rt-test (readstr "#2(1 2 3)") exn:fail:read?)
|
||||
(err/rt-test (readstr "#200000000000(1 2 3)") (readerrtype exn:fail:out-of-memory?))
|
||||
(err/rt-test (readstr "#111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111x1(1 2 3)") exn:fail:read?)
|
||||
|
|
|
@ -3445,6 +3445,7 @@ char *scheme_extract_indentation_suggestions(Scheme_Object *indentation)
|
|||
#define ELMS_SELECTOR SCHEME_VEC_ELS
|
||||
#define ELM_SELECTOR
|
||||
#define ELM_MAKE_ZERO scheme_make_integer(0)
|
||||
#define ELM_STX(elm) scheme_make_stx_w_offset(elm, line, col, pos, SPAN(port, pos), stxsrc, STX_SRCTAG);
|
||||
#define VEC_SIZE SCHEME_VEC_SIZE
|
||||
#include "read_vector.inc"
|
||||
|
||||
|
@ -3458,6 +3459,7 @@ char *scheme_extract_indentation_suggestions(Scheme_Object *indentation)
|
|||
#define ELMS_SELECTOR SCHEME_FXVEC_ELS
|
||||
#define ELM_SELECTOR
|
||||
#define ELM_MAKE_ZERO scheme_make_integer(0)
|
||||
#define ELM_STX(elm) elm
|
||||
#define VEC_SIZE SCHEME_FXVEC_SIZE
|
||||
#include "read_vector.inc"
|
||||
|
||||
|
@ -3471,6 +3473,7 @@ char *scheme_extract_indentation_suggestions(Scheme_Object *indentation)
|
|||
#define ELMS_SELECTOR SCHEME_FLVEC_ELS
|
||||
#define ELM_SELECTOR SCHEME_DBL_VAL
|
||||
#define ELM_MAKE_ZERO 0.0
|
||||
#define ELM_STX(elm) elm
|
||||
#define VEC_SIZE SCHEME_FLVEC_SIZE
|
||||
#include "read_vector.inc"
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ FUNC_NAME (Scheme_Object *port,
|
|||
else {
|
||||
elm = ELM_MAKE_ZERO;
|
||||
if (stxsrc)
|
||||
obj = scheme_make_stx_w_offset(obj, line, col, pos, SPAN(port, pos), stxsrc, STX_SRCTAG);
|
||||
elm = ELM_STX(elm);
|
||||
}
|
||||
|
||||
els = ELMS_SELECTOR(vec);
|
||||
|
@ -88,6 +88,7 @@ FUNC_NAME (Scheme_Object *port,
|
|||
#undef ELMS_SELECTOR
|
||||
#undef ELM_SELECTOR
|
||||
#undef ELM_MAKE_ZERO
|
||||
#undef ELM_STX
|
||||
#undef VEC_SIZE
|
||||
|
||||
/* vim: ft=c
|
||||
|
|
Loading…
Reference in New Issue
Block a user