Create Whitespace grammar productions by epage · Pull Request #1991 · rust-lang/reference (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@epage

This does not create any new productions, instead preferring comments.
#1974 will involve pulling out the horizontal
whitespace into a separate production.

Comment wording (and casing) is modeled off of
https://www.unicode.org/reports/tr31/#R3a.
I left off a "unicode" prefix for ASCII items as they are likely common
enough in that context that specifying them as "unicode" could cause
more confusion.

@rustbot

This comment has been minimized.

traviscross

| LINE_SEPARATOR
| PARAGRAPH_SEPARATOR
LINE_FEED -> U+000A

Choose a reason for hiding this comment

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

Rather than having duplicate productions like this (that we wouldn't want people to use elsewhere in the Reference), it'd perhaps work out better to simply comment the LF production with something like // Unicode character "LINE FEED (LF)"., so I've added support for comments in the grammar:

Choose a reason for hiding this comment

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

Thanks!

that we wouldn't want people to use elsewhere in the Reference

In that case, maybe I should remove all productions that are not used elsewhere.

I also went with comment wording (and casing) to align with the unicode spec as much as possible.

ehuss

Choose a reason for hiding this comment

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

Thanks!

@epage @traviscross

This does not create any new productions, instead preferring comments. rust-lang#1974 will involve pulling out the horizontal whitespace into a separate production.

Comment wording (and casing) is modeled off of https://www.unicode.org/reports/tr31/#R3a. I left off a "unicode" prefix for ASCII items as they are likely common enough in that context that specifying them as "unicode" could cause more confusion.

@ehuss @traviscross

traviscross

@traviscross

@epage

Why was this reformatted? The change was to match a change I made to rustc to communicate intent, match the unicode standard we reference, and prep for pulling out horizontal whitespace.

@traviscross

Could you perhaps say more about what specifically is missing in the revision with respect to matching what's in rustc, communicating intent, referencing the standard, prepping for pulling out horizontal whitespace, etc.?

@epage

The list was grouped in the unicode standard groups, ordered like it, and with comments that matched.

@epage

Also, all of my 3 reference PRs, all of which have been merged in the last month, have had direct edits made instead of engaging with me. This is the second time the edits were questionable and would have been helped to have been discussed first, even if we still go with the edits in the end. For the other, see #1989 (comment)

@epage epage mentioned this pull request

Oct 1, 2025

Zalathar added a commit to Zalathar/rust that referenced this pull request

Oct 2, 2025

@Zalathar

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 2, 2025

@matthiaskrgr

jhpratt added a commit to jhpratt/rust that referenced this pull request

Oct 2, 2025

@jhpratt

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 2, 2025

@matthiaskrgr

rust-timer added a commit to rust-lang/rust that referenced this pull request

Oct 2, 2025

@rust-timer

Rollup merge of #147236 - rustbot:docs-update, r=ehuss

Update books

rust-lang/book

1 commits in 33f1af40cc44dde7e3e892f7a508e6f427d2cbc6..1d7c3e6abec2d5a9bfac798b29b7855b95025426 2025-09-28 21:24:16 UTC to 2025-09-28 21:24:16 UTC

rust-lang/edition-guide

1 commits in aa6ce337c0adf7a63e33960d184270f2a45ab9ef..e2ed891f00361efc26616d82590b1c85d7a8920e 2025-10-01 17:11:54 UTC to 2025-10-01 17:11:54 UTC

rust-lang/nomicon

1 commits in f17a018b9989430967d1c58e9a12c51169abc744..23fc2682f8fcb887f77d0eaabba708809f834c11 2025-09-24 10:10:31 UTC to 2025-09-24 10:10:31 UTC

rust-lang/reference

13 commits in cc7247d8dfaef4c39000bb12c55c32ba5b5ba976..e11adf6016a362766eea5a3f9832e193994dd0c8 2025-09-29 00:55:42 UTC to 2025-09-23 23:33:32 UTC

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Oct 3, 2025

@matthiaskrgr

rust-cloud-vms bot pushed a commit to makai410/rustc_public that referenced this pull request

Oct 12, 2025

@matthiaskrgr

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Oct 18, 2025

@matthiaskrgr

@epage epage deleted the whitespace branch

October 22, 2025 13:57

makai410 pushed a commit to makai410/rust that referenced this pull request

Nov 8, 2025

@matthiaskrgr

makai410 pushed a commit to makai410/rust that referenced this pull request

Nov 10, 2025

@matthiaskrgr

makai410 pushed a commit to makai410/rustc_public that referenced this pull request

Nov 16, 2025

@matthiaskrgr