]> git.lizzy.rs Git - rust.git/commit
auto merge of #6680 : ben0x539/rust/slashslashslash, r=graydon
authorbors <bors@rust-lang.org>
Fri, 24 May 2013 12:34:45 +0000 (05:34 -0700)
committerbors <bors@rust-lang.org>
Fri, 24 May 2013 12:34:45 +0000 (05:34 -0700)
commitb5ab1012f1f5786f550e511ba1302a22c85fcd71
treec61e703ad8e2f14fa1119f73ad4d662bcf6c8668
parent2f69bb9ba9d622ccab77840c08f4562a10b44c29
parent5a424813667a27a0def860d96a5e79801718592b
auto merge of #6680 : ben0x539/rust/slashslashslash, r=graydon

There's currently a function in the lexer that rejects a line comment that is all slashes from being a doc comment. I think the intention was that you could draw boxes,

    /////////////
    // like so //
    /////////////

Since a line doc comment split up over multiple paragraphs will have a "blank" line that is just /// between the paragraphs, that would get mistaken for a box segment, lexed as a regular comment, and go missing from the sequence of doc comment attributes before they were reassembled by rustdoc into markdown input.

I figure the best plan here is to just declare that a comment that is exactly `///` is a doc comment after all, and to only omit comments with four slashes or more, which is what this commit implements. Can't really draw boxes that narrow, anyway.
src/libsyntax/parse/lexer.rs