0
|
1 module dmd.TemplateThisParameter;
|
|
2
|
114
|
3 import dmd.common;
|
0
|
4 import dmd.TemplateTypeParameter;
|
|
5 import dmd.Type;
|
|
6 import dmd.Loc;
|
|
7 import dmd.Identifier;
|
|
8 import dmd.TemplateParameter;
|
|
9 import dmd.OutBuffer;
|
|
10 import dmd.HdrGenState;
|
|
11
|
|
12 class TemplateThisParameter : TemplateTypeParameter
|
|
13 {
|
|
14 /* Syntax:
|
|
15 * this ident : specType = defaultType
|
|
16 */
|
|
17 Type specType; // type parameter: if !=NULL, this is the type specialization
|
|
18 Type defaultType;
|
|
19
|
|
20 this(Loc loc, Identifier ident, Type specType, Type defaultType)
|
|
21 {
|
|
22 super(loc, ident, specType, defaultType);
|
|
23 }
|
|
24
|
72
|
25 override TemplateThisParameter isTemplateThisParameter()
|
0
|
26 {
|
162
|
27 return this;
|
0
|
28 }
|
|
29
|
72
|
30 override TemplateParameter syntaxCopy()
|
0
|
31 {
|
162
|
32 TemplateThisParameter tp = new TemplateThisParameter(loc, ident, specType, defaultType);
|
|
33 if (tp.specType)
|
|
34 tp.specType = specType.syntaxCopy();
|
|
35 if (defaultType)
|
|
36 tp.defaultType = defaultType.syntaxCopy();
|
|
37 return tp;
|
0
|
38 }
|
|
39
|
72
|
40 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
|
0
|
41 {
|
162
|
42 buf.writestring("this ");
|
|
43 super.toCBuffer(buf, hgs);
|
0
|
44 }
|
72
|
45 }
|