|
| 1 | +//@ run-pass |
1 | 2 | // ignore-tidy-tab |
2 | 3 | // |
3 | 4 | // Tests that the Rust lexer accepts Unicode Pattern_White_Space characters. |
|
15 | 16 |
|
16 | 17 | #[rustfmt::skip] |
17 | 18 | fn main() { |
18 | | - // tab (\x09) between `let` and the name |
| 19 | + // tab (\x09) between let and the name |
19 | 20 | let _ws1 = 1_i32; |
20 | 21 |
|
21 | | - // vertical tab (\x0B) between `let` and the name |
| 22 | + // vertical tab (\x0B) between let and the name |
22 | 23 | // this is the one is_ascii_whitespace gets wrong |
23 | | - let_ws2 = 2_i32; |
| 24 | + let_ws2 = 2_i32; |
24 | 25 |
|
25 | | - // form feed (\x0C) between `let` and the name |
26 | | - let_ws3 = 3_i32; |
| 26 | + // form feed (\x0C) between let and the name |
| 27 | + let_ws3 = 3_i32; |
27 | 28 |
|
28 | 29 | // plain space (\x20), here just so every character is represented |
29 | 30 | let _ws4 = 4_i32; |
30 | 31 |
|
31 | | - // NEL (\u{85}) between `let` and the name |
32 | | - let_ws5 = 5_i32; |
| 32 | + // NEL (\u{85}) between let and the name |
| 33 | + let
_ws5 = 5_i32; |
33 | 34 |
|
34 | | - // left-to-right mark (\u{200E}) between `let` and the name |
| 35 | + // left-to-right mark (\u{200E}) between let and the name |
35 | 36 | let_ws6 = 6_i32; |
36 | 37 |
|
37 | | - // right-to-left mark (\u{200F}) between `let` and the name |
| 38 | + // right-to-left mark (\u{200F}) between let and the name |
38 | 39 | let_ws7 = 7_i32; |
39 | 40 |
|
40 | 41 | // \x0A, \x0D, \u{2028}, \u{2029} are also Pattern_White_Space but they |
41 | 42 | // act as line endings, so you can't stick them in the middle of a statement. |
42 | 43 | // The lexer still handles them correctly at line boundaries. |
43 | 44 |
|
44 | | - // These are Unicode White_Space but NOT Pattern_White_Space, so the Rust |
45 | | - // lexer won't accept them between tokens: |
| 45 | + // These are Unicode White_Space but NOT Pattern_White_Space: |
46 | 46 | // \u{A0} no-break space \u{1680} ogham space mark |
47 | 47 | // \u{2000} en quad \u{2001} em quad |
48 | 48 | // \u{2002} en space \u{2003} em space |
|
0 commit comments