summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-15 15:06:59 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-16 01:07:41 -0800
commit140fbd301962991afac2358e445b48b4f647ca43 (patch)
treef303d6bc7bb83649ffa4037602dabd829832b6c2 /src
parente32cf827ffd7ae665ced523de7885197f1fa93a0 (diff)
downloadrust-140fbd301962991afac2358e445b48b4f647ca43.tar.gz
rust-140fbd301962991afac2358e445b48b4f647ca43.zip
rustdoc: Move document model into doc module
Diffstat (limited to 'src')
-rw-r--r--src/rustdoc/doc.rs14
-rw-r--r--src/rustdoc/rustdoc.rc3
-rwxr-xr-xsrc/rustdoc/rustdoc.rs19
3 files changed, 18 insertions, 18 deletions
diff --git a/src/rustdoc/doc.rs b/src/rustdoc/doc.rs
new file mode 100644
index 00000000000..cb3fab1299c
--- /dev/null
+++ b/src/rustdoc/doc.rs
@@ -0,0 +1,14 @@
+type cratedoc = {
+    mods: [moddoc]
+};
+
+type moddoc = {
+    fns: [fndoc]
+};
+
+type fndoc = {
+    brief: str,
+    desc: option::t<str>,
+    return: option::t<str>,
+    args: map::hashmap<str, str>
+};
diff --git a/src/rustdoc/rustdoc.rc b/src/rustdoc/rustdoc.rc
index 668edbe6e33..390ba33a55e 100644
--- a/src/rustdoc/rustdoc.rc
+++ b/src/rustdoc/rustdoc.rc
@@ -7,4 +7,5 @@
 #[license = "MIT"];
 #[crate_type = "bin"];
 
-mod parse;
\ No newline at end of file
+mod parse;
+mod doc;
\ No newline at end of file
diff --git a/src/rustdoc/rustdoc.rs b/src/rustdoc/rustdoc.rs
index fefe7c63513..1f30fb4302e 100755
--- a/src/rustdoc/rustdoc.rs
+++ b/src/rustdoc/rustdoc.rs
@@ -22,21 +22,6 @@ type rustdoc = {
     w: io::writer
 };
 
-type cratedoc = {
-    mods: [moddoc]
-};
-
-type moddoc = {
-    fns: [fndoc]
-};
-
-type fndoc = {
-    brief: str,
-    desc: option::t<str>,
-    return: option::t<str>,
-    args: map::hashmap<str, str>
-};
-
 #[doc(
   brief = "Documents a single function.",
   args(rd = "Rustdoc context",
@@ -44,7 +29,7 @@ type fndoc = {
        doc = "Function docs extracted from attributes",
        _fn = "AST object representing this function")
 )]
-fn doc_fn(rd: rustdoc, ident: str, doc: fndoc, decl: ast::fn_decl) {
+fn doc_fn(rd: rustdoc, ident: str, doc: doc::fndoc, decl: ast::fn_decl) {
     rd.w.write_line("## Function `" + ident + "`");
     rd.w.write_line(doc.brief);
     alt doc.desc {
@@ -84,7 +69,7 @@ fn doc_fn(rd: rustdoc, ident: str, doc: fndoc, decl: ast::fn_decl) {
   args(items = "Doc attribute contents"),
   return = "Parsed function docs."
 )]
-fn parse_compound_fndoc(items: [@ast::meta_item]) -> fndoc {
+fn parse_compound_fndoc(items: [@ast::meta_item]) -> doc::fndoc {
     let brief = none;
     let desc = none;
     let return = none;