diff trunk/src/dil/ast/Visitor.d @ 797:cf2ad5df025c

Added documentation comments. Removed Lexer.loadKeywords() and revised Lexer.isReservedIdentifier(). Also removed Lexer.getTokens(). Renamed keywords to g_reservedIds. Renamed classNames to g_classNames. Added PRE and DMDBUG macros.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 29 Feb 2008 22:51:24 +0100
parents 5e3ef1b2011c
children
line wrap: on
line diff
--- a/trunk/src/dil/ast/Visitor.d	Fri Feb 29 19:25:21 2008 +0100
+++ b/trunk/src/dil/ast/Visitor.d	Fri Feb 29 22:51:24 2008 +0100
@@ -21,7 +21,7 @@
 char[] generateVisitMethods()
 {
   char[] text;
-  foreach (className; classNames)
+  foreach (className; g_classNames)
     text ~= "returnType!(\""~className~"\") visit("~className~" node){return node;}\n";
   return text;
 }
@@ -63,7 +63,7 @@
 char[] generateDispatchFunctions()
 {
   char[] text;
-  foreach (className; classNames)
+  foreach (className; g_classNames)
     text ~= "returnType!(\""~className~"\") visit"~className~"(Visitor visitor, "~className~" c)\n"
             "{ return visitor.visit(c); }\n";
   return text;
@@ -83,7 +83,7 @@
 char[] generateVTable()
 {
   char[] text = "[";
-  foreach (className; classNames)
+  foreach (className; g_classNames)
     text ~= "cast(void*)&visit"~className~",\n";
   return text[0..$-2]~"]"; // slice away last ",\n"
 }
@@ -102,7 +102,7 @@
 
   /// The table holding function pointers to the second dispatch functions.
   static const void*[] dispatch_vtable = mixin(generateVTable());
-  static assert(dispatch_vtable.length == classNames.length, "vtable length doesn't match number of classes");
+  static assert(dispatch_vtable.length == g_classNames.length, "vtable length doesn't match number of classes");
 
   /// Looks up the second dispatch function for n and returns that.
   Node function(Visitor, Node) getDispatchFunction()(Node n)