aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-ztedit.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-ztedit.adb')
-rw-r--r--gcc/ada/a-ztedit.adb83
1 files changed, 14 insertions, 69 deletions
diff --git a/gcc/ada/a-ztedit.adb b/gcc/ada/a-ztedit.adb
index 5c7c9b4..bc759e0 100644
--- a/gcc/ada/a-ztedit.adb
+++ b/gcc/ada/a-ztedit.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -211,7 +211,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
loop
case Picture (Picture_Index) is
-
when '(' =>
-- We now need to scan out the count after a left paren. In
@@ -276,7 +275,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Result (Result_Index) := Picture (Picture_Index);
Picture_Index := Picture_Index + 1;
Result_Index := Result_Index + 1;
-
end case;
exit when Picture_Index > Picture'Last;
@@ -391,7 +389,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
exit when Answer (Last) = '9';
case Answer (Last) is
-
when '_' =>
Answer (Last) := Separator_Character;
@@ -400,7 +397,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
null;
-
end case;
exit when Last = Answer'Last;
@@ -420,7 +416,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Answer (J) is
-
when '_' =>
Answer (J) := Separator_Character;
@@ -432,7 +427,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
null;
-
end case;
end loop;
@@ -614,7 +608,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
for J in reverse Pic.Start_Float .. Position loop
case Answer (J) is
-
when '*' =>
Answer (J) := Fill_Character;
@@ -636,9 +629,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
when '_' =>
-
case Pic.Floater is
-
when '*' =>
Answer (J) := Fill_Character;
@@ -656,12 +647,10 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
null;
-
end case;
when others =>
null;
-
end case;
end loop;
@@ -692,13 +681,11 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
raise Picture_Error;
-
end case;
else -- positive
case Answer (Sign_Position) is
-
when '-' =>
Answer (Sign_Position) := ' ';
@@ -711,7 +698,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
raise Picture_Error;
-
end case;
end if;
end if;
@@ -719,13 +705,11 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- Fill in trailing digits
if Pic.Max_Trailing_Digits > 0 then
-
if Attrs.Has_Fraction then
Position := Attrs.Start_Of_Fraction;
Last := Pic.Radix_Position + 1;
for J in Last .. Answer'Last loop
-
if Answer (J) = '9' or else Answer (J) = Pic.Floater then
Answer (J) := To_Wide (Rounded (Position));
@@ -745,7 +729,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
elsif Answer (J) = '_' then
Answer (J) := Separator_Character;
-
end if;
Last := J + 1;
@@ -773,7 +756,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
elsif Answer (J) = 'b' then
Answer (J) := ' ';
-
end if;
end loop;
@@ -822,9 +804,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
when '_' =>
-
case Pic.Floater is
-
when '*' =>
Answer (J) := Fill_Character;
@@ -841,12 +821,10 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
null;
-
end case;
when others =>
exit;
-
end case;
end loop;
@@ -931,7 +909,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- 9) No radix, no currency expansion
if Pic.Radix_Position /= Invalid_Position then
-
if Answer (Pic.Radix_Position) = '.' then
Answer (Pic.Radix_Position) := Radix_Point;
@@ -1014,7 +991,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
begin
for J in Str'Range loop
case Str (J) is
-
when ' ' =>
null; -- ignore
@@ -1189,7 +1165,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -1220,7 +1195,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
return;
when others =>
- return;
+ return;
end case;
end loop;
end Floating_Bracket;
@@ -1274,7 +1249,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '-' =>
Pic.Max_Trailing_Digits :=
Pic.Max_Trailing_Digits + 1;
@@ -1290,7 +1264,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
@@ -1355,7 +1328,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '+' =>
Pic.Max_Trailing_Digits :=
Pic.Max_Trailing_Digits + 1;
@@ -1371,7 +1343,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
@@ -1383,7 +1354,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
end Floating_Plus;
@@ -1399,14 +1369,15 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Pic.Picture.Expanded (Index) is
-
- when '_' | '0' | '/' => return True;
+ when '_' | '0' | '/' =>
+ return True;
when 'B' | 'b' =>
Pic.Picture.Expanded (Index) := 'b'; -- canonical
return True;
- when others => return False;
+ when others =>
+ return False;
end case;
end Is_Insert;
@@ -1442,7 +1413,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -1514,7 +1484,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
end Leading_Dollar;
@@ -1534,7 +1503,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- floating unless there is only one '#'.
procedure Leading_Pound is
-
Inserts : Boolean := False;
-- Set to True if a '_', '0', '/', 'B', or 'b' is encountered
@@ -1565,7 +1533,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Inserts := True;
@@ -1666,7 +1633,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
procedure Number is
begin
loop
-
case Look is
when '_' | '0' | '/' =>
Skip;
@@ -1709,7 +1675,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
begin
while not At_End loop
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -1780,8 +1745,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
- when '_' | '0' | '/' => Skip;
+ when '_' | '0' | '/' =>
+ Skip;
when 'B' | 'b' =>
Pic.Picture.Expanded (Index) := 'b';
@@ -1890,7 +1855,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -1909,7 +1873,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -1925,14 +1888,12 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
when others =>
Number_Fraction;
return;
-
end case;
end loop;
end Number_Fraction_Or_Pound;
@@ -1949,7 +1910,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -1969,7 +1929,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -1992,7 +1951,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
Number_Fraction;
return;
-
end case;
end loop;
end Number_Fraction_Or_Star_Fill;
@@ -2009,7 +1967,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -2030,7 +1987,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -2069,7 +2025,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '+' | '-' =>
Pic.Sign_Position := Index;
Skip;
@@ -2118,7 +2073,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end Optional_RHS_Sign;
@@ -2139,7 +2093,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Skip;
@@ -2170,7 +2123,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
end Picture;
@@ -2197,7 +2149,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
loop
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -2241,7 +2192,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
raise Picture_Error;
-
end case;
end loop;
end Picture_Bracket;
@@ -2267,7 +2217,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
loop
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -2325,7 +2274,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
end Picture_Minus;
@@ -2351,7 +2299,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
loop
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -2413,7 +2360,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
return;
-
end case;
end loop;
end Picture_Plus;
@@ -2429,7 +2375,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end loop;
case Look is
-
when '$' | '#' =>
Picture;
Optional_RHS_Sign;
@@ -2461,7 +2406,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when others =>
raise Picture_Error;
-
end case;
-- Blank when zero either if the PIC does not contain a '9' or if
@@ -2478,7 +2422,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
if not At_End then
Set_State (Reject);
end if;
-
end Picture_String;
---------------
@@ -2522,7 +2465,6 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
-
when '_' | '0' | '/' =>
Pic.End_Float := Index;
Skip;
@@ -2553,7 +2495,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Set_State (Okay);
return;
- when others => raise Picture_Error;
+ when others =>
+ raise Picture_Error;
end case;
end loop;
end Star_Suppression;
@@ -2604,13 +2547,15 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end if;
case Look is
- when '_' | '0' | '/' => Skip;
+ when '_' | '0' | '/' =>
+ Skip;
when 'B' | 'b' =>
Pic.Picture.Expanded (Index) := 'b';
Skip;
- when others => return;
+ when others =>
+ return;
end case;
end loop;
end Trailing_Currency;