annotate dmd/ModuleDeclaration.d @ 178:e3afd1303184

Many small bugs fixed Made all classes derive from TObject to detect memory leaks (functionality is disabled for now) Began work on overriding backend memory allocations (to avoid memory leaks)
author korDen
date Sun, 17 Oct 2010 07:42:00 +0400
parents af724d3510d7
children b0d41ff5e0df
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
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
10 class ModuleDeclaration : TObject
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 Identifier id;
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
13 Identifiers packages; // array of Identifier's representing packages
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 bool safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15
128
e6e542f37b94 Some more Array -> Vector conversions
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
16 this(Identifiers packages, Identifier id, bool safe)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 174
diff changeset
18 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 this.packages = packages;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 this.id = id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 this.safe = safe;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 string toChars()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 {
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
26 scope OutBuffer buf = new OutBuffer();
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
27 if (packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
28 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
29 foreach (pid; packages)
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
30 {
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
31 buf.writestring(pid.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
32 buf.writeByte('.');
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
33 }
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(id.toChars());
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
36 buf.writeByte(0);
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
37 return buf.extractString();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 }
174
af724d3510d7 lot os toCBuffer methods implemented
korDen
parents: 128
diff changeset
39 }