Nice! I'd really like Hoogle-like tool for Rust.

(Also, using libsyntax to get an AST directly is pretty easy. It was
about 3 function calls to get a parsed & macro-expanded AST from a
string last time I used it. The tests in libsyntax and/or the first
parts of the rustc driver are decent examples.)

Huon


On 21/06/13 14:46, Daniel Patterson wrote:
On Thu, Jun 20, 2013 at 7:30 PM, Brian Anderson <[email protected]> wrote:
And finally, a subtle point regarding the architecture: the core data
structure in rustdoc is a 'document', which is iterated over and refined
through a number of passes. I think this is probably the wrong way to
conceptualize this data structure, and instead it should be considered a
limited AST + documentation metadata, reflecting the code structure, not the
document structure. Only convert it to do document immediately before
rendering.
This should also make it much easier to re-use the extraction in other
tools - a limited AST + documentation is a really useful structure to
work with. I'm thinking specifically of my experiment of producing a
Hoogle[1]-like tool that lives at [2]. I experimented with trying to
hook into rustdoc at an intermediary stage, but it ended up being
easier to write a bad parser on the generated html, because the
intermediary data structures weren't all that different - ie, I would
have had to parse them too - which is silly.

1. http://www.haskell.org/hoogle/
2. https://github.com/dbp/rustle
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to