comparison dmd/Token.d @ 174:af724d3510d7

lot os toCBuffer methods implemented moved shared Type.* stuff into Global
author korDen
date Sun, 10 Oct 2010 03:47:23 +0400
parents e28b18c23469
children
comparison
equal deleted inserted replaced
173:d237b38b5858 174:af724d3510d7
44 44
45 version (IN_GCC) { 45 version (IN_GCC) {
46 real float80value; // can't use this in a union! 46 real float80value; // can't use this in a union!
47 } 47 }
48 48
49 static string tochars[TOK.TOKMAX]; 49 static __gshared string tochars[TOK.TOKMAX];
50 /// static void *operator new(size_t sz); 50 /// static void *operator new(size_t sz);
51 51
52 int isKeyword() 52 int isKeyword()
53 { 53 {
54 assert(false); 54 assert(false);
59 assert(false); 59 assert(false);
60 } 60 }
61 61
62 string toChars() 62 string toChars()
63 { 63 {
64 static char buffer[3 + 3 * value.sizeof + 1];
65
66 string p; 64 string p;
67 65
66 char buffer[3 + 3 * value.sizeof + 1];
67
68 switch (value) 68 switch (value)
69 { 69 {
70 case TOK.TOKint32v: 70 case TOK.TOKint32v:
71 version (IN_GCC) { 71 version (IN_GCC) {
72 sprintf(buffer.ptr,"%d",cast(int)int64value); 72 sprintf(buffer.ptr,"%d",cast(int)int64value);
200 } 200 }
201 201
202 static string toChars(TOK value) 202 static string toChars(TOK value)
203 { 203 {
204 string p; 204 string p;
205 static char buffer[3 + 3 * value.sizeof + 1]; 205
206 char buffer[3 + 3 * value.sizeof + 1];
206 207
207 p = tochars[value]; 208 p = tochars[value];
208 if (!p) 209 if (!p)
209 { 210 {
210 int len = sprintf(buffer.ptr, "TOK%d".ptr, value); 211 int len = sprintf(buffer.ptr, "TOK%d".ptr, value);