Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pretty printing of doc comments in macros. #27496

Closed
wants to merge 1 commit into from
Closed

Fix pretty printing of doc comments in macros. #27496

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 3, 2015

Fixes #27489.

@rust-highfive
Copy link
Contributor

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@barosl
Copy link
Contributor

barosl commented Aug 3, 2015

Oops, you already did this!

I also implemented this myself, but in a slightly different way. Instead of always adding one more #, my algorithm searches for the pattern "#* and calculates the minimum number of #s required. So a simple case like /// Hello world is directly converted to r"Hello world", not r#"Hello world"#, and something like /// ## is also translated to r"##", rather than r###"##"###. I think the generated raw strings are a bit clearer in this way.

You can see the code here: barosl@f6504aa

Would you mind closing this? I'll open mine. Sorry for not telling this earlier. 😢

@ghost
Copy link
Author

ghost commented Aug 3, 2015

Sure thing :)

P.S. Line 1121 in your solution will fail make tidy because it's over 100 chars.

@ghost ghost closed this Aug 3, 2015
@ghost ghost deleted the comment-escaping branch August 3, 2015 18:07
@barosl
Copy link
Contributor

barosl commented Aug 3, 2015

Thanks for your understanding! Also, nice catch. I will fix that.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants