Mercurial > projects > ldc
comparison lphobos/std/moduleinit.d @ 116:fd7ad91fd713 trunk
[svn r120] ModuleInfo implementation is now almost complete.
Fixed some nasty static array-initializer bugs.
Fixed bug in DtoArrayLen and DtoArrayPtr for full slices of static arrays.
author | lindquist |
---|---|
date | Sun, 25 Nov 2007 18:55:52 +0100 |
parents | ccca1c13e13a |
children | 56a21f3e5d3e |
comparison
equal
deleted
inserted
replaced
115:5ba6d286c941 | 116:fd7ad91fd713 |
---|---|
16 MIctordone = 2, // finished construction | 16 MIctordone = 2, // finished construction |
17 MIstandalone = 4, // module ctor does not depend on other module | 17 MIstandalone = 4, // module ctor does not depend on other module |
18 // ctors being done first | 18 // ctors being done first |
19 } | 19 } |
20 | 20 |
21 /*********************** | 21 // had to move the class to object.d, as its declaration is needed in the compiler code, |
22 * Information about each module. | 22 // otherwise the DMDFE Module::moduleinfo member is NULL |
23 */ | |
24 class ModuleInfo | |
25 { | |
26 char[] name; | |
27 ModuleInfo[] importedModules; | |
28 ClassInfo[] localClasses; | |
29 | |
30 uint flags; // initialization state | |
31 | |
32 void function() ctor; | |
33 void function() dtor; | |
34 void function() unitTest; | |
35 | |
36 /****************** | |
37 * Return collection of all modules in the program. | |
38 */ | |
39 static ModuleInfo[] modules() | |
40 { | |
41 return _moduleinfo_array; | |
42 } | |
43 } | |
44 | 23 |
45 class ModuleCtorError : Exception | 24 class ModuleCtorError : Exception |
46 { | 25 { |
47 this(ModuleInfo m) | 26 this(ModuleInfo m) |
48 { | 27 { |