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

Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs #47603

Merged
merged 4 commits into from
Jan 30, 2018

Conversation

mark-i-m
Copy link
Member

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...

@rust-highfive
Copy link
Collaborator

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.

@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 20, 2018
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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

ZeroOrMore,
/// Kleene star (`+`) for one or more repetitions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kleene plus

let sequence = parse(delimited.tts.into(), expect_matchers, sess);
// Get the Kleen operator and optional separator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kleene

Copy link
Member Author

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 😛

@mark-i-m
Copy link
Member Author

@theotherphil Thanks! Fixed.

@shepmaster
Copy link
Member

Ping from triage for you, @arielb1 !

@arielb1
Copy link
Contributor

arielb1 commented Jan 27, 2018

r? @jseyfried

@rust-highfive rust-highfive assigned jseyfried and unassigned arielb1 Jan 27, 2018
@arielb1
Copy link
Contributor

arielb1 commented Jan 27, 2018

That is not quite my area of the code

@mark-i-m
Copy link
Member Author

@arielb1 I'm guessing the same would be to of #47732 too?

Copy link
Contributor

@jseyfried jseyfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! r=me

pub fn close_token(&self) -> token::Token {
token::CloseDelim(self.delim)
}

/// Return a `self::TokenTree` witha a `Span` corresponding to the opening delimiter.
Copy link
Contributor

@jseyfried jseyfried Jan 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: witha

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: witha

///
/// # Parameters
///
/// - `tree`: the tree wish to convert.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we wish to convert

/// 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp: invocation

@jseyfried
Copy link
Contributor

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 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 :)

@mark-i-m
Copy link
Member Author

@jseyfried Thanks! Fixed.

@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 30, 2018

📌 Commit 5762942 has been approved by jseyfried

kennytm added a commit to kennytm/rust that referenced this pull request Jan 30, 2018
…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
kennytm added a commit to kennytm/rust that referenced this pull request Jan 30, 2018
…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...
bors added a commit that referenced this pull request Jan 30, 2018
Rollup of 12 pull requests

- Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855
- Failed merges:
@bors bors merged commit 5762942 into rust-lang:master Jan 30, 2018
@mark-i-m mark-i-m deleted the markim_comments_0000 branch November 14, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants