Mercurial > projects > ddmd
comparison dmd/DotTemplateExp.d @ 31:9364afc02cf5
DotTemplateExp implementation.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 13 Apr 2010 21:26:45 +0100 |
parents | 10317f0c89a5 |
children | 2e2a5c3f943a |
comparison
equal
deleted
inserted
replaced
30:93810d5d169d | 31:9364afc02cf5 |
---|---|
3 import dmd.Expression; | 3 import dmd.Expression; |
4 import dmd.UnaExp; | 4 import dmd.UnaExp; |
5 import dmd.OutBuffer; | 5 import dmd.OutBuffer; |
6 import dmd.Loc; | 6 import dmd.Loc; |
7 import dmd.TOK; | 7 import dmd.TOK; |
8 import dmd.PREC; | |
8 import dmd.HdrGenState; | 9 import dmd.HdrGenState; |
9 import dmd.TemplateDeclaration; | 10 import dmd.TemplateDeclaration; |
11 | |
12 import dmd.expression.Util; | |
10 | 13 |
11 class DotTemplateExp : UnaExp | 14 class DotTemplateExp : UnaExp |
12 { | 15 { |
13 TemplateDeclaration td; | 16 TemplateDeclaration td; |
14 | 17 |
15 this(Loc loc, Expression e, TemplateDeclaration td) | 18 this(Loc loc, Expression e, TemplateDeclaration td) |
16 { | 19 { |
17 assert(false); | 20 super(loc, TOK.TOKdottd, this.sizeof, e); |
18 super(loc, TOK.init, 0, e); | 21 this.td = td; |
19 } | 22 } |
20 | 23 |
21 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 24 void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
22 { | 25 { |
23 assert(false); | 26 expToCBuffer(buf, hgs, e1, PREC.PREC_primary); |
27 buf.writeByte('.'); | |
28 buf.writestring(td.toChars()); | |
24 } | 29 } |
25 } | 30 } |
26 | 31 |