Skip to content

Commit 00c5777

Browse files
committed
Note the UAX 31 provenance of HORIZONTAL_WHITESPACE
For the `WHITESPACE` grammar rule, we cite `Pattern_White_Space`. For `HORIZONTAL_WHITESPACE`, we hadn't cited provenance. Let's do that. Horizontal whitespace, in a Unicode context, is defined by UAX 31, Section 4.1, which categorizes `Pattern_White_Space` into line endings, ignorable format controls, and horizontal space. The horizontal space category is exactly the two characters our grammar specifies.
1 parent 544b5c6 commit 00c5777

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/whitespace.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ CR -> U+000D // Carriage return, `'\r'`
3030
r[lex.whitespace.intro]
3131
Whitespace is any non-empty string containing only characters that have the [`Pattern_White_Space`] Unicode property.
3232

33+
r[lex.whitespace.horizontal]
34+
[HORIZONTAL_WHITESPACE] is the horizontal space subset of [`Pattern_White_Space`] as categorized by [UAX #31, Section 4.1][uax31-4.1].
35+
3336
r[lex.whitespace.token-sep]
3437
Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance.
3538

3639
r[lex.whitespace.replacement]
3740
A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character.
3841

3942
[`Pattern_White_Space`]: https://www.unicode.org/reports/tr31/
43+
[uax31-4.1]: https://www.unicode.org/reports/tr31/#Whitespace_and_Syntax

0 commit comments

Comments
 (0)