Mercurial > projects > ddmd
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 |
rev | line source |
---|---|
0 | 1 module dmd.ModuleDeclaration; |
2 | |
114 | 3 import dmd.common; |
0 | 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 | 6 import dmd.OutBuffer; |
0 | 7 |
178 | 8 import dmd.TObject; |
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 | 12 class ModuleDeclaration : TObject |
0 | 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 | 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 | 18 bool safe; |
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 | 21 { |
178 | 22 register(); |
0 | 23 this.packages = packages; |
24 this.id = id; | |
25 this.safe = safe; | |
26 } | |
27 | |
28 string toChars() | |
29 { | |
174 | 30 scope OutBuffer buf = new OutBuffer(); |
31 if (packages) | |
32 { | |
33 foreach (pid; packages) | |
34 { | |
35 buf.writestring(pid.toChars()); | |
36 buf.writeByte('.'); | |
37 } | |
38 } | |
39 buf.writestring(id.toChars()); | |
40 buf.writeByte(0); | |
41 return buf.extractString(); | |
0 | 42 } |
174 | 43 } |