comparison gcc/ada/scng.adb @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
4 -- -- 4 -- --
5 -- S C N G -- 5 -- S C N G --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. -- 9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
180 | Tok_Identifier 180 | Tok_Identifier
181 | Tok_In 181 | Tok_In
182 | Tok_Integer_Literal 182 | Tok_Integer_Literal
183 | Tok_Interface 183 | Tok_Interface
184 | Tok_Is 184 | Tok_Is
185 | Tok_Left_Bracket
185 | Tok_Left_Paren 186 | Tok_Left_Paren
186 | Tok_Less 187 | Tok_Less
187 | Tok_Less_Equal 188 | Tok_Less_Equal
188 | Tok_Limited 189 | Tok_Limited
189 | Tok_Minus 190 | Tok_Minus
202 | Tok_Real_Literal 203 | Tok_Real_Literal
203 | Tok_Record 204 | Tok_Record
204 | Tok_Rem 205 | Tok_Rem
205 | Tok_Renames 206 | Tok_Renames
206 | Tok_Reverse 207 | Tok_Reverse
208 | Tok_Right_Bracket
207 | Tok_Right_Paren 209 | Tok_Right_Paren
208 | Tok_Slash 210 | Tok_Slash
209 | Tok_String_Literal 211 | Tok_String_Literal
210 | Tok_Xor 212 | Tok_Xor
211 => 213 =>
322 | Tok_Greater_Greater 324 | Tok_Greater_Greater
323 | Tok_Identifier 325 | Tok_Identifier
324 | Tok_In 326 | Tok_In
325 | Tok_Integer_Literal 327 | Tok_Integer_Literal
326 | Tok_Is 328 | Tok_Is
329 | Tok_Left_Bracket
327 | Tok_Left_Paren 330 | Tok_Left_Paren
328 | Tok_Less 331 | Tok_Less
329 | Tok_Less_Equal 332 | Tok_Less_Equal
330 | Tok_Minus 333 | Tok_Minus
331 | Tok_Mod 334 | Tok_Mod
338 | Tok_Others 341 | Tok_Others
339 | Tok_Plus 342 | Tok_Plus
340 | Tok_Range 343 | Tok_Range
341 | Tok_Real_Literal 344 | Tok_Real_Literal
342 | Tok_Rem 345 | Tok_Rem
346 | Tok_Right_Bracket
343 | Tok_Right_Paren 347 | Tok_Right_Paren
344 | Tok_Slash 348 | Tok_Slash
345 | Tok_String_Literal 349 | Tok_String_Literal
346 | Tok_Xor 350 | Tok_Xor
347 => 351 =>
1695 1699
1696 when '[' => 1700 when '[' =>
1697 if Source (Scan_Ptr + 1) = '"' then 1701 if Source (Scan_Ptr + 1) = '"' then
1698 goto Scan_Wide_Character; 1702 goto Scan_Wide_Character;
1699 1703
1704 elsif Ada_Version = Ada_2020 then
1705 Scan_Ptr := Scan_Ptr + 1;
1706 Token := Tok_Left_Bracket;
1707 return;
1708
1700 else 1709 else
1701 Error_Msg_S ("illegal character, replaced by ""("""); 1710 Error_Msg_S ("illegal character, replaced by ""(""");
1702 Scan_Ptr := Scan_Ptr + 1; 1711 Scan_Ptr := Scan_Ptr + 1;
1703 Token := Tok_Left_Paren; 1712 Token := Tok_Left_Paren;
1704 return; 1713 return;
2061 or else Prev_Token = Tok_Delta 2070 or else Prev_Token = Tok_Delta
2062 or else Prev_Token = Tok_Digits 2071 or else Prev_Token = Tok_Digits
2063 or else Prev_Token = Tok_Identifier 2072 or else Prev_Token = Tok_Identifier
2064 or else Prev_Token = Tok_Project 2073 or else Prev_Token = Tok_Project
2065 or else Prev_Token = Tok_Right_Paren 2074 or else Prev_Token = Tok_Right_Paren
2075 or else Prev_Token = Tok_Right_Bracket
2066 or else Prev_Token in Token_Class_Literal 2076 or else Prev_Token in Token_Class_Literal
2067 then 2077 then
2068 Token := Tok_Apostrophe; 2078 Token := Tok_Apostrophe;
2069 2079
2070 if Style_Check then 2080 if Style_Check then
2170 end if; 2180 end if;
2171 2181
2172 return; 2182 return;
2173 2183
2174 -- Right bracket or right brace, treated as right paren 2184 -- Right bracket or right brace, treated as right paren
2185 -- but proper aggregate delimiter in Ada_2020
2175 2186
2176 when ']' | '}' => 2187 when ']' | '}' =>
2177 Error_Msg_S ("illegal character, replaced by "")"""); 2188 if Ada_Version >= Ada_2020 then
2189 Token := Tok_Right_Bracket;
2190
2191 else
2192 Error_Msg_S ("illegal character, replaced by "")""");
2193 Token := Tok_Right_Paren;
2194 end if;
2195
2178 Scan_Ptr := Scan_Ptr + 1; 2196 Scan_Ptr := Scan_Ptr + 1;
2179 Token := Tok_Right_Paren;
2180 return; 2197 return;
2181 2198
2182 -- Slash (can be division operator or first character of not equal) 2199 -- Slash (can be division operator or first character of not equal)
2183 2200
2184 when '/' => 2201 when '/' =>