Underscore is allowed only between digits. The current implementattion
was considering 'E' as a digit even if it was not in the range of
Base and could denote exponent only.
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Scan_Decimal_Digits,
Scan_Integral_Digits): fix condition for rejecting
underscore.
if Digit = Underscore and then Index + 1 <= Max then
Digit := As_Digit (Str (Index + 1));
- if Digit in Valid_Digit then
+ if Digit in Valid_Digit and then
+ (Digit /= E_Digit or else Base > E_Digit)
+ then
Index := Index + 1;
else
return;
if Digit = Underscore and then Index + 1 <= Max then
Digit := As_Digit (Str (Index + 1));
- if Digit in Valid_Digit then
+ if Digit in Valid_Digit and then
+ (Digit /= E_Digit or else Base > E_Digit)
+ then
Index := Index + 1;
else
return;