@@ -39,14 +39,6 @@ use cmp::Eq;
3939 Cn Unassigned a reserved unassigned code point or a noncharacter
4040*/
4141
42- export is_alphabetic,
43- is_XID_start, is_XID_continue,
44- is_lowercase, is_uppercase,
45- is_whitespace, is_alphanumeric,
46- is_ascii, is_digit,
47- to_digit, cmp,
48- escape_default, escape_unicode;
49-
5042pub use is_alphabetic = unicode:: derived_property:: Alphabetic ;
5143pub use is_XID_start = unicode:: derived_property:: XID_Start ;
5244pub use is_XID_continue = unicode:: derived_property:: XID_Continue ;
@@ -56,15 +48,15 @@ pub use is_XID_continue = unicode::derived_property::XID_Continue;
5648 * Indicates whether a character is in lower case, defined
5749 * in terms of the Unicode General Category 'Ll'
5850 */
59- pure fn is_lowercase ( c : char ) -> bool {
51+ pub pure fn is_lowercase ( c : char ) -> bool {
6052 return unicode:: general_category:: Ll ( c) ;
6153}
6254
6355/**
6456 * Indicates whether a character is in upper case, defined
6557 * in terms of the Unicode General Category 'Lu'.
6658 */
67- pure fn is_uppercase ( c : char ) -> bool {
59+ pub pure fn is_uppercase ( c : char ) -> bool {
6860 return unicode:: general_category:: Lu ( c) ;
6961}
7062
@@ -73,7 +65,7 @@ pure fn is_uppercase(c: char) -> bool {
7365 * terms of the Unicode General Categories 'Zs', 'Zl', 'Zp'
7466 * additional 'Cc'-category control codes in the range [0x09, 0x0d]
7567 */
76- pure fn is_whitespace ( c : char ) -> bool {
68+ pub pure fn is_whitespace ( c : char ) -> bool {
7769 return ( '\x09' <= c && c <= '\x0d' )
7870 || unicode:: general_category:: Zs ( c)
7971 || unicode:: general_category:: Zl ( c)
@@ -85,20 +77,20 @@ pure fn is_whitespace(c: char) -> bool {
8577 * defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No'
8678 * and the Derived Core Property 'Alphabetic'.
8779 */
88- pure fn is_alphanumeric ( c : char ) -> bool {
80+ pub pure fn is_alphanumeric ( c : char ) -> bool {
8981 return unicode:: derived_property:: Alphabetic ( c) ||
9082 unicode:: general_category:: Nd ( c) ||
9183 unicode:: general_category:: Nl ( c) ||
9284 unicode:: general_category:: No ( c) ;
9385}
9486
9587/// Indicates whether the character is an ASCII character
96- pure fn is_ascii ( c : char ) -> bool {
88+ pub pure fn is_ascii ( c : char ) -> bool {
9789 c - ( '\x7F' & c) == '\x00'
9890}
9991
10092/// Indicates whether the character is numeric (Nd, Nl, or No)
101- pure fn is_digit ( c : char ) -> bool {
93+ pub pure fn is_digit ( c : char ) -> bool {
10294 return unicode:: general_category:: Nd ( c) ||
10395 unicode:: general_category:: Nl ( c) ||
10496 unicode:: general_category:: No ( c) ;
@@ -114,7 +106,7 @@ pure fn is_digit(c: char) -> bool {
114106 * 'b' or 'B', 11, etc. Returns none if the char does not
115107 * refer to a digit in the given radix.
116108 */
117- pure fn to_digit ( c : char , radix : uint ) -> Option < uint > {
109+ pub pure fn to_digit ( c : char , radix : uint ) -> Option < uint > {
118110 let val = match c {
119111 '0' .. '9' => c as uint - ( '0' as uint ) ,
120112 'a' .. 'z' => c as uint + 10 u - ( 'a' as uint ) ,
@@ -134,7 +126,7 @@ pure fn to_digit(c: char, radix: uint) -> Option<uint> {
134126 * - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`
135127 * - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`
136128 */
137- fn escape_unicode ( c : char ) -> ~str {
129+ pub fn escape_unicode ( c : char ) -> ~str {
138130 let s = u32:: to_str ( c as u32 , 16 u) ;
139131 let ( c, pad) = ( if c <= '\xff' { ( 'x' , 2 u) }
140132 else if c <= '\uffff' { ( 'u' , 4 u) }
@@ -159,7 +151,7 @@ fn escape_unicode(c: char) -> ~str {
159151 * - Any other chars in the range [0x20,0x7e] are not escaped.
160152 * - Any other chars are given hex unicode escapes; see `escape_unicode`.
161153 */
162- fn escape_default ( c : char ) -> ~str {
154+ pub fn escape_default ( c : char ) -> ~str {
163155 match c {
164156 '\t' => ~"\\ t",
165157 '\r' => ~"\\ r",
@@ -179,7 +171,7 @@ fn escape_default(c: char) -> ~str {
179171 *
180172 * -1 if a < b, 0 if a == b, +1 if a > b
181173 */
182- pure fn cmp ( a : char , b : char ) -> int {
174+ pub pure fn cmp ( a : char , b : char ) -> int {
183175 return if b > a { -1 }
184176 else if b < a { 1 }
185177 else { 0 }
0 commit comments