Mercurial > projects > ddmd
comparison dmd/Package.d @ 128:e6e542f37b94
Some more Array -> Vector conversions
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Sat, 04 Sep 2010 01:33:05 +0100 |
parents | e28b18c23469 |
children | e7769d53e750 |
comparison
equal
deleted
inserted
replaced
127:9ee9b55452cb | 128:e6e542f37b94 |
---|---|
1 module dmd.Package; | 1 module dmd.Package; |
2 | 2 |
3 import dmd.common; | 3 import dmd.common; |
4 import dmd.ScopeDsymbol; | 4 import dmd.ScopeDsymbol; |
5 import dmd.Identifier; | 5 import dmd.Identifier; |
6 import dmd.Array; | 6 import dmd.ArrayTypes; |
7 import dmd.DsymbolTable; | 7 import dmd.DsymbolTable; |
8 import dmd.Scope; | 8 import dmd.Scope; |
9 import dmd.Dsymbol; | 9 import dmd.Dsymbol; |
10 import dmd.Module; | 10 import dmd.Module; |
11 import dmd.Util; | 11 import dmd.Util; |
20 override string kind() | 20 override string kind() |
21 { | 21 { |
22 assert(false); | 22 assert(false); |
23 } | 23 } |
24 | 24 |
25 static DsymbolTable resolve(Array packages, Dsymbol* pparent, Package* ppkg) | 25 static DsymbolTable resolve(Identifiers packages, Dsymbol* pparent, Package* ppkg) |
26 { | 26 { |
27 DsymbolTable dst = Module.modules; | 27 DsymbolTable dst = Module.modules; |
28 Dsymbol parent = null; | 28 Dsymbol parent = null; |
29 | 29 |
30 //printf("Package::resolve()\n"); | 30 //printf("Package::resolve()\n"); |
31 if (ppkg) | 31 if (ppkg) |
32 *ppkg = null; | 32 *ppkg = null; |
33 | 33 |
34 if (packages) | 34 if (packages) |
35 { | 35 { |
36 for (int i = 0; i < packages.dim; i++) | 36 foreach (pid; packages) |
37 { | 37 { |
38 Identifier pid = cast(Identifier)packages.data[i]; | |
39 Dsymbol p = dst.lookup(pid); | 38 Dsymbol p = dst.lookup(pid); |
40 if (!p) | 39 if (!p) |
41 { | 40 { |
42 p = new Package(pid); | 41 p = new Package(pid); |
43 dst.insert(p); | 42 dst.insert(p); |