diff --git a/src/number.c b/src/number.c index 882108cd6..c4200574b 100644 --- a/src/number.c +++ b/src/number.c @@ -4905,6 +4905,7 @@ static ScmObj read_number(struct numread_packet *ctx) ScmObj realpart = read_real(&str, &len, ctx); if (SCM_FALSEP(realpart) || len == 0) return realpart; + ctx->padread = FALSE; switch (*str) { case '@': /* polar representation of complex*/ diff --git a/test/number.scm b/test/number.scm index 504c0cd8e..5e58c2efc 100644 --- a/test/number.scm +++ b/test/number.scm @@ -538,6 +538,13 @@ (test* "complex reader (polar)" (make-polar 3.5 -3.0) 7/2@-3.0) (test* "complex reader (polar)" #f (string->number "7/2@-3.14i")) +(test* "complex reader (padding)" '(100.0 234.5) + (decompose-complex (string->number "1##+234.5###i"))) +(test* "complex reader (padding)" '100.0 + (decompose-complex (string->number "1##@.0###"))) +(test* "complex reader (padding)" '(0.0 1.2) + (decompose-complex (string->number "1.2##@.5###pi"))) + ;;------------------------------------------------------------------ (test-section "integer writer syntax")