changeset 754:c7a5499faa77

Improved DDoc related code.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 13 Feb 2008 17:10:55 +0100
parents 6efa938dbef7
children 90668b83ae5e
files trunk/src/cmd/DDoc.d trunk/src/dil/ast/Visitor.d trunk/src/dil/doc/Doc.d trunk/src/dil/semantic/Interpreter.d
diffstat 4 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/cmd/DDoc.d	Wed Feb 13 17:08:47 2008 +0100
+++ b/trunk/src/cmd/DDoc.d	Wed Feb 13 17:10:55 2008 +0100
@@ -320,6 +320,12 @@
           goto default;
         result ~= "&amp;";
         break;
+      case '\n':
+        if (!(p+1 < end && p[1] == '\n'))
+          goto default;
+        ++p;
+        result ~= "$(DDOC_BLANKLINE)";
+        break;
       case '-':
         if (p+2 < end && p[1] == '-' && p[2] == '-')
         {
--- a/trunk/src/dil/ast/Visitor.d	Wed Feb 13 17:08:47 2008 +0100
+++ b/trunk/src/dil/ast/Visitor.d	Wed Feb 13 17:10:55 2008 +0100
@@ -94,7 +94,7 @@
   static assert(dispatch_vtable.length == classNames.length, "vtable length doesn't match number of classes");
 
   // Returns the dispatch function for n.
-  T function(Visitor,T) getDispatchFunction(T)(T n)
+  final T function(Visitor,T) getDispatchFunction(T)(T n)
   {
     return cast(T function(Visitor,T))dispatch_vtable[n.kind];
   }
--- a/trunk/src/dil/doc/Doc.d	Wed Feb 13 17:08:47 2008 +0100
+++ b/trunk/src/dil/doc/Doc.d	Wed Feb 13 17:10:55 2008 +0100
@@ -382,10 +382,14 @@
     if (newline)
     { // Ignore commentChars at the beginning of each new line.
       newline = false;
+      auto begin = i;
       while (i < len && isspace(result[i]))
         i++;
-      while (i < len && result[i] == commentChar)
-        i++;
+      if (i < len && result[i] == commentChar)
+        while (++i < len && result[i] == commentChar)
+        {}
+      else
+        i = begin; // Reset. No commentChar found.
       if (i >= len)
         break;
     }
--- a/trunk/src/dil/semantic/Interpreter.d	Wed Feb 13 17:08:47 2008 +0100
+++ b/trunk/src/dil/semantic/Interpreter.d	Wed Feb 13 17:10:55 2008 +0100
@@ -62,7 +62,7 @@
          NK.BoolExpression, NK.StringExpression:
       return true;
     default:
-      return false;
     }
+    return false;
   }
 }