Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs#47603
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs#47603bors merged 4 commits intorust-lang:masterfrom
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 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`. |
src/libsyntax/ext/tt/quoted.rs
Outdated
| pub enum KleeneOp { | ||
| /// Kleene star (`*`) for zero or more repetitions | ||
| ZeroOrMore, | ||
| /// Kleene star (`+`) for one or more repetitions |
src/libsyntax/ext/tt/quoted.rs
Outdated
| } | ||
| // Parse the contents of the sequence itself | ||
| let sequence = parse(delimited.tts.into(), expect_matchers, sess); | ||
| // Get the Kleen operator and optional separator |
There was a problem hiding this comment.
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 |
src/libsyntax/ext/tt/quoted.rs
Outdated
| token::CloseDelim(self.delim) | ||
| } | ||
|
|
||
| /// Return a `self::TokenTree` witha a `Span` corresponding to the opening delimiter. |
src/libsyntax/ext/tt/quoted.rs
Outdated
| TokenTree::Token(open_span, self.open_token()) | ||
| } | ||
|
|
||
| /// Return a `self::TokenTree` witha a `Span` corresponding to the closing delimiter. |
src/libsyntax/ext/tt/quoted.rs
Outdated
| /// | ||
| /// # Parameters | ||
| /// | ||
| /// - `tree`: the tree 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. |
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...