diff trunk/src/dil/lexer/IdTable.d @ 618:07946b379006

Refactored the way dot expressions are parsed. DotExpression is a binary expression now. Added ModuleScopeExpression. Removed some obsolete expression classes. Added QualifiedType and ModuleScopeType. Removed some obsolete type node classes. Added genAnonymousID() to IdTable. Removed obsolete parser functions. Improved Node.getDocComments(). Added semantic() methods to some declaration classes.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 11 Jan 2008 00:42:35 +0100
parents fc351756cc84
children efa5fcb9aa14
line wrap: on
line diff
--- a/trunk/src/dil/lexer/IdTable.d	Thu Jan 10 19:47:34 2008 +0100
+++ b/trunk/src/dil/lexer/IdTable.d	Fri Jan 11 00:42:35 2008 +0100
@@ -127,6 +127,18 @@
     }
   }
   +/
+
+  static uint anonCount;
+  Identifier* genAnonymousID(char[] str)
+  {
+    ++anonCount;
+    auto x = anonCount;
+    // Convert count to a string and append it to str.
+    do
+      str = cast(char)('0' + (x % 10)) ~ str;
+    while (x /= 10)
+    return Identifier(str, TOK.Identifier);
+  }
 }
 
 unittest