From 140fbd301962991afac2358e445b48b4f647ca43 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 15 Jan 2012 15:06:59 -0800 Subject: [PATCH] rustdoc: Move document model into doc module --- src/rustdoc/doc.rs | 14 ++++++++++++++ src/rustdoc/rustdoc.rc | 3 ++- src/rustdoc/rustdoc.rs | 19 ++----------------- 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 src/rustdoc/doc.rs 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, + return: option::t, + args: map::hashmap +}; 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, - return: option::t, - args: map::hashmap -}; - #[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;