reader: don't treat -. and +. as a number

CLHS section 2.3.1 mandates that all numbers must contain at least
    one digit. Fixes #427.
This commit is contained in:
Marius Gerbershagen 2018-08-23 22:55:23 +02:00
parent 3201b545e1
commit ba6e6ddde7

View file

@ -212,11 +212,11 @@ ecl_parse_number(cl_object str, cl_index start, cl_index end,
return OBJNULL;
}
}
if (!some_digit) goto NOT_A_NUMBER;
*ep = i;
/* If we have reached the end without decimals (for instance
* 1., 2, 13., etc) we return an integer */
*ep = i;
if (decimal < i) {
if (!some_digit) goto NOT_A_NUMBER;
return make_float(_ecl_big_register_normalize(num),
ecl_make_fixnum(decimal - i), 'e', sign);
} else {