Skip to content
← Back

src/semantic/dotnet/assembly_info.ghul

1
namespace Semantic.DotNet is
2
use Collections;
3
4
class ASSEMBLY_INFO(_context: IR.CONTEXT) is
5
attributes: MutableList[AssemblyInfoAttribute];
6
7
init(..) is
8
attributes = LIST[AssemblyInfoAttribute]();
9
si
10
11
add_attribute(name: string, value: string) is
12
attributes.add(STRING_ASSEMBLY_INFO_ATTRIBUTE(name, value));
13
si
14
15
gen() is
16
for a in attributes do
17
a.gen(_context);
18
od
19
si
20
si
21
22
class AssemblyInfoAttribute(name: string, value: string) open abstract is
23
gen(context: IR.CONTEXT) is
24
gen_attribute(context);
25
gen_value(context);
26
si
27
28
gen_attribute(context: IR.CONTEXT) is
29
context.write(".custom instance void [System.Runtime]{name}::.ctor(string) = ");
30
si
31
32
gen_value(context: IR.CONTEXT) is si
33
si
34
35
class STRING_ASSEMBLY_INFO_ATTRIBUTE(name: string, value: string): AssemblyInfoAttribute is
36
super(name, value);
37
38
gen_value(context: IR.CONTEXT) is
39
context.write_line("{{ {IL_ATTRIBUTE_ARGUMENTS.string_argument(value)} }}");
40
si
41
si
42
si