aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 12:29:09 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-29 12:29:09 +0200
commitff4f0ed0936a9286310afadf6406386a1b198278 (patch)
treef9f1bcd3de6f91002e0d807025cfaffe86679552 /gcc/ada/par-ch3.adb
parentd941cee6ffa3c32939d4ddf1d1b0ca1613df26d0 (diff)
downloadgcc-ff4f0ed0936a9286310afadf6406386a1b198278.zip
gcc-ff4f0ed0936a9286310afadf6406386a1b198278.tar.gz
gcc-ff4f0ed0936a9286310afadf6406386a1b198278.tar.bz2
[multiple changes]
2011-08-29 Robert Dewar <dewar@adacore.com> * sem_ch8.adb: Minor reformatting. 2011-08-29 Bob Duff <duff@adacore.com> * par-ch2.adb (P_Identifier): Warn that "some" is reserved in Ada 2012. * par-ch4.adb (P_Quantified_Expression): Remove unnecessary code for treating "some" as unreserved in earlier Ada versions. This is now handled in Snames.Is_Keyword_Name. Parse "for some" using Tok_Some, rather than Name_Some, since Tok_Some is now recognized as reserved. * scans.adb (Initialize_Ada_Keywords): Handle Tok_Some like any other reserved word. * scans.ads: Minor comment fixes. * snames.adb-tmpl (Is_Keyword_Name): Handle Ada 2012 reserved words as for other language versions. * scn.adb (Scan_Reserved_Identifier): Remove unnecessary code for treating "some" as unreserved in earlier Ada versions. This is now handled in Snames.Is_Keyword_Name. * par-ch3.adb (P_Defining_Identifier): Warn that "some" is reserved in Ada 2012. (P_Subtype_Mark_Resync): Remove unnecessary code for treating "some" as unreserved in earlier Ada versions. This is now handled in Snames.Is_Keyword_Name. * snames.ads-tmpl (Ada_2012_Reserved_Words): Handle Ada 2012 reserved words as for other language versions. * gnat_ugn.texi (-gnatwy): Fix documentation: this switch applies to Ada 2012, not just Ada 2005. From-SVN: r178191
Diffstat (limited to 'gcc/ada/par-ch3.adb')
-rw-r--r--gcc/ada/par-ch3.adb22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 0d62eb8..642de80 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, 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- --
@@ -229,6 +229,16 @@ package body Ch3 is
end if;
end if;
+ -- Similarly, warn about Ada 2012 reserved words
+
+ if Ada_Version in Ada_95 .. Ada_2005
+ and then Warn_On_Ada_2012_Compatibility
+ then
+ if Token_Name = Name_Some then
+ Error_Msg_N ("& is a reserved word in Ada 2012?", Token_Node);
+ end if;
+ end if;
+
-- If we have a reserved identifier, manufacture an identifier with
-- a corresponding name after posting an appropriate error message
@@ -1125,16 +1135,6 @@ package body Ch3 is
Discard_Junk_Node (P_Array_Type_Definition);
return Error;
- -- If Some becomes a keyword, the following is needed to make it
- -- acceptable in older versions of Ada.
-
- elsif Token = Tok_Some
- and then Ada_Version < Ada_2012
- then
- Scan_Reserved_Identifier (False);
- Scan;
- return Token_Node;
-
else
Type_Node := P_Qualified_Simple_Name_Resync;