-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs #47603
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/libsyntax/ext/tt/quoted.rs
Outdated
use tokenstream; | ||
|
||
use std::rc::Rc; | ||
|
||
/// Contains the sub-token-trees of a "delimited" token tree, such as the contents of `(`. Note | ||
/// thatthat the delimiter itself might be `NoDelim`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
src/libsyntax/ext/tt/quoted.rs
Outdated
ZeroOrMore, | ||
/// Kleene star (`+`) for one or more repetitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kleene plus
src/libsyntax/ext/tt/quoted.rs
Outdated
let sequence = parse(delimited.tts.into(), expect_matchers, sess); | ||
// Get the Kleen operator and optional separator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kleene
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha... it originally autocorrected to Kleenex, and my fix was incorrect 😛
@theotherphil Thanks! Fixed. |
Ping from triage for you, @arielb1 ! |
r? @jseyfried |
That is not quite my area of the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! r=me
src/libsyntax/ext/tt/quoted.rs
Outdated
pub fn close_token(&self) -> token::Token { | ||
token::CloseDelim(self.delim) | ||
} | ||
|
||
/// Return a `self::TokenTree` witha a `Span` corresponding to the opening delimiter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: witha
src/libsyntax/ext/tt/quoted.rs
Outdated
@@ -42,6 +47,7 @@ impl Delimited { | |||
TokenTree::Token(open_span, self.open_token()) | |||
} | |||
|
|||
/// Return a `self::TokenTree` witha a `Span` corresponding to the closing delimiter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: witha
src/libsyntax/ext/tt/quoted.rs
Outdated
/// | ||
/// # Parameters | ||
/// | ||
/// - `tree`: the tree wish to convert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we wish to convert
src/libsyntax/ext/tt/quoted.rs
Outdated
/// separator, and `*` is the Kleene operator. This function is specifically concerned with parsing | ||
/// the last two tokens of such a pattern: namely, the optional separator and the Kleene operator | ||
/// itself. Note that here we are parsing the _macro_ itself, rather than trying to match some | ||
/// stream of tokens in an invokation of a macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp: invocation
I wouldn't worry too much about conflicts; there isn't too much churn in this area of the compiler now. That being said, nothing wrong with smaller PRs :) |
@jseyfried Thanks! Fixed. |
@bors r+ |
📌 Commit 5762942 has been approved by |
…eyfried Run rustfmt and add doc comments to libsyntax/ext/tt/macro_parser.rs Similar to rust-lang#47603 cc @theotherphil since you reviewed my other PR 😄 And because they are already assigned on rust-lang#47603: r? @arielb1
…eyfried Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains _no changes_ to the code itself -- just formatting and comments. I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...
I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains no changes to the code itself -- just formatting and comments.
I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...