diff dmd/StorageClassDeclaration.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents e28b18c23469
children 206db751bd4c
line wrap: on
line diff
--- a/dmd/StorageClassDeclaration.d	Sun Sep 05 15:32:22 2010 +0400
+++ b/dmd/StorageClassDeclaration.d	Thu Sep 09 22:51:44 2010 +0100
@@ -48,6 +48,8 @@
 				scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest);
 			if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls))
 				scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls);
+			if (stc & (STC.STCsafe | STC.STCtrusted | STC.STCsystem))
+				scstc &= ~(STC.STCsafe | STC.STCtrusted | STC.STCsystem);
 			scstc |= stc;
 
 			setScopeNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign);
@@ -71,6 +73,8 @@
 				scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest);
 			if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls))
 				scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls);
+			if (stc & (STC.STCsafe | STC.STCtrusted | STC.STCsystem))
+				scstc &= ~(STC.STCsafe | STC.STCtrusted | STC.STCsystem);
 			scstc |= stc;
 
 			semanticNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign);
@@ -114,6 +118,9 @@
 ///			{ STCref,          TOKref },
 ///			{ STCtls,          TOKtls },
 ///			{ STCgshared,      TOKgshared },
+///			{ STCproperty,     TOKat },
+///			{ STCsafe,         TOKat },
+///			{ STCtrusted,      TOKat },
 ///		}
 		];
 
@@ -121,7 +128,22 @@
 		{
 			if (stc & table[i].stc)
 			{
-				buf.writestring(Token.toChars(table[i].tok));
+				enum TOK tok = table[i].tok;
+				if (tok == TOKat)
+				{	Identifier id;
+
+					if (stc & STC.STCproperty)
+						id = Id.property;
+					else if (stc & STCsafe)
+						id = Id.safe;
+					else if (stc & STCtrusted)
+						id = Id.trusted;
+					else
+						assert(0);
+					buf.writestring(id.toChars());
+				}
+				else
+					buf.writestring(Token.toChars(tok));
 				buf.writeByte(' ');
 			}
 		}