comparison dmd/IsExp.d @ 50:adf6f7f216ea

CondExp.toCBuffer IsExp.toCBuffer TemplateValueParameter.toCBuffer Dsymbol.search TemplateDeclaration.overloadInsert bug fixed
author korDen
date Sat, 21 Aug 2010 10:38:26 +0400
parents 24674203f62c
children 2e2a5c3f943a
comparison
equal deleted inserted replaced
49:0aa7d1437ada 50:adf6f7f216ea
26 import dmd.Declaration; 26 import dmd.Declaration;
27 import dmd.TypeFunction; 27 import dmd.TypeFunction;
28 import dmd.MATCH; 28 import dmd.MATCH;
29 import dmd.TypePointer; 29 import dmd.TypePointer;
30 import dmd.Argument; 30 import dmd.Argument;
31 import dmd.Token;
31 32
32 class IsExp : Expression 33 class IsExp : Expression
33 { 34 {
34 /* is(targ id tok tspec) 35 /* is(targ id tok tspec)
35 * is(targ id == tok2) 36 * is(targ id == tok2)
334 return new IntegerExp(loc, 0, Type.tbool); 335 return new IntegerExp(loc, 0, Type.tbool);
335 } 336 }
336 337
337 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 338 void toCBuffer(OutBuffer buf, HdrGenState* hgs)
338 { 339 {
339 assert(false); 340 buf.writestring("is(");
341 targ.toCBuffer(buf, id, hgs);
342 if (tok2 != TOKreserved)
343 {
344 buf.printf(" %s %s", Token.toChars(tok), Token.toChars(tok2));
345 }
346 else if (tspec)
347 {
348 if (tok == TOKcolon)
349 buf.writestring(" : ");
350 else
351 buf.writestring(" == ");
352 tspec.toCBuffer(buf, null, hgs);
353 }
354 version (DMDV2) {
355 if (parameters)
356 {
357 // First parameter is already output, so start with second
358 for (int i = 1; i < parameters.dim; i++)
359 {
360 buf.writeByte(',');
361 TemplateParameter tp = cast(TemplateParameter)parameters.data[i];
362 tp.toCBuffer(buf, hgs);
363 }
364 }
365 }
366 buf.writeByte(')');
340 } 367 }
341 } 368 }
342 369