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

Updated section on identifiers for raw identifiers #395

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

alexreg
Copy link
Contributor

@alexreg alexreg commented Aug 9, 2018

No description provided.

Copy link
Contributor

@Havvy Havvy left a comment

Choose a reason for hiding this comment

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

A couple nits, but otherwise good.


An identifier is any nonempty ASCII string of the following form:
A normal (non-raw) identifier is any nonempty ASCII string of the following form:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this line needs to change. I feel like it draws attention away from basic identifiers in a way that could be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought about this... you definitely have a point. I just wasn't sure if it would be misleading to "go back" on the initial definition of an identifier slightly. But fair enough.

@@ -21,5 +23,7 @@ Or
* The identifier is more than one character. `_` alone is not an identifier.
* The remaining characters are alphanumeric or `_`.

A raw identifier is like a normal identifier, but prefixed by `r#`, which is not included as part of the identifier. Unlike a normal identifier, a raw identifier may be any strict or reserved keyword.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Comma splice. Trade the last , for a . and replace which with The `r#`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I think you misread perhaps? It wouldn't make sense like that grammatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

A raw identifier is like a normal identifier, but prefixed by `r#`. The `r#` is not included as part of the identifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that improves clarity, but if you really want, I'll do it. 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, looking at it closer, another option is to change ", but" to "except". So A raw identifier is like a normal identifier except prefixed by `r#`, which is not included as part of the identifier. The main thing is to get rid of one of the commas as it's currently grammatically murky with both of them.

@Havvy Havvy added the RFC Stabilization Docs Documentation required for stabilizing a feature label Aug 9, 2018
@@ -21,5 +23,7 @@ Or
* The identifier is more than one character. `_` alone is not an identifier.
* The remaining characters are alphanumeric or `_`.

A raw identifier is like a normal identifier, but prefixed by `r#`, which is not included as part of the identifier. Unlike a normal identifier, a raw identifier may be any strict or reserved keyword.
Copy link
Contributor

Choose a reason for hiding this comment

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

"...any strict or reserved keyword" except crate, extern, self, Self or super.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I thought there might be exceptions, thanks.

kennytm added a commit to kennytm/rust that referenced this pull request Aug 11, 2018
…mertj

Stabilise raw_identifiers feature

* [Reference PR](rust-lang/reference#395)
* [Book PR](rust-lang/book#1480)
* [Rust by Example PR](rust-lang/rust-by-example#1095)

Closes rust-lang#48589.

r? @cramertj
CC @cuviper @Centril
@alexreg
Copy link
Contributor Author

alexreg commented Aug 11, 2018 via email

kennytm added a commit to kennytm/rust that referenced this pull request Aug 13, 2018
…mertj

Stabilise raw_identifiers feature

* [Reference PR](rust-lang/reference#395)
* [Book PR](rust-lang/book#1480)
* [Rust by Example PR](rust-lang/rust-by-example#1095)

Closes rust-lang#48589.

r? @cramertj
CC @cuviper @Centril
bors added a commit to rust-lang/rust that referenced this pull request Aug 21, 2018
Stabilise raw_identifiers feature

* [Reference PR](rust-lang/reference#395)
* [Book PR](rust-lang/book#1480)
* [Rust by Example PR](rust-lang/rust-by-example#1095)

Closes #48589.

r? @cramertj
CC @cuviper @Centril
@alexreg
Copy link
Contributor Author

alexreg commented Aug 21, 2018

Can we get this merged now that the actual Rust feature has been stabilised? :-)

@Havvy Havvy merged commit b492524 into rust-lang:master Aug 21, 2018
@Havvy
Copy link
Contributor

Havvy commented Aug 21, 2018

Yes. 💟 Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Stabilization Docs Documentation required for stabilizing a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants