GenModule¶
Import: import system.codegen;
GenModule¶
A user module whose module declaration carries one of the generator's trigger attributes. Module attributes hold settings that apply to every declaration in the module; combine them with per-declaration attributes through GenContext.module_of.
id¶
Stable identifier of the module (module:<path>). Pass it to GenContext.error_at to report a diagnostic at the module declaration.
name¶
Dotted module path, for example shaders.lighting.
file¶
Project-relative path of the file whose module declaration carries the first trigger attribute.
location¶
Location of that module declaration.
attributes¶
Attributes on the module's declarations, in file order. When several files declare the same module, their attributes are combined.
constructor¶
Creates a GenModule from its parts. Generators normally receive these from GenContext rather than constructing them.
public constructor(
id: string,
name: string,
file: string,
location: GenLocation,
attributes: List<GenAttribute>
)
attribute¶
Decodes the first attribute of type A on the module, or None when it has none.
attributes_of¶
Decodes every attribute of type A on the module, in source order.
has¶
Returns whether the module carries an attribute of type A.