mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-06 20:56:38 +02:00
fixing bug when reading invalid "." in non-decimal bignums (issue 32)
This commit is contained in:
parent
2d8c382978
commit
e8030d7eb7
1 changed files with 4 additions and 2 deletions
|
@ -225,8 +225,10 @@ sexp sexp_read_bignum (sexp ctx, sexp in, sexp_uint_t init,
|
|||
if (c=='.' || c=='e' || c=='E') {
|
||||
if (base != 10)
|
||||
res = sexp_read_error(ctx, "found non-base 10 float", SEXP_NULL, in);
|
||||
if (c!='.') sexp_push_char(ctx, c, in);
|
||||
res = sexp_read_float_tail(ctx, in, sexp_bignum_to_double(res), (sign==-1));
|
||||
else {
|
||||
if (c!='.') sexp_push_char(ctx, c, in); /* push the e back */
|
||||
res = sexp_read_float_tail(ctx, in, sexp_bignum_to_double(res), (sign==-1));
|
||||
}
|
||||
} else if ((c!=EOF) && ! is_separator(c)) {
|
||||
res = sexp_read_error(ctx, "invalid numeric syntax",
|
||||
sexp_make_character(c), in);
|
||||
|
|
Loading…
Add table
Reference in a new issue