Skip to content

Commit 0f4d5c2

Browse files
committed
checkpoint block-comment-wchar state.
1 parent 1deebee commit 0f4d5c2

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// This is meant as a test case for Issue 3961.
12+
//
13+
// Test via: rustc --pretty normal src/test/pretty/block-comment-wchar.rs
14+
//
15+
// pp-exact:block-comment-wchar.pp
16+
fn f() {
17+
fn nested() {
18+
/*
19+
Spaced2
20+
*/
21+
/*
22+
Spaced10
23+
*/
24+
/*
25+
Tabbed8+2
26+
*/
27+
/*
28+
CR8+2
29+
*/
30+
}
31+
/*
32+
Spaced2: (prefixed so start of space aligns with comment)
33+
*/
34+
/*
35+
Tabbed2: (more indented b/c *start* of space will align with comment)
36+
*/
37+
/*
38+
Spaced6: (Alignment removed and realigning spaces inserted)
39+
*/
40+
/*
41+
Tabbed4+2: (Alignment removed and realigning spaces inserted)
42+
*/
43+
44+
/*
45+
VT4+2: (should align)
46+
*/
47+
/*
48+
FF4+2: (should align)
49+
*/
50+
/*
51+
CR4+2: (should align)
52+
*/
53+
/*
54+
// (NEL deliberately omitted)
55+
*/
56+
/*
57+
Ogham Space Mark 4+2: (should align)
58+
*/
59+
/*
60+
Mongolian Vowel Separator 4+2: (should align)
61+
*/
62+
/*
63+
Four-per-em space 4+2: (should align)
64+
*/
65+
66+
/*
67+
Mongolian Vowel Sep count 1: (should align)
68+
Mongolian Vowel Sep count 2: (should align)
69+
Mongolian Vowel Sep count 3: (should align)
70+
Mongolian Vowel Sep count 4: (should align)
71+
Mongolian Vowel Sep count 5: (should align)
72+
Mongolian Vowel Sep count 6: (should align)
73+
Mongolian Vowel Sep count 7: (should align)
74+
Mongolian Vowel Sep count 8: (should align)
75+
Mongolian Vowel Sep count 9: (should align)
76+
Mongolian Vowel Sep count A: (should align)
77+
Mongolian Vowel Sep count B: (should align)
78+
Mongolian Vowel Sep count C: (should align)
79+
Mongolian Vowel Sep count D: (should align)
80+
Mongolian Vowel Sep count E: (should align)
81+
Mongolian Vowel Sep count F: (should align)
82+
*/
83+
84+
/* */ /*
85+
Hello from offset 6
86+
Space 6+2: compare A
87+
Mongolian Vowel Separator 6+2: compare B
88+
*/
89+
/*᠎*/ /*
90+
Hello from another offset 6 with wchars establishing column offset
91+
Space 6+2: compare C
92+
Mongolian Vowel Separator 6+2: compare D
93+
*/
94+
}
95+
96+
fn main() {
97+
// Taken from http://en.wikipedia.org/wiki/Whitespace_character
98+
let chars = [ '\x0A', '\x0B', '\x0C', '\x0D', '\x20',
99+
// '\x85', // for some reason Rust thinks NEL isn't whitespace
100+
'\xA0', '\u1680', '\u180E',
101+
'\u2000', '\u2001', '\u2002', '\u2003',
102+
'\u2004', '\u2005', '\u2006', '\u2007',
103+
'\u2008', '\u2009', '\u200A',
104+
'\u2028', '\u2029', '\u202F', '\u205F',
105+
'\u3000'
106+
];
107+
for vec::each(chars) |c| {
108+
io::println(fmt!("%? %?", c, c.is_whitespace()));
109+
}
110+
}

src/test/pretty/block-comment-wchar.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -11,7 +11,8 @@
1111
// This is meant as a test case for Issue 3961.
1212
//
1313
// Test via: rustc --pretty normal src/test/pretty/block-comment-wchar.rs
14-
14+
//
15+
// pp-exact:block-comment-wchar.pp
1516
fn f() {
1617
fn nested() {
1718
/*

0 commit comments

Comments
 (0)