Skip to content
← Back

src/semantic/types/reference.ghul

1
namespace Semantic.Types is
2
3
use Source.LOCATION;
4
5
class REFERENCE: GENERIC is
6
short_description: string => get_short_description(self);
7
is_ref: bool => true;
8
9
get_short_description(reference: GENERIC) -> string static => "{reference.arguments[0]} ref";
10
11
init(
12
location: LOCATION,
13
symbol: Symbols.Classy,
14
arguments: Collections.List[Type]
15
) is
16
super.init(Symbols.REFERENCE(location, symbol, arguments[0]));
17
si
18
19
create(
20
location: LOCATION,
21
symbol: Symbols.Classy,
22
arguments: Collections.List[Type]
23
) -> GENERIC =>
24
Types.REFERENCE(location, symbol, arguments);
25
26
gen_class_name(buffer: System.Text.StringBuilder) is
27
gen_type(buffer);
28
si
29
30
gen_type(buffer: System.Text.StringBuilder) is
31
arguments[0].gen_type(buffer);
32
buffer.append("& ");
33
si
34
35
to_string() -> string => get_short_description(self);
36
si
37
si