comparison trunk/src/dil/lexer/IdTable.d @ 714:140469ecb90e

Added code and applied fixes. Added getDDocText() and isLineComment(). Renamed getDocComments() to getDocTokens(). Fixed it as well. printSymbolTable() is called recursively now. Fixed genAnonymousID().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Thu, 31 Jan 2008 01:10:30 +0100
parents efa5fcb9aa14
children 5e3ef1b2011c
comparison
equal deleted inserted replaced
713:1bfae3480fdc 714:140469ecb90e
127 } 127 }
128 } 128 }
129 +/ 129 +/
130 130
131 static uint anonCount; 131 static uint anonCount;
132 Identifier* genAnonymousID(char[] str) 132 Identifier* genAnonymousID(char[] prefix)
133 { 133 {
134 ++anonCount; 134 ++anonCount;
135 auto x = anonCount; 135 auto x = anonCount;
136 // Convert count to a string and append it to str. 136 // Convert count to a string and append it to str.
137 char[] num;
137 do 138 do
138 str = cast(char)('0' + (x % 10)) ~ str; 139 num = cast(char)('0' + (x % 10)) ~ num;
139 while (x /= 10) 140 while (x /= 10)
140 return Identifier(str, TOK.Identifier); 141 return Identifier(prefix ~ num, TOK.Identifier);
141 } 142 }
142 143
143 Identifier* genAnonEnumID() 144 Identifier* genAnonEnumID()
144 { 145 {
145 return genAnonymousID("__anonenum"); 146 return genAnonymousID("__anonenum");