Previously this was segmented as a single number containing a trailing dot,
but it should be an integer followed by end-of-command.
if (!eof)
return -1;
goto number;
- };
+ }
if (input[ofs] == '.')
{
+ if (ofs + 1 >= n)
+ {
+ if (!eof)
+ return -1;
+ goto number;
+ }
+
ofs = skip_digits (input, n, eof, ofs + 1);
if (ofs < 0)
return -1;
+ else if (ofs >= n)
+ goto number;
}
- if (ofs >= n)
- {
- if (!eof)
- return -1;
- goto number;
- }
if (input[ofs] == 'e' || input[ofs] == 'E')
{
ofs++;
printf "DATA LIST/5555555555555555." > lexer.sps
AT_CHECK([pspp -O format=csv lexer.sps], [1], [dnl
-lexer.sps:1.11-1.27: error: DATA LIST: Syntax error at `5555555555555555.': Expected integer between 1 and 2147483647.
+lexer.sps:1.11-1.26: error: DATA LIST: Syntax error at `5555555555555555': Expected integer between 1 and 2147483647.
])
AT_CLEANUP
5e1 6E-1 7e+1 6E+01 6e-03
.3E1 .4e-1 .5E+1 .6e+01 .7E-03
1.23e1 45.6E-1 78.9e+1 99.9E+01 11.2e-03
-. 1e e1 1e+ 1e-
+. 1e e1 1e+ 1e- 1.
])
AT_DATA([expout-base], [dnl
number 0 space
expected_exponent 1e space
identifier e1 space
expected_exponent 1e+ space
-expected_exponent 1e-
--newline \n (later)
+expected_exponent 1e- space
+number 1
+end_command .
+-newline \n (first)
-
end
])