On 06/02/2012 06:30 AM, Gareth Smith wrote:
Dear Rust developers/users,

I want to convince you that the current syntax for doc-comments in rust
is sub-optimal and should be re-worked.
>
Does this proposal have any hope?

Agreed on all points. The current syntax was just an expedient to get rustdoc working, and the intent has been to revisit exactly how we feed that information into rustdoc.

Attaching docs via attributes is very easy because attributes are actually associated with specific AST nodes, whereas comments are just whitespace.

Implementing doc comments with the current parser will require a (relatively simple) heuristic to associate comments with AST nodes, which could then be plugged into a new rustdoc pass.

I also came up with an attirbute syntax that is one character shy of python's docstrings while being relatively easy to fit into the existing attribute syntax:

   #"""

   Docs go here

   """
   fn foo() { ...

But probably doc comments are the right way to go.

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

Reply via email to