annotate dmd/ModuleDeclaration.d @ 174:af724d3510d7

lot os toCBuffer methods implemented moved shared Type.* stuff into Global
author korDen
date Sun, 10 Oct 2010 03:47:23 +0400
parents e6e542f37b94
children e3afd1303184
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.ModuleDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 0
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Identifier;
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
5 import dmd.ArrayTypes;
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
6 import dmd.OutBuffer;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 class ModuleDeclaration
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 Identifier id;
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
11 Identifiers packages; // array of Identifier's representing packages
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 bool safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
14 this(Identifiers packages, Identifier id, bool safe)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 this.packages = packages;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 this.id = id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 this.safe = safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 string toChars()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 {
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
23 scope OutBuffer buf = new OutBuffer();
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
24 if (packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
25 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
26 foreach (pid; packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
27 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
28 buf.writestring(pid.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
29 buf.writeByte('.');
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
30 }
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
31 }
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
32 buf.writestring(id.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
33 buf.writeByte(0);
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
34 return buf.extractString();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 }
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
36 }