annotate dmd/ModuleDeclaration.d @ 187:b0d41ff5e0df

Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author Abscissa
date Tue, 07 Jun 2011 23:37:34 -0400
parents e3afd1303184
children
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
178
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
8 import dmd.TObject;
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
9
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
10 import dmd.DDMDExtensions;
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
11
178
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
12 class ModuleDeclaration : TObject
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 {
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
14 mixin insertMemberExtension!(typeof(this));
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
15
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 Identifier id;
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
17 Identifiers packages; // array of Identifier's representing packages
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 bool safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
20 this(Identifiers packages, Identifier id, bool safe)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
22 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 this.packages = packages;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 this.id = id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 this.safe = safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 string toChars()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 {
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
30 scope OutBuffer buf = new OutBuffer();
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
31 if (packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
32 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
33 foreach (pid; packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
34 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
35 buf.writestring(pid.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
36 buf.writeByte('.');
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
37 }
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
38 }
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
39 buf.writestring(id.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
40 buf.writeByte(0);
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
41 return buf.extractString();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 }
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
43 }