mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
Reverted isAsciiWhite to isWhite.
This commit is contained in:
parent
34bce538ce
commit
25b755a843
10 changed files with 28 additions and 28 deletions
|
@ -174,7 +174,7 @@ unittest
|
|||
Whether or not $(D c) is a whitespace character. That includes the space,
|
||||
tab, vertical tab, form feed, carriage return, and linefeed characters.
|
||||
+/
|
||||
bool isAsciiWhite(dchar c) @safe pure nothrow
|
||||
bool isWhite(dchar c) @safe pure nothrow
|
||||
{
|
||||
return c <= 0x7F ? cast(bool)(_ctype[c] & _SPC) : false;
|
||||
}
|
||||
|
@ -182,10 +182,10 @@ bool isAsciiWhite(dchar c) @safe pure nothrow
|
|||
unittest
|
||||
{
|
||||
foreach(c; whitespace)
|
||||
assert(isAsciiWhite(c));
|
||||
assert(isWhite(c));
|
||||
|
||||
foreach(c; chain(digits, letters))
|
||||
assert(!isAsciiWhite(c));
|
||||
assert(!isWhite(c));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ pure int ispunct(dchar c) { return (c <= 0x7F) ? _ctype[c] & (_PNC) : 0; }
|
|||
|
||||
/**
|
||||
* $(RED Scheduled for deprecation in December 2011. Please use
|
||||
* $(D std.ascii.isAsciiWhite) instead.)
|
||||
* $(D std.ascii.isWhite) instead.)
|
||||
*
|
||||
* Returns !=0 if c is a space, tab, vertical tab, form feed,
|
||||
* carriage return, or linefeed.
|
||||
|
|
|
@ -828,8 +828,8 @@ struct FormatSpec(Char)
|
|||
{
|
||||
if (trailing.ptr[0] == ' ')
|
||||
{
|
||||
while (!r.empty && std.ascii.isAsciiWhite(r.front)) r.popFront();
|
||||
//r = std.algorithm.find!(not!(std.ascii.isAsciiWhite))(r);
|
||||
while (!r.empty && std.ascii.isWhite(r.front)) r.popFront();
|
||||
//r = std.algorithm.find!(not!(std.ascii.isWhite))(r);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -280,7 +280,7 @@ Negates predicate $(D pred).
|
|||
Example:
|
||||
----
|
||||
string a = " Hello, world!";
|
||||
assert(find!(not!isAsciiWhite)(a) == "Hello, world!");
|
||||
assert(find!(not!isWhite)(a) == "Hello, world!");
|
||||
----
|
||||
*/
|
||||
template not(alias pred)
|
||||
|
|
|
@ -83,7 +83,7 @@ JSONValue parseJSON(T)(T json, int maxDepth = -1) if(isInputRange!T) {
|
|||
}
|
||||
|
||||
void skipWhitespace() {
|
||||
while(isAsciiWhite(peekChar())) next = 0;
|
||||
while(isWhite(peekChar())) next = 0;
|
||||
}
|
||||
|
||||
dchar getChar(bool SkipWhitespace = false)() {
|
||||
|
|
|
@ -1034,13 +1034,13 @@ Returns the number of parenthesized captures
|
|||
|
||||
case 's':
|
||||
for (i = 0; i <= cmax; i++)
|
||||
if (isAsciiWhite(i))
|
||||
if (isWhite(i))
|
||||
r.bits[i] = 1;
|
||||
goto Lrs;
|
||||
|
||||
case 'S':
|
||||
for (i = 1; i <= cmax; i++)
|
||||
if (!isAsciiWhite(i))
|
||||
if (!isWhite(i))
|
||||
r.bits[i] = 1;
|
||||
goto Lrs;
|
||||
|
||||
|
@ -2504,7 +2504,7 @@ Returns $(D hit) (converted to $(D string) if necessary).
|
|||
debug(std_regex) writefln("\tREspace");
|
||||
if (src == input.length)
|
||||
goto Lnomatch;
|
||||
if (!isAsciiWhite(input[src]))
|
||||
if (!isWhite(input[src]))
|
||||
goto Lnomatch;
|
||||
src++;
|
||||
pc++;
|
||||
|
@ -2514,7 +2514,7 @@ Returns $(D hit) (converted to $(D string) if necessary).
|
|||
debug(std_regex) writefln("\tREnotspace");
|
||||
if (src == input.length)
|
||||
goto Lnomatch;
|
||||
if (isAsciiWhite(input[src]))
|
||||
if (isWhite(input[src]))
|
||||
goto Lnomatch;
|
||||
src++;
|
||||
pc++;
|
||||
|
|
12
std/regexp.d
12
std/regexp.d
|
@ -2062,7 +2062,7 @@ public bool test(string s)
|
|||
debug(regexp) printf("\tREspace\n");
|
||||
if (src == input.length)
|
||||
goto Lnomatch;
|
||||
if (!isAsciiWhite(input[src]))
|
||||
if (!isWhite(input[src]))
|
||||
goto Lnomatch;
|
||||
src++;
|
||||
pc++;
|
||||
|
@ -2072,7 +2072,7 @@ public bool test(string s)
|
|||
debug(regexp) printf("\tREnotspace\n");
|
||||
if (src == input.length)
|
||||
goto Lnomatch;
|
||||
if (isAsciiWhite(input[src]))
|
||||
if (isWhite(input[src]))
|
||||
goto Lnomatch;
|
||||
src++;
|
||||
pc++;
|
||||
|
@ -2614,13 +2614,13 @@ private:
|
|||
|
||||
case 's':
|
||||
for (i = 0; i <= cmax; i++)
|
||||
if (isAsciiWhite(i))
|
||||
if (isWhite(i))
|
||||
r.bits[i] = 1;
|
||||
goto Lrs;
|
||||
|
||||
case 'S':
|
||||
for (i = 1; i <= cmax; i++)
|
||||
if (!isAsciiWhite(i))
|
||||
if (!isWhite(i))
|
||||
r.bits[i] = 1;
|
||||
goto Lrs;
|
||||
|
||||
|
@ -3072,14 +3072,14 @@ private:
|
|||
case REspace:
|
||||
r.setbitmax(0x7F);
|
||||
for (c = 0; c <= r.maxc; c++)
|
||||
if (isAsciiWhite(c))
|
||||
if (isWhite(c))
|
||||
r.bits[c] = 1;
|
||||
return 1;
|
||||
|
||||
case REnotspace:
|
||||
r.setbitmax(0x7F);
|
||||
for (c = 0; c <= r.maxc; c++)
|
||||
if (!isAsciiWhite(c))
|
||||
if (!isWhite(c))
|
||||
r.bits[c] = 1;
|
||||
return 1;
|
||||
|
||||
|
|
14
std/stream.d
14
std/stream.d
|
@ -753,7 +753,7 @@ class Stream : InputStream, OutputStream {
|
|||
case 'i':
|
||||
case 'I':
|
||||
{
|
||||
while (isAsciiWhite(c)) {
|
||||
while (isWhite(c)) {
|
||||
c = getc();
|
||||
count++;
|
||||
}
|
||||
|
@ -858,7 +858,7 @@ class Stream : InputStream, OutputStream {
|
|||
case 'g':
|
||||
case 'G':
|
||||
{
|
||||
while (isAsciiWhite(c)) {
|
||||
while (isWhite(c)) {
|
||||
c = getc();
|
||||
count++;
|
||||
}
|
||||
|
@ -941,7 +941,7 @@ class Stream : InputStream, OutputStream {
|
|||
} break;
|
||||
|
||||
case 's': { // string
|
||||
while (isAsciiWhite(c)) {
|
||||
while (isWhite(c)) {
|
||||
c = getc();
|
||||
count++;
|
||||
}
|
||||
|
@ -952,7 +952,7 @@ class Stream : InputStream, OutputStream {
|
|||
p = va_arg!(char[]*)(args);
|
||||
s = *p;
|
||||
}
|
||||
while (!isAsciiWhite(c) && c != char.init) {
|
||||
while (!isWhite(c) && c != char.init) {
|
||||
if (strlen < s.length) {
|
||||
s[strlen] = c;
|
||||
} else {
|
||||
|
@ -985,7 +985,7 @@ class Stream : InputStream, OutputStream {
|
|||
if (width < 0)
|
||||
width = 1;
|
||||
else
|
||||
while (isAsciiWhite(c)) {
|
||||
while (isWhite(c)) {
|
||||
c = getc();
|
||||
count++;
|
||||
}
|
||||
|
@ -1008,8 +1008,8 @@ class Stream : InputStream, OutputStream {
|
|||
default: // read character as is
|
||||
goto nws;
|
||||
}
|
||||
} else if (isAsciiWhite(fmt[i])) { // skip whitespace
|
||||
while (isAsciiWhite(c))
|
||||
} else if (isWhite(fmt[i])) { // skip whitespace
|
||||
while (isWhite(c))
|
||||
c = getc();
|
||||
i++;
|
||||
} else { // read character as is
|
||||
|
|
|
@ -185,7 +185,7 @@ alias std.ascii.newline newline;
|
|||
|
||||
/**********************************
|
||||
* $(RED Scheduled for deprecation in December 2011.
|
||||
* Please use $(XREF ascii, isAsciiWhite) or $(XREF uni, isUniWhite) instead.)
|
||||
* Please use $(XREF ascii, isWhite) or $(XREF uni, isUniWhite) instead.)
|
||||
*
|
||||
* Returns true if c is ASCII whitespace or unicode LS or PS.
|
||||
*/
|
||||
|
@ -194,7 +194,7 @@ else bool iswhite(C)(C c)
|
|||
if(is(Unqual!C : dchar))
|
||||
{
|
||||
pragma(msg, softDeprec!("2.054", "December 2011", "iswhite",
|
||||
"std.ascii.isAsciiWhite or std.uni.isUniWhite"));
|
||||
"std.ascii.isWhite or std.uni.isUniWhite"));
|
||||
|
||||
return c <= 0x7F
|
||||
? indexOf(whitespace, c) != -1
|
||||
|
|
|
@ -29,7 +29,7 @@ enum dchar paraSep = '\u2029'; /// UTF paragraph separator
|
|||
+/
|
||||
bool isUniWhite(dchar c) @safe pure nothrow
|
||||
{
|
||||
return std.ascii.isAsciiWhite(c) ||
|
||||
return std.ascii.isWhite(c) ||
|
||||
c == lineSep || c == paraSep ||
|
||||
c == '\u0085' || c == '\u00A0' || c == '\u1680' || c == '\u180E' ||
|
||||
(c >= '\u2000' && c <= '\u200A') ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue