Mercurial > projects > ldc
diff dmd/identifier.c @ 510:6aee82889553
Merged DMD 1.034, array operations are not yet implemented ;)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Thu, 14 Aug 2008 06:55:41 +0200 |
parents | 788401029ecf |
children | f5d5bc9295b1 |
line wrap: on
line diff
--- a/dmd/identifier.c Thu Aug 14 03:09:26 2008 +0200 +++ b/dmd/identifier.c Thu Aug 14 06:55:41 2008 +0200 @@ -81,15 +81,21 @@ return DYNCAST_IDENTIFIER; } -Identifier *Identifier::generateId(char *prefix) + +Identifier *Identifier::generateId(const char *prefix) +{ + static size_t i; + + return generateId(prefix, ++i); +} + +Identifier *Identifier::generateId(const char *prefix, size_t i) { OutBuffer buf; - char *id; - static unsigned i; buf.writestring(prefix); - buf.printf("%u", ++i); + buf.printf("%zu", i); - id = buf.toChars(); + char *id = buf.toChars(); buf.data = NULL; - return new Identifier(id, TOKidentifier); + return Lexer::idPool(id); }