Appearance
| 1 | namespace Semantic.DotNet is | |
| 2 | // A namespace's globals are hosted as static members of a synthetic | |
| 3 | // class. A namespace can have one carrier per contributing assembly, | |
| 4 | // and the re-homing of `Ghul.Internal` into `Ghul` gives it two from | |
| 5 | // a single assembly. | |
| 6 | class GLOBALS_CARRIER is | |
| 7 | // The simple name every carrier is given. | |
| 8 | name: string static => "$globals"; | |
| 9 | ||
| 10 | // The attribute the compiler marks a carrier with. The name test | |
| 11 | // covers assemblies whose compiler predates the attribute. | |
| 12 | attribute_name: string static => "Ghul.Internal.GLOBALS_ATTRIBUTE"; | |
| 13 | ||
| 14 | is_carrier(type_name: string, has_marker_attribute: bool) -> bool static => | |
| 15 | has_marker_attribute \/ type_name =~ name; | |
| 16 | si | |
| 17 | si |