rustdoc: Rename type rustdoc to gen::ctxt

This commit is contained in:
Brian Anderson
2012-01-15 23:01:05 -08:00
parent 906a7c2174
commit 7a9ba240a0
2 changed files with 19 additions and 24 deletions

View File

@@ -17,23 +17,18 @@ import std::io;
import io::writer_util;
import std::map;
type rustdoc = {
ps: pprust::ps,
w: io::writer
};
#[doc(
brief = "Documents a single crate item.",
args(rd = "Rustdoc context",
item = "AST item to document")
)]
fn doc_item(rd: rustdoc, item: @ast::item) {
fn doc_item(ctxt: gen::ctxt, item: @ast::item) {
let _fndoc0 = attr_parser::parse_fn(item.ident, item.attrs);
alt item.node {
ast::item_const(ty, expr) { }
ast::item_fn(decl, _, _) {
gen::write_fndoc(rd, item.ident, _fndoc0, decl);
gen::write_fndoc(ctxt, item.ident, _fndoc0, decl);
}
ast::item_mod(_mod) { }
ast::item_ty(ty, typarams) { }
@@ -59,11 +54,11 @@ fn main(argv: [str]) {
let crate = parse::from_file(argv[1]);
let w = io::stdout();
let rd = { ps: pprust::rust_printer(w), w: w };
gen::write_header(rd, argv[1]);
let ctxt = { ps: pprust::rust_printer(w), w: w };
gen::write_header(ctxt, argv[1]);
let v = visit::mk_simple_visitor(@{
visit_item: bind doc_item(rd, _)
visit_item: bind doc_item(ctxt, _)
with *visit::default_simple_visitor()});
visit::visit_crate(*crate, (), v);
}