1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00

Ada: negative numbers in reader

This commit is contained in:
Chris M Moore 2016-03-20 22:20:34 +00:00
parent d1967ba511
commit c2df4f1379

View File

@ -192,7 +192,9 @@ package body Reader is
Dots := 0;
All_Digits := True;
for K in I .. J loop
if Element (Saved_Line, K) = '.' then
if (K = I and K /= J) and then Element (Saved_Line, K) = '-' then
null;
elsif Element (Saved_Line, K) = '.' then
Dots := Dots + 1;
elsif not (Element (Saved_Line, K) in '0' .. '9') then
All_Digits := False;