comparison 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
comparison
equal deleted inserted replaced
129:010eb8f0e18d 130:60bb0fe4563e
46 scstc &= ~(STC.STCauto | STC.STCscope | STC.STCstatic | STC.STCtls | STC.STCmanifest | STC.STCgshared); 46 scstc &= ~(STC.STCauto | STC.STCscope | STC.STCstatic | STC.STCtls | STC.STCmanifest | STC.STCgshared);
47 if (stc & (STC.STCconst | STC.STCimmutable | STC.STCmanifest)) 47 if (stc & (STC.STCconst | STC.STCimmutable | STC.STCmanifest))
48 scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest); 48 scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest);
49 if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls)) 49 if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls))
50 scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls); 50 scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls);
51 if (stc & (STC.STCsafe | STC.STCtrusted | STC.STCsystem))
52 scstc &= ~(STC.STCsafe | STC.STCtrusted | STC.STCsystem);
51 scstc |= stc; 53 scstc |= stc;
52 54
53 setScopeNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign); 55 setScopeNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign);
54 } 56 }
55 } 57 }
69 scstc &= ~(STC.STCauto | STC.STCscope | STC.STCstatic | STC.STCtls | STC.STCmanifest | STC.STCgshared); 71 scstc &= ~(STC.STCauto | STC.STCscope | STC.STCstatic | STC.STCtls | STC.STCmanifest | STC.STCgshared);
70 if (stc & (STC.STCconst | STC.STCimmutable | STC.STCmanifest)) 72 if (stc & (STC.STCconst | STC.STCimmutable | STC.STCmanifest))
71 scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest); 73 scstc &= ~(STC.STCconst | STC.STCimmutable | STC.STCmanifest);
72 if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls)) 74 if (stc & (STC.STCgshared | STC.STCshared | STC.STCtls))
73 scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls); 75 scstc &= ~(STC.STCgshared | STC.STCshared | STC.STCtls);
76 if (stc & (STC.STCsafe | STC.STCtrusted | STC.STCsystem))
77 scstc &= ~(STC.STCsafe | STC.STCtrusted | STC.STCsystem);
74 scstc |= stc; 78 scstc |= stc;
75 79
76 semanticNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign); 80 semanticNewSc(sc, scstc, sc.linkage, sc.protection, sc.explicitProtection, sc.structalign);
77 } 81 }
78 } 82 }
112 /// { STCnothrow, TOKnothrow }, 116 /// { STCnothrow, TOKnothrow },
113 /// { STCpure, TOKpure }, 117 /// { STCpure, TOKpure },
114 /// { STCref, TOKref }, 118 /// { STCref, TOKref },
115 /// { STCtls, TOKtls }, 119 /// { STCtls, TOKtls },
116 /// { STCgshared, TOKgshared }, 120 /// { STCgshared, TOKgshared },
121 /// { STCproperty, TOKat },
122 /// { STCsafe, TOKat },
123 /// { STCtrusted, TOKat },
117 /// } 124 /// }
118 ]; 125 ];
119 126
120 for (int i = 0; i < table.length; i++) 127 for (int i = 0; i < table.length; i++)
121 { 128 {
122 if (stc & table[i].stc) 129 if (stc & table[i].stc)
123 { 130 {
124 buf.writestring(Token.toChars(table[i].tok)); 131 enum TOK tok = table[i].tok;
132 if (tok == TOKat)
133 { Identifier id;
134
135 if (stc & STC.STCproperty)
136 id = Id.property;
137 else if (stc & STCsafe)
138 id = Id.safe;
139 else if (stc & STCtrusted)
140 id = Id.trusted;
141 else
142 assert(0);
143 buf.writestring(id.toChars());
144 }
145 else
146 buf.writestring(Token.toChars(tok));
125 buf.writeByte(' '); 147 buf.writeByte(' ');
126 } 148 }
127 } 149 }
128 } 150 }
129 } 151 }