rustdoc: Remove legacy exports

This commit is contained in:
Brian Anderson 2012-11-19 18:00:12 -08:00
parent a27f5239bd
commit 145e02347e
25 changed files with 102 additions and 213 deletions

View File

@ -21,20 +21,13 @@ use rustc::back::link;
use rustc::metadata::filesearch;
use rustc::front;
export Ctxt;
export CtxtHandler;
export Srv;
export from_str;
export from_file;
export exec;
type Ctxt = {
pub type Ctxt = {
ast: @ast::crate,
ast_map: ast_map::map
};
type SrvOwner<T> = fn(srv: Srv) -> T;
type CtxtHandler<T> = fn~(ctxt: Ctxt) -> T;
pub type CtxtHandler<T> = fn~(ctxt: Ctxt) -> T;
type Parser = fn~(Session, ~str) -> @ast::crate;
enum Msg {
@ -42,15 +35,15 @@ enum Msg {
Exit
}
enum Srv = {
pub enum Srv = {
ch: comm::Chan<Msg>
};
fn from_str<T>(source: ~str, owner: SrvOwner<T>) -> T {
pub fn from_str<T>(source: ~str, owner: SrvOwner<T>) -> T {
run(owner, source, parse::from_str_sess)
}
fn from_file<T>(file: ~str, owner: SrvOwner<T>) -> T {
pub fn from_file<T>(file: ~str, owner: SrvOwner<T>) -> T {
run(owner, file, |sess, f| parse::from_file_sess(sess, &Path(f)))
}
@ -88,7 +81,7 @@ fn act(po: comm::Port<Msg>, source: ~str, parse: Parser) {
}
}
fn exec<T:Send>(
pub fn exec<T:Send>(
srv: Srv,
+f: fn~(ctxt: Ctxt) -> T
) -> T {

View File

@ -9,11 +9,7 @@ use syntax::ast;
use syntax::attr;
use core::tuple;
export CrateAttrs;
export parse_crate, parse_desc;
export parse_hidden;
type CrateAttrs = {
pub type CrateAttrs = {
name: Option<~str>
};
@ -48,7 +44,7 @@ fn doc_metas(
return doc_metas;
}
fn parse_crate(attrs: ~[ast::attribute]) -> CrateAttrs {
pub fn parse_crate(attrs: ~[ast::attribute]) -> CrateAttrs {
let link_metas = attr::find_linkage_metas(attrs);
{
@ -80,7 +76,7 @@ fn should_not_extract_crate_name_if_no_name_value_in_link_attribute() {
assert attrs.name == None;
}
fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
pub fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
let doc_strs = do doc_metas(attrs).filter_map |meta| {
attr::get_meta_item_value_str(*meta)
};
@ -107,7 +103,7 @@ fn parse_desc_should_parse_simple_doc_attributes() {
assert attrs == Some(~"basic");
}
fn parse_hidden(attrs: ~[ast::attribute]) -> bool {
pub fn parse_hidden(attrs: ~[ast::attribute]) -> bool {
do doc_metas(attrs).find |meta| {
match attr::get_meta_item_list(meta) {
Some(metas) => {

View File

@ -12,9 +12,7 @@ use syntax::ast;
use syntax::ast_map;
use std::map::HashMap;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"attr",
f: run

View File

@ -1,21 +1,12 @@
use result::Result;
use std::getopts;
export OutputFormat;
export OutputStyle;
export Config;
export default_config;
export parse_config;
export usage;
export Markdown, PandocHtml;
export DocPerCrate, DocPerMod;
/// The type of document to output
enum OutputFormat {
pub enum OutputFormat {
/// Markdown
Markdown,
pub Markdown,
/// HTML, via markdown and pandoc
PandocHtml
pub PandocHtml
}
impl OutputFormat : cmp::Eq {
@ -36,11 +27,11 @@ impl OutputFormat : cmp::Eq {
}
/// How to organize the output
enum OutputStyle {
pub enum OutputStyle {
/// All in a single document
DocPerCrate,
pub DocPerCrate,
/// Each module in its own document
DocPerMod
pub DocPerMod
}
impl OutputStyle : cmp::Eq {
@ -61,7 +52,7 @@ impl OutputStyle : cmp::Eq {
}
/// The configuration for a rustdoc session
type Config = {
pub type Config = {
input_crate: Path,
output_dir: Path,
output_format: OutputFormat,
@ -90,7 +81,7 @@ fn opts() -> ~[(getopts::Opt, ~str)] {
]
}
fn usage() {
pub fn usage() {
use io::println;
println(~"Usage: rustdoc [options] <cratefile>\n");
@ -101,7 +92,7 @@ fn usage() {
println(~"");
}
fn default_config(input_crate: &Path) -> Config {
pub fn default_config(input_crate: &Path) -> Config {
{
input_crate: *input_crate,
output_dir: Path("."),

View File

@ -7,9 +7,7 @@ is interpreted as the brief description.
use doc::ItemUtils;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"desc_to_brief",
f: run

View File

@ -1,8 +1,8 @@
//! The document model
type AstId = int;
pub type AstId = int;
type Doc_ = {
pub type Doc_ = {
pages: ~[Page]
};
@ -23,7 +23,7 @@ impl Doc_ : cmp::Eq {
pure fn ne(&self, other: &Doc_) -> bool { !(*self).eq(other) }
}
enum Doc {
pub enum Doc {
Doc_(Doc_)
}
@ -40,7 +40,7 @@ impl Doc : cmp::Eq {
pure fn ne(&self, other: &Doc) -> bool { *(*self) != *(*other) }
}
enum Page {
pub enum Page {
CratePage(CrateDoc),
ItemPage(ItemTag)
}
@ -88,7 +88,7 @@ impl Page : cmp::Eq {
pure fn ne(&self, other: &Page) -> bool { !(*self).eq(other) }
}
enum Implementation {
pub enum Implementation {
Required,
Provided,
}
@ -115,7 +115,7 @@ impl Implementation : cmp::Eq {
* Most rustdocs can be parsed into 'sections' according to their markdown
* headers
*/
type Section = {
pub type Section = {
header: ~str,
body: ~str
};
@ -140,7 +140,7 @@ impl Section : cmp::Eq {
// FIXME (#2596): We currently give topmod the name of the crate. There
// would probably be fewer special cases if the crate had its own name
// and topmod's name was the empty string.
type CrateDoc = {
pub type CrateDoc = {
topmod: ModDoc,
};
@ -161,7 +161,7 @@ impl CrateDoc : cmp::Eq {
pure fn ne(&self, other: &CrateDoc) -> bool { !(*self).eq(other) }
}
enum ItemTag {
pub enum ItemTag {
ModTag(ModDoc),
NmodTag(NmodDoc),
ConstTag(ConstDoc),
@ -300,7 +300,7 @@ impl ItemTag : cmp::Eq {
pure fn ne(&self, other: &ItemTag) -> bool { !(*self).eq(other) }
}
type ItemDoc = {
pub type ItemDoc = {
id: AstId,
name: ~str,
path: ~[~str],
@ -340,7 +340,7 @@ impl ItemDoc : cmp::Eq {
pure fn ne(&self, other: &ItemDoc) -> bool { !(*self).eq(other) }
}
type SimpleItemDoc = {
pub type SimpleItemDoc = {
item: ItemDoc,
sig: Option<~str>
};
@ -362,7 +362,7 @@ impl SimpleItemDoc : cmp::Eq {
pure fn ne(&self, other: &SimpleItemDoc) -> bool { !(*self).eq(other) }
}
type ModDoc_ = {
pub type ModDoc_ = {
item: ItemDoc,
items: ~[ItemTag],
index: Option<Index>
@ -389,7 +389,7 @@ impl ModDoc_ : cmp::Eq {
pure fn ne(&self, other: &ModDoc_) -> bool { !(*self).eq(other) }
}
enum ModDoc {
pub enum ModDoc {
ModDoc_(ModDoc_)
}
@ -406,7 +406,7 @@ impl ModDoc : cmp::Eq {
pure fn ne(&self, other: &ModDoc) -> bool { *(*self) != *(*other) }
}
type NmodDoc = {
pub type NmodDoc = {
item: ItemDoc,
fns: ~[FnDoc],
index: Option<Index>
@ -433,11 +433,11 @@ impl NmodDoc : cmp::Eq {
pure fn ne(&self, other: &NmodDoc) -> bool { !(*self).eq(other) }
}
type ConstDoc = SimpleItemDoc;
pub type ConstDoc = SimpleItemDoc;
type FnDoc = SimpleItemDoc;
pub type FnDoc = SimpleItemDoc;
type EnumDoc = {
pub type EnumDoc = {
item: ItemDoc,
variants: ~[VariantDoc]
};
@ -459,7 +459,7 @@ impl EnumDoc : cmp::Eq {
pure fn ne(&self, other: &EnumDoc) -> bool { !(*self).eq(other) }
}
type VariantDoc = {
pub type VariantDoc = {
name: ~str,
desc: Option<~str>,
sig: Option<~str>
@ -486,7 +486,7 @@ impl VariantDoc : cmp::Eq {
pure fn ne(&self, other: &VariantDoc) -> bool { !(*self).eq(other) }
}
type TraitDoc = {
pub type TraitDoc = {
item: ItemDoc,
methods: ~[MethodDoc]
};
@ -508,7 +508,7 @@ impl TraitDoc : cmp::Eq {
pure fn ne(&self, other: &TraitDoc) -> bool { !(*self).eq(other) }
}
type MethodDoc = {
pub type MethodDoc = {
name: ~str,
brief: Option<~str>,
desc: Option<~str>,
@ -544,7 +544,7 @@ impl MethodDoc : cmp::Eq {
pure fn ne(&self, other: &MethodDoc) -> bool { !(*self).eq(other) }
}
type ImplDoc = {
pub type ImplDoc = {
item: ItemDoc,
trait_types: ~[~str],
self_ty: Option<~str>,
@ -574,9 +574,9 @@ impl ImplDoc : cmp::Eq {
pure fn ne(&self, other: &ImplDoc) -> bool { !(*self).eq(other) }
}
type TyDoc = SimpleItemDoc;
pub type TyDoc = SimpleItemDoc;
type StructDoc = {
pub type StructDoc = {
item: ItemDoc,
fields: ~[~str],
sig: Option<~str>
@ -603,7 +603,7 @@ impl StructDoc : cmp::Eq {
pure fn ne(&self, other: &StructDoc) -> bool { !(*self).eq(other) }
}
type Index = {
pub type Index = {
entries: ~[IndexEntry]
};
@ -634,7 +634,7 @@ impl Index : cmp::Eq {
* * brief - The brief description
* * link - A format-specific string representing the link target
*/
type IndexEntry = {
pub type IndexEntry = {
kind: ~str,
name: ~str,
brief: Option<~str>,
@ -764,7 +764,7 @@ impl ModDoc {
}
}
trait PageUtils {
pub trait PageUtils {
fn mods() -> ~[ModDoc];
fn nmods() -> ~[NmodDoc];
fn fns() -> ~[FnDoc];
@ -850,7 +850,7 @@ impl ~[Page]: PageUtils {
}
}
trait Item {
pub trait Item {
pure fn item() -> ItemDoc;
}
@ -898,7 +898,7 @@ impl StructDoc: Item {
pure fn item() -> ItemDoc { self.item }
}
trait ItemUtils {
pub trait ItemUtils {
pure fn id() -> AstId;
pure fn name() -> ~str;
pure fn path() -> ~[~str];

View File

@ -1,8 +1,6 @@
//! Escapes text sequences
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
text_pass::mk_pass(~"escape", escape)
}

View File

@ -4,8 +4,6 @@ use syntax::ast;
use doc::ItemUtils;
use task::local_data::local_data_get;
export from_srv, extract, to_str, interner;
/* can't import macros yet, so this is copied from token.rs. See its comment
* there. */
macro_rules! interner_key (
@ -15,17 +13,17 @@ macro_rules! interner_key (
// Hack; rather than thread an interner through everywhere, rely on
// thread-local data
fn to_str(id: ast::ident) -> ~str {
pub fn to_str(id: ast::ident) -> ~str {
let intr = unsafe{ local_data_get(interner_key!()) };
return *(*intr.get()).get(id);
}
fn interner() -> @syntax::parse::token::ident_interner {
pub fn interner() -> @syntax::parse::token::ident_interner {
return *(unsafe{ local_data_get(interner_key!()) }).get();
}
fn from_srv(
pub fn from_srv(
srv: astsrv::Srv,
default_name: ~str
) -> doc::Doc {
@ -37,7 +35,7 @@ fn from_srv(
}
}
fn extract(
pub fn extract(
crate: @ast::crate,
default_name: ~str
) -> doc::Doc {

View File

@ -1,25 +1,4 @@
export Fold;
export default_seq_fold;
export default_seq_fold_doc;
export default_seq_fold_crate;
export default_seq_fold_item;
export default_seq_fold_mod;
export default_seq_fold_nmod;
export default_seq_fold_fn;
export default_seq_fold_const;
export default_seq_fold_enum;
export default_seq_fold_trait;
export default_seq_fold_impl;
export default_seq_fold_type;
export default_seq_fold_struct;
export default_par_fold;
export default_par_fold_mod;
export default_par_fold_nmod;
export default_any_fold;
export default_any_fold_mod;
export default_any_fold_nmod;
enum Fold<T> = Fold_<T>;
pub enum Fold<T> = Fold_<T>;
type FoldDoc<T> = fn~(fold: Fold<T>, doc: doc::Doc) -> doc::Doc;
type FoldCrate<T> = fn~(fold: Fold<T>, doc: doc::CrateDoc) -> doc::CrateDoc;
@ -86,7 +65,7 @@ fn mk_fold<T:Copy>(
})
}
fn default_any_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
pub fn default_any_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
mk_fold(
ctxt,
|f, d| default_seq_fold_doc(f, d),
@ -104,7 +83,7 @@ fn default_any_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
)
}
fn default_seq_fold<T:Copy>(ctxt: T) -> Fold<T> {
pub fn default_seq_fold<T:Copy>(ctxt: T) -> Fold<T> {
mk_fold(
ctxt,
|f, d| default_seq_fold_doc(f, d),
@ -122,7 +101,7 @@ fn default_seq_fold<T:Copy>(ctxt: T) -> Fold<T> {
)
}
fn default_par_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
pub fn default_par_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
mk_fold(
ctxt,
|f, d| default_seq_fold_doc(f, d),
@ -140,7 +119,7 @@ fn default_par_fold<T:Send Copy>(ctxt: T) -> Fold<T> {
)
}
fn default_seq_fold_doc<T>(fold: Fold<T>, doc: doc::Doc) -> doc::Doc {
pub fn default_seq_fold_doc<T>(fold: Fold<T>, doc: doc::Doc) -> doc::Doc {
doc::Doc_({
pages: do vec::map(doc.pages) |page| {
match *page {
@ -156,7 +135,7 @@ fn default_seq_fold_doc<T>(fold: Fold<T>, doc: doc::Doc) -> doc::Doc {
})
}
fn default_seq_fold_crate<T>(
pub fn default_seq_fold_crate<T>(
fold: Fold<T>,
doc: doc::CrateDoc
) -> doc::CrateDoc {
@ -165,14 +144,14 @@ fn default_seq_fold_crate<T>(
}
}
fn default_seq_fold_item<T>(
pub fn default_seq_fold_item<T>(
_fold: Fold<T>,
doc: doc::ItemDoc
) -> doc::ItemDoc {
doc
}
fn default_any_fold_mod<T:Send Copy>(
pub fn default_any_fold_mod<T:Send Copy>(
fold: Fold<T>,
doc: doc::ModDoc
) -> doc::ModDoc {
@ -185,7 +164,7 @@ fn default_any_fold_mod<T:Send Copy>(
})
}
fn default_seq_fold_mod<T>(
pub fn default_seq_fold_mod<T>(
fold: Fold<T>,
doc: doc::ModDoc
) -> doc::ModDoc {
@ -198,7 +177,7 @@ fn default_seq_fold_mod<T>(
})
}
fn default_par_fold_mod<T:Send Copy>(
pub fn default_par_fold_mod<T:Send Copy>(
fold: Fold<T>,
doc: doc::ModDoc
) -> doc::ModDoc {
@ -211,7 +190,7 @@ fn default_par_fold_mod<T:Send Copy>(
})
}
fn default_any_fold_nmod<T:Send Copy>(
pub fn default_any_fold_nmod<T:Send Copy>(
fold: Fold<T>,
doc: doc::NmodDoc
) -> doc::NmodDoc {
@ -224,7 +203,7 @@ fn default_any_fold_nmod<T:Send Copy>(
}
}
fn default_seq_fold_nmod<T>(
pub fn default_seq_fold_nmod<T>(
fold: Fold<T>,
doc: doc::NmodDoc
) -> doc::NmodDoc {
@ -237,7 +216,7 @@ fn default_seq_fold_nmod<T>(
}
}
fn default_par_fold_nmod<T:Send Copy>(
pub fn default_par_fold_nmod<T:Send Copy>(
fold: Fold<T>,
doc: doc::NmodDoc
) -> doc::NmodDoc {
@ -250,7 +229,7 @@ fn default_par_fold_nmod<T:Send Copy>(
}
}
fn fold_ItemTag<T>(fold: Fold<T>, doc: doc::ItemTag) -> doc::ItemTag {
pub fn fold_ItemTag<T>(fold: Fold<T>, doc: doc::ItemTag) -> doc::ItemTag {
match doc {
doc::ModTag(ModDoc) => {
doc::ModTag(fold.fold_mod(fold, ModDoc))
@ -282,7 +261,7 @@ fn fold_ItemTag<T>(fold: Fold<T>, doc: doc::ItemTag) -> doc::ItemTag {
}
}
fn default_seq_fold_fn<T>(
pub fn default_seq_fold_fn<T>(
fold: Fold<T>,
doc: doc::FnDoc
) -> doc::FnDoc {
@ -292,7 +271,7 @@ fn default_seq_fold_fn<T>(
}
}
fn default_seq_fold_const<T>(
pub fn default_seq_fold_const<T>(
fold: Fold<T>,
doc: doc::ConstDoc
) -> doc::ConstDoc {
@ -302,7 +281,7 @@ fn default_seq_fold_const<T>(
}
}
fn default_seq_fold_enum<T>(
pub fn default_seq_fold_enum<T>(
fold: Fold<T>,
doc: doc::EnumDoc
) -> doc::EnumDoc {
@ -312,7 +291,7 @@ fn default_seq_fold_enum<T>(
}
}
fn default_seq_fold_trait<T>(
pub fn default_seq_fold_trait<T>(
fold: Fold<T>,
doc: doc::TraitDoc
) -> doc::TraitDoc {
@ -322,7 +301,7 @@ fn default_seq_fold_trait<T>(
}
}
fn default_seq_fold_impl<T>(
pub fn default_seq_fold_impl<T>(
fold: Fold<T>,
doc: doc::ImplDoc
) -> doc::ImplDoc {
@ -332,7 +311,7 @@ fn default_seq_fold_impl<T>(
}
}
fn default_seq_fold_type<T>(
pub fn default_seq_fold_type<T>(
fold: Fold<T>,
doc: doc::TyDoc
) -> doc::TyDoc {
@ -342,7 +321,7 @@ fn default_seq_fold_type<T>(
}
}
fn default_seq_fold_struct<T>(
pub fn default_seq_fold_struct<T>(
fold: Fold<T>,
doc: doc::StructDoc
) -> doc::StructDoc {

View File

@ -2,9 +2,7 @@
use doc::ItemUtils;
export mk_pass;
fn mk_pass(config: config::Config) -> Pass {
pub fn mk_pass(config: config::Config) -> Pass {
{
name: ~"markdown_index",
f: fn~(srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {

View File

@ -5,10 +5,7 @@ use markdown_writer::Writer;
use markdown_writer::WriterUtils;
use markdown_writer::WriterFactory;
export mk_pass;
export header_kind, header_name, header_text;
fn mk_pass(+writer_factory: WriterFactory) -> Pass {
pub fn mk_pass(+writer_factory: WriterFactory) -> Pass {
let f = fn~(move writer_factory,
srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {
run(srv, doc, copy writer_factory)
@ -183,7 +180,7 @@ fn write_header_(ctxt: Ctxt, lvl: Hlvl, title: ~str) {
ctxt.w.write_line(~"");
}
fn header_kind(doc: doc::ItemTag) -> ~str {
pub fn header_kind(doc: doc::ItemTag) -> ~str {
match doc {
doc::ModTag(_) => {
if doc.id() == syntax::ast::crate_node_id {
@ -219,7 +216,7 @@ fn header_kind(doc: doc::ItemTag) -> ~str {
}
}
fn header_name(doc: doc::ItemTag) -> ~str {
pub fn header_name(doc: doc::ItemTag) -> ~str {
let fullpath = str::connect(doc.path() + ~[doc.name()], ~"::");
match doc {
doc::ModTag(_) if doc.id() != syntax::ast::crate_node_id => {
@ -248,7 +245,7 @@ fn header_name(doc: doc::ItemTag) -> ~str {
}
}
fn header_text(doc: doc::ItemTag) -> ~str {
pub fn header_text(doc: doc::ItemTag) -> ~str {
match doc {
doc::ImplTag(ImplDoc) => {
let header_kind = header_kind(doc);

View File

@ -2,23 +2,15 @@ use doc::ItemUtils;
use io::ReaderUtil;
use std::future;
export WriteInstr;
export Writer;
export WriterFactory;
export WriterUtils;
export make_writer_factory;
export future_writer_factory;
export make_filename;
enum WriteInstr {
pub enum WriteInstr {
Write(~str),
Done
}
type Writer = fn~(+v: WriteInstr);
type WriterFactory = fn~(page: doc::Page) -> Writer;
pub type Writer = fn~(+v: WriteInstr);
pub type WriterFactory = fn~(page: doc::Page) -> Writer;
trait WriterUtils {
pub trait WriterUtils {
fn write_str(str: ~str);
fn write_line(str: ~str);
fn write_done();
@ -38,7 +30,7 @@ impl Writer: WriterUtils {
}
}
fn make_writer_factory(config: config::Config) -> WriterFactory {
pub fn make_writer_factory(config: config::Config) -> WriterFactory {
match config.output_format {
config::Markdown => {
markdown_writer_factory(config)
@ -175,7 +167,7 @@ fn make_local_filename(
config.output_dir.push_rel(&filename)
}
fn make_filename(
pub fn make_filename(
config: config::Config,
page: doc::Page
) -> Path {
@ -269,7 +261,7 @@ fn write_file(path: &Path, s: ~str) {
}
}
fn future_writer_factory(
pub fn future_writer_factory(
) -> (WriterFactory, comm::Port<(doc::Page, ~str)>) {
let markdown_po = comm::Port();
let markdown_ch = comm::Chan(&markdown_po);

View File

@ -8,9 +8,7 @@ individual modules, pages for the crate, indexes, etc.
use doc::{ItemUtils, PageUtils};
use syntax::ast;
export mk_pass;
fn mk_pass(output_style: config::OutputStyle) -> Pass {
pub fn mk_pass(output_style: config::OutputStyle) -> Pass {
{
name: ~"page",
f: fn~(srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {

View File

@ -8,24 +8,22 @@ use syntax::ast;
use syntax::codemap;
use syntax::parse;
export from_file, from_str, from_file_sess, from_str_sess;
fn from_file(file: &Path) -> @ast::crate {
pub fn from_file(file: &Path) -> @ast::crate {
parse::parse_crate_from_file(
file, ~[], parse::new_parse_sess(None))
}
fn from_str(source: ~str) -> @ast::crate {
pub fn from_str(source: ~str) -> @ast::crate {
parse::parse_crate_from_source_str(
~"-", @source, ~[], parse::new_parse_sess(None))
}
fn from_file_sess(sess: session::Session, file: &Path) -> @ast::crate {
pub fn from_file_sess(sess: session::Session, file: &Path) -> @ast::crate {
parse::parse_crate_from_file(
file, cfg(sess, file_input(*file)), sess.parse_sess)
}
fn from_str_sess(sess: session::Session, source: ~str) -> @ast::crate {
pub fn from_str_sess(sess: session::Session, source: ~str) -> @ast::crate {
parse::parse_crate_from_source_str(
~"-", @source, cfg(sess, str_input(source)), sess.parse_sess)
}

View File

@ -3,9 +3,7 @@
use doc::ItemUtils;
use syntax::ast;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"path",
f: run

View File

@ -2,9 +2,8 @@
use doc::ItemUtils;
use std::map::HashMap;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"prune_hidden",
f: run

View File

@ -11,7 +11,6 @@
#[no_core];
#[legacy_modes];
#[legacy_exports];
#[allow(vecs_implicitly_copyable)];
#[allow(non_implicitly_copyable_typarams)];
@ -26,56 +25,30 @@ extern mod syntax(vers = "0.5");
use core::*;
use std::par;
#[legacy_exports]
mod pass;
#[legacy_exports]
mod config;
#[legacy_exports]
mod parse;
#[legacy_exports]
mod extract;
#[legacy_exports]
mod attr_parser;
#[legacy_exports]
mod doc;
#[legacy_exports]
mod markdown_index_pass;
#[legacy_exports]
mod markdown_pass;
#[legacy_exports]
mod markdown_writer;
#[legacy_exports]
mod fold;
#[legacy_exports]
mod path_pass;
#[legacy_exports]
mod attr_pass;
#[legacy_exports]
mod tystr_pass;
#[legacy_exports]
mod prune_hidden_pass;
#[legacy_exports]
mod desc_to_brief_pass;
#[legacy_exports]
mod text_pass;
#[legacy_exports]
mod unindent_pass;
#[legacy_exports]
mod trim_pass;
#[legacy_exports]
mod astsrv;
#[legacy_exports]
mod demo;
#[legacy_exports]
mod sort_pass;
#[legacy_exports]
mod sort_item_name_pass;
#[legacy_exports]
mod sort_item_type_pass;
#[legacy_exports]
mod page_pass;
#[legacy_exports]
mod sectionalize_pass;
#[legacy_exports]
mod escape_pass;
mod prune_private_pass;

View File

@ -2,9 +2,7 @@
use doc::ItemUtils;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"sectionalize",
f: run

View File

@ -1,9 +1,8 @@
//! Sorts items by name
use doc::ItemUtils;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
pure fn by_item_name(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
(*item1).name() <= (*item2).name()
}

View File

@ -2,9 +2,7 @@
use doc::ItemUtils;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
pure fn by_score(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
pure fn score(item: &doc::ItemTag) -> int {
match *item {

View File

@ -3,11 +3,9 @@
use doc::ItemUtils;
use std::sort;
export item_lteq, mk_pass;
pub type ItemLtEq = pure fn~(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool;
type ItemLtEq = pure fn~(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool;
fn mk_pass(name: ~str, +lteq: ItemLtEq) -> Pass {
pub fn mk_pass(name: ~str, +lteq: ItemLtEq) -> Pass {
{
name: name,
f: fn~(move lteq, srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {

View File

@ -2,9 +2,7 @@
use doc::ItemUtils;
export mk_pass;
fn mk_pass(name: ~str, +op: fn~(~str) -> ~str) -> Pass {
pub fn mk_pass(name: ~str, +op: fn~(~str) -> ~str) -> Pass {
{
name: name,
f: fn~(move op, srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {

View File

@ -7,9 +7,7 @@ is interpreted as the brief description.
use doc::ItemUtils;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
text_pass::mk_pass(~"trim", |s| str::trim(s) )
}

View File

@ -7,9 +7,7 @@ use syntax::ast_map;
use std::map::HashMap;
use extract::to_str;
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
{
name: ~"tystr",
f: run

View File

@ -9,9 +9,7 @@ instances where the string containing the doc comment is opened in the
middle of a line, and each of the following lines is indented.
*/
export mk_pass;
fn mk_pass() -> Pass {
pub fn mk_pass() -> Pass {
text_pass::mk_pass(~"unindent", unindent)
}