Patchwork [Ada] Project manager should accept Ada 05 reserved words as identifiers

login
register
mail settings
Submitter Arnaud Charlet
Date Aug. 29, 2011, 2:13 p.m.
Message ID <20110829141311.GA31486@adacore.com>
Download mbox | patch
Permalink /patch/112061/
State New
Headers show

Comments

Arnaud Charlet - Aug. 29, 2011, 2:13 p.m.
It was not possible to use an Ada reserved word such as Interface as an
identifier, when the default Ada version is Ada 2005. This patch corrects
this.
The following project file should be accepted by all project aware tools
such as gnatmake:

project Interface is
end Interface;

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-29  Vincent Celier  <celier@adacore.com>

	* prj.adb (Initialize): Make sure that new reserved words after Ada 95
	may be used as identifiers.

Patch

Index: prj.adb
===================================================================
--- prj.adb	(revision 178226)
+++ prj.adb	(working copy)
@@ -24,6 +24,7 @@ 
 ------------------------------------------------------------------------------
 
 with Debug;
+with Opt;
 with Osint;    use Osint;
 with Output;   use Output;
 with Prj.Attr;
@@ -698,6 +699,11 @@ 
 
          Prj.Attr.Initialize;
 
+         --  Make sure that new reserved words after Ada 95 may be used as
+         --  identifiers.
+
+         Opt.Ada_Version := Opt.Ada_95;
+
          Set_Name_Table_Byte (Name_Project,  Token_Type'Pos (Tok_Project));
          Set_Name_Table_Byte (Name_Extends,  Token_Type'Pos (Tok_Extends));
          Set_Name_Table_Byte (Name_External, Token_Type'Pos (Tok_External));