diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-01-31 15:28:09 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-01-31 19:32:27 -0800 |
| commit | acb11f47dc7b7fb03caeee5ade2c7002cb20cb6f (patch) | |
| tree | b0f28e25e78ce7463404cd9bf7dd3a381692a82b /src/rustdoc/doc.rs | |
| parent | 56db37d4c7fea8085f80783d1f3dc3204fcfc0b6 (diff) | |
rustdoc: Add impl doc node
Diffstat (limited to 'src/rustdoc/doc.rs')
| -rw-r--r-- | src/rustdoc/doc.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/rustdoc/doc.rs b/src/rustdoc/doc.rs index 13c618c685b..3a960d294c1 100644 --- a/src/rustdoc/doc.rs +++ b/src/rustdoc/doc.rs @@ -12,7 +12,8 @@ enum itemtag { fntag(fndoc), enumtag(enumdoc), restag(resdoc), - ifacetag(ifacedoc) + ifacetag(ifacedoc), + impltag(impldoc) } type moddoc = { @@ -96,6 +97,16 @@ type methoddoc = { sig: option<str> }; +type impldoc = { + id: ast_id, + name: str, + brief: option<str>, + desc: option<str>, + iface_ty: option<str>, + for_ty: option<str>, + methods: [methoddoc] +}; + #[doc = "Some helper methods on moddoc, mostly for testing"] impl util for moddoc { @@ -152,6 +163,15 @@ impl util for moddoc { } } } + + fn impls() -> [impldoc] { + vec::filter_map(*self.items) {|itemtag| + alt itemtag { + impltag(impldoc) { some(impldoc) } + _ { none } + } + } + } } #[doc = "Helper methods on itemtag"] @@ -164,6 +184,7 @@ impl util for itemtag { doc::enumtag({name, _}) { name } doc::restag({name, _}) { name } doc::ifacetag({name, _}) { name } + _ { fail } } } } |
