Mercurial > projects > ddmd
changeset 31:9364afc02cf5
DotTemplateExp implementation.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 13 Apr 2010 21:26:45 +0100 |
parents | 93810d5d169d |
children | 81796b717a39 |
files | dmd/DotTemplateExp.d |
diffstat | 1 files changed, 21 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/dmd/DotTemplateExp.d Tue Apr 13 16:15:13 2010 +0100 +++ b/dmd/DotTemplateExp.d Tue Apr 13 21:26:45 2010 +0100 @@ -5,22 +5,27 @@ import dmd.OutBuffer; import dmd.Loc; import dmd.TOK; +import dmd.PREC; import dmd.HdrGenState; import dmd.TemplateDeclaration; -class DotTemplateExp : UnaExp -{ - TemplateDeclaration td; - - this(Loc loc, Expression e, TemplateDeclaration td) - { - assert(false); - super(loc, TOK.init, 0, e); - } - - void toCBuffer(OutBuffer buf, HdrGenState* hgs) - { - assert(false); - } -} - +import dmd.expression.Util; + +class DotTemplateExp : UnaExp +{ + TemplateDeclaration td; + + this(Loc loc, Expression e, TemplateDeclaration td) + { + super(loc, TOK.TOKdottd, this.sizeof, e); + this.td = td; + } + + void toCBuffer(OutBuffer buf, HdrGenState* hgs) + { + expToCBuffer(buf, hgs, e1, PREC.PREC_primary); + buf.writeByte('.'); + buf.writestring(td.toChars()); + } +} +