changeset 796:f7688996bf08

Added member symbol to class Type. Fixed html_map.d to IE6.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 29 Feb 2008 19:25:21 +0100
parents 069317bb84cf
children cf2ad5df025c
files trunk/src/dil/semantic/Types.d trunk/src/html_map.d
diffstat 2 files changed, 28 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/semantic/Types.d	Fri Feb 29 03:04:15 2008 +0100
+++ b/trunk/src/dil/semantic/Types.d	Fri Feb 29 19:25:21 2008 +0100
@@ -11,8 +11,9 @@
 
 abstract class Type/* : Symbol*/
 {
-  Type next;
-  TYP tid; /// The ID of the type.
+  Type next;     /// The next type in the type structure.
+  TYP tid;       /// The ID of the type.
+  Symbol symbol; /// Not null if this type has a symbol.
 
   this(){}
 
@@ -40,6 +41,11 @@
   {
     return sizeOf();
   }
+
+  bool hasSymbol()
+  {
+    return symbol !is null;
+  }
 }
 
 class TypeBasic : Type
@@ -99,11 +105,10 @@
 
 class TypeEnum : Type
 {
-  Symbol enumSymbol;
-  this(Symbol enumSymbol, Type baseType)
+  this(Symbol symbol, Type baseType)
   {
     super(baseType, TYP.Enum);
-    this.enumSymbol = enumSymbol;
+    this.symbol = symbol;
   }
 
   Type baseType()
@@ -114,17 +119,19 @@
 
 class TypeStruct : Type
 {
-  this()
+  this(Symbol symbol)
   {
     super(null, TYP.Struct);
+    this.symbol = symbol;
   }
 }
 
 class TypeClass : Type
 {
-  this()
+  this(Symbol symbol)
   {
     super(null, TYP.Class);
+    this.symbol = symbol;
   }
 }
 
--- a/trunk/src/html_map.d	Fri Feb 29 03:04:15 2008 +0100
+++ b/trunk/src/html_map.d	Fri Feb 29 19:25:21 2008 +0100
@@ -1,24 +1,28 @@
 /// A map of document elements and D tokens to format strings.
 string[string] map = [
-  "DocHead" : `<html>`\n
+  "DocHead" : `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">`\n
+              `<html>`\n
               `<head>`\n
               `  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">`\n
               `  <link href="html.css" rel="stylesheet" type="text/css">`\n
               `</head>`\n
               `<body>`\n
               `<table><tr>`\n,
+  "CompBegin"   : `<td><div class="compilerinfo">`\n,
+  "CompEnd"     : "</div>\n</td></tr><tr>",
+  "LexerError"  : `<p class="error L">{0}({1},{2})L: {3}</p>`\n,
+  "ParserError" : `<p class="error P">{0}({1},{2})P: {3}</p>`\n,
+
+  "LineNumberBegin" : `<td class="linescolumn">`,
+  "LineNumberEnd"   : "</td>\n<td>",
+  "LineNumber"      : `<a id="L{0}" href="#L{0}">{0}</a>`,
+
+  "SourceBegin" : `<td><pre class="sourcecode">`\n,
+  "SourceEnd"   : "\n</pre></td>",
+
   "DocEnd"  : "\n</tr></table>"
               "\n</body>"
               "\n</html>",
-  "SourceBegin" : `<td><pre class="sourcecode">`,
-  "SourceEnd"   : "\n</pre></td>",
-  "CompBegin"   : `<div class="compilerinfo">`\n,
-  "CompEnd"     : "</div>\n",
-  "LexerError"  : `<p class="error L">{0}({1},{2})L: {3}</p>`\n,
-  "ParserError" : `<p class="error P">{0}({1},{2})P: {3}</p>`\n,
-  "LineNumberBegin" : `<td class="linescolumn">`,
-  "LineNumberEnd"   : `</td><td>`,
-  "LineNumber"      : `<a id="L{0}" href="#L{0}">{0}</a>`,
 
   // Node categories:
   "Declaration" : "d",