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

Add _ to the list of keywords #42723

Merged
merged 1 commit into from
Jun 18, 2017
Merged

Add _ to the list of keywords #42723

merged 1 commit into from
Jun 18, 2017

Conversation

strega-nil
Copy link
Contributor

also, make sure the keyword table is correctly spaced

note: the reference also needs to be updated. This is not the only way to do this in the grammar, but it's my preferred way.

also, make sure the keyword table is correctly spaced
@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

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

@Mark-Simulacrum
Copy link
Member

r? @steveklabnik

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 17, 2017
@QuietMisdreavus
Copy link
Member

I'm okay adding this, but i've noticed the reference and the grammar disagree with respect to how they define idents. The reference has additional rules stating that identifiers may be prefixed with an underscore, despite underscores not having XID_start. If you want to update the reference to take out its "_ alone is not an identifier" remark, I would suggest adding the rules about idents prefixed with an underscore to grammar.md. Since this is a pre-existing issue, I won't gate the PR on it, but if you want to do that follow-up you mentioned in your initial comment, that's what I would suggest. The reference is in a separate repo, so two PRs will be necessary.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 17, 2017

📌 Commit 723772f has been approved by QuietMisdreavus

@petrochenkov
Copy link
Contributor

@ubsan
Could you talk about the motivation a bit?
I'd say _ is perceived more like punctuation intuitively and it's also is not treated as a keyword internally (the difference is mostly philosophical though).

@strega-nil
Copy link
Contributor Author

@petrochenkov correct, it is mostly philosophical. I just thought this was logical, and simpler than treating _ specially

ident_or_kw := <start> <continue>*
start := <XID_start> | '_'
continue := <XID_continue>

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jun 18, 2017
Add `_` to the list of keywords

also, make sure the keyword table is correctly spaced

note: the reference also needs to be updated. This is not the only way to do this in the grammar, but it's my preferred way.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 18, 2017
Add `_` to the list of keywords

also, make sure the keyword table is correctly spaced

note: the reference also needs to be updated. This is not the only way to do this in the grammar, but it's my preferred way.
bors added a commit that referenced this pull request Jun 18, 2017
Rollup of 7 pull requests

- Successful merges: #42695, #42714, #42720, #42723, #42730, #42731, #42734
- Failed merges: #42722
@bors bors merged commit 723772f into rust-lang:master Jun 18, 2017
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.

9 participants