rustdoc: Create an item tag to hold doc for all item types
This commit is contained in:
parent
2740a6b605
commit
bfd8a14065
3 changed files with 12 additions and 0 deletions
|
@ -6,12 +6,21 @@ type cratedoc = ~{
|
||||||
topmod: moddoc,
|
topmod: moddoc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum itemtag {
|
||||||
|
modtag(moddoc),
|
||||||
|
consttag(constdoc),
|
||||||
|
fntag(fndoc),
|
||||||
|
enumtag(enumdoc),
|
||||||
|
restag(resdoc)
|
||||||
|
}
|
||||||
|
|
||||||
type moddoc = ~{
|
type moddoc = ~{
|
||||||
id: ast_id,
|
id: ast_id,
|
||||||
name: str,
|
name: str,
|
||||||
path: [str],
|
path: [str],
|
||||||
brief: option<str>,
|
brief: option<str>,
|
||||||
desc: option<str>,
|
desc: option<str>,
|
||||||
|
items: [itemtag],
|
||||||
mods: modlist,
|
mods: modlist,
|
||||||
fns: fnlist,
|
fns: fnlist,
|
||||||
consts: constlist,
|
consts: constlist,
|
||||||
|
|
|
@ -43,6 +43,7 @@ fn moddoc_from_mod(
|
||||||
path: [],
|
path: [],
|
||||||
brief: none,
|
brief: none,
|
||||||
desc: none,
|
desc: none,
|
||||||
|
items: [],
|
||||||
mods: doc::modlist(
|
mods: doc::modlist(
|
||||||
vec::filter_map(module.items) {|item|
|
vec::filter_map(module.items) {|item|
|
||||||
alt item.node {
|
alt item.node {
|
||||||
|
|
|
@ -49,6 +49,7 @@ fn test_run_passes() {
|
||||||
path: [],
|
path: [],
|
||||||
brief: none,
|
brief: none,
|
||||||
desc: none,
|
desc: none,
|
||||||
|
items: [],
|
||||||
mods: doc::modlist([]),
|
mods: doc::modlist([]),
|
||||||
fns: doc::fnlist([]),
|
fns: doc::fnlist([]),
|
||||||
consts: doc::constlist([]),
|
consts: doc::constlist([]),
|
||||||
|
@ -68,6 +69,7 @@ fn test_run_passes() {
|
||||||
path: [],
|
path: [],
|
||||||
brief: none,
|
brief: none,
|
||||||
desc: none,
|
desc: none,
|
||||||
|
items: [],
|
||||||
mods: doc::modlist([]),
|
mods: doc::modlist([]),
|
||||||
fns: doc::fnlist([]),
|
fns: doc::fnlist([]),
|
||||||
consts: doc::constlist([]),
|
consts: doc::constlist([]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue