Mercurial > projects > ddmd
comparison dmd/ScopeDsymbol.d @ 74:7e0d548de9e6
Switch Arrays of Dsymbols to the new templated Vector type
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Sun, 29 Aug 2010 09:43:40 +0100 |
parents | 2e2a5c3f943a |
children | ad4792a1cfd6 |
comparison
equal
deleted
inserted
replaced
73:ef02e2e203c2 | 74:7e0d548de9e6 |
---|---|
18 import core.stdc.stdlib; | 18 import core.stdc.stdlib; |
19 import core.memory; | 19 import core.memory; |
20 | 20 |
21 class ScopeDsymbol : Dsymbol | 21 class ScopeDsymbol : Dsymbol |
22 { | 22 { |
23 Array members; // all Dsymbol's in this scope | 23 Dsymbols members; // all Dsymbol's in this scope |
24 DsymbolTable symtab; // members[] sorted into table | 24 DsymbolTable symtab; // members[] sorted into table |
25 | 25 |
26 Array imports; // imported ScopeDsymbol's | 26 Array imports; // imported ScopeDsymbol's |
27 PROT* prots; // array of PROT, one for each import | 27 PROT* prots; // array of PROT, one for each import |
28 | 28 |
113 if (s2.isOverloadable() && (a || s.isOverloadable())) | 113 if (s2.isOverloadable() && (a || s.isOverloadable())) |
114 { if (!a) | 114 { if (!a) |
115 a = new OverloadSet(); | 115 a = new OverloadSet(); |
116 /* Don't add to a[] if s2 is alias of previous sym | 116 /* Don't add to a[] if s2 is alias of previous sym |
117 */ | 117 */ |
118 for (int j = 0; j < a.a.dim; j++) | 118 foreach (int j, Dsymbol s3; a.a) |
119 { | 119 { |
120 Dsymbol s3 = cast(Dsymbol)a.a.data[j]; | |
121 if (s2.toAlias() == s3.toAlias()) | 120 if (s2.toAlias() == s3.toAlias()) |
122 { | 121 { |
123 if (s3.isDeprecated()) | 122 if (s3.isDeprecated()) |
124 a.a.data[j] = cast(void*)s2; | 123 a.a[j] = s2; |
125 goto Lcontinue; | 124 goto Lcontinue; |
126 } | 125 } |
127 } | 126 } |
128 a.push(s2); | 127 a.push(s2); |
129 Lcontinue: | 128 Lcontinue: |
264 void emitMemberComments(Scope sc) | 263 void emitMemberComments(Scope sc) |
265 { | 264 { |
266 assert(false); | 265 assert(false); |
267 } | 266 } |
268 | 267 |
269 static size_t dim(Array members) | 268 static size_t dim(Dsymbols members) |
270 { | 269 { |
271 assert(false); | 270 assert(false); |
272 } | 271 } |
273 | 272 |
274 static Dsymbol getNth(Array members, size_t nth, size_t* pn = null) | 273 static Dsymbol getNth(Dsymbols members, size_t nth, size_t* pn = null) |
275 { | 274 { |
276 assert(false); | 275 assert(false); |
277 } | 276 } |
278 | 277 |
279 override ScopeDsymbol isScopeDsymbol() { return this; } | 278 override ScopeDsymbol isScopeDsymbol() { return this; } |