Mercurial > projects > ddmd
annotate dmd/DotTemplateExp.d @ 187:b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author | Abscissa |
---|---|
date | Tue, 07 Jun 2011 23:37:34 -0400 |
parents | e3afd1303184 |
children |
rev | line source |
---|---|
72 | 1 module dmd.DotTemplateExp; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Expression; |
5 import dmd.UnaExp; | |
6 import dmd.OutBuffer; | |
7 import dmd.Loc; | |
8 import dmd.TOK; | |
9 import dmd.PREC; | |
10 import dmd.HdrGenState; | |
11 import dmd.TemplateDeclaration; | |
12 | |
13 import dmd.expression.Util; | |
14 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
15 import dmd.DDMDExtensions; |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
16 |
72 | 17 class DotTemplateExp : UnaExp |
18 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
19 mixin insertMemberExtension!(typeof(this)); |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
20 |
72 | 21 TemplateDeclaration td; |
22 | |
23 this(Loc loc, Expression e, TemplateDeclaration td) | |
24 { | |
178 | 25 register(); |
72 | 26 super(loc, TOK.TOKdottd, this.sizeof, e); |
27 this.td = td; | |
28 } | |
29 | |
30 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) | |
31 { | |
32 expToCBuffer(buf, hgs, e1, PREC.PREC_primary); | |
33 buf.writeByte('.'); | |
34 buf.writestring(td.toChars()); | |
35 } | |
36 } | |
37 |