diff trunk/src/dil/doc/Doc.d @ 731:ca7607226caa

Added new module cmd.DDoc. Added command 'ddoc'. Fixed scanArguments() in dil.doc.Macro.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 03 Feb 2008 19:56:47 +0100
parents 41cad5ca4863
children f88b5285b86b
line wrap: on
line diff
--- a/trunk/src/dil/doc/Doc.d	Sun Feb 03 18:59:34 2008 +0100
+++ b/trunk/src/dil/doc/Doc.d	Sun Feb 03 19:56:47 2008 +0100
@@ -10,6 +10,8 @@
 import dil.Unicode;
 import common;
 
+import tango.text.Ascii : toLower;
+
 class DDocComment
 {
   Section[] sections;
@@ -22,6 +24,22 @@
     this.summary = summary;
     this.description = description;
   }
+
+  Section getCopyright()
+  {
+    foreach (section; sections)
+      if (toLower(section.name) == "copyright")
+        return section;
+    return null;
+  }
+}
+
+/// Returns a node's DDocComment.
+DDocComment getDDocComment(Node node)
+{
+  DDocParser p;
+  p.parse(getDDocText(getDocTokens(node)));
+  return new DDocComment(p.sections, p.summary, p.description);
 }
 
 struct DDocParser
@@ -171,8 +189,8 @@
 
 class MacrosSection : Section
 {
-  string[] macroNames; /// Parameter names.
-  string[] macroTexts; /// Parameter descriptions.
+  string[] macroNames; /// Macro names.
+  string[] macroTexts; /// Macro texts.
   this(string name, string text)
   {
     super(name, text);