rustdoc: Add extract module for building doc model from AST

This commit is contained in:
Brian Anderson 2012-01-15 17:23:19 -08:00
parent 555d5aed37
commit 995c50b69b
2 changed files with 23 additions and 0 deletions

22
src/rustdoc/extract.rs Normal file
View File

@ -0,0 +1,22 @@
#[doc = "Converting the Rust AST to the rustdoc document model"];
import rustc::syntax::ast;
#[doc = "Converts the Rust AST to the rustdoc document model"]
fn extract(crate: @ast::crate) -> doc::cratedoc {
{
mods: []
}
}
#[cfg(test)]
mod tests {
#[test]
fn extract_empty_crate() {
let source = ""; // empty crate
let ast = parse::from_str(source);
let doc = extract(ast);
assert doc.mods == [];
}
}

View File

@ -8,5 +8,6 @@
#[crate_type = "bin"];
mod parse;
mod extract;
mod doc;
mod gen;