Skip to content

Commit 1a7914a

Browse files
authored
Merge pull request #4790 from JackStouffer/uni-private
Make private, remove, or document undocumented public symbols in std.uni
2 parents d387277 + 727985e commit 1a7914a

File tree

1 file changed

+16
-52
lines changed

1 file changed

+16
-52
lines changed

std/uni.d

Lines changed: 16 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,23 +1898,27 @@ public alias CodepointSet = InversionList!GcPolicy;
18981898
*/
18991899
public struct CodepointInterval
19001900
{
1901-
pure:
1902-
uint[2] _tuple;
1903-
alias _tuple this;
1901+
uint[2] tuple;
1902+
alias tuple this;
19041903

19051904
@safe pure nothrow @nogc:
1906-
1905+
/// Constructor
19071906
this(uint low, uint high)
19081907
{
1909-
_tuple[0] = low;
1910-
_tuple[1] = high;
1908+
tuple[0] = low;
1909+
tuple[1] = high;
19111910
}
1911+
1912+
/// Support for equality testing
19121913
bool opEquals(T)(T val) const
19131914
{
19141915
return this[0] == val[0] && this[1] == val[1];
19151916
}
1916-
@property ref inout(uint) a() inout { return _tuple[0]; }
1917-
@property ref inout(uint) b() inout { return _tuple[1]; }
1917+
1918+
/// Access to the interval members
1919+
@property ref inout(uint) a() inout { return tuple[0]; }
1920+
/// ditto
1921+
@property ref inout(uint) b() inout { return tuple[1]; }
19181922
}
19191923

19201924
/**
@@ -7958,7 +7962,7 @@ version(std_uni_bootstrap)
79587962
{
79597963
// old version used for bootstrapping of gen_uni.d that generates
79607964
// up to date optimal versions of all of isXXX functions
7961-
@safe pure nothrow @nogc public bool isWhite(dchar c)
7965+
package @safe pure nothrow @nogc bool isWhite(dchar c)
79627966
{
79637967
import std.ascii : isWhite;
79647968
return isWhite(c) ||
@@ -8299,15 +8303,15 @@ auto asUpperCase(Range)(Range str)
82998303
assert("hEllo".asUpperCase.equal("HELLO"));
83008304
}
83018305

8302-
// explicitly undocumented
8306+
/// ditto
83038307
auto asLowerCase(Range)(auto ref Range str)
83048308
if (isConvertibleToString!Range)
83058309
{
83068310
import std.traits : StringTypeOf;
83078311
return asLowerCase!(StringTypeOf!Range)(str);
83088312
}
83098313

8310-
// explicitly undocumented
8314+
/// ditto
83118315
auto asUpperCase(Range)(auto ref Range str)
83128316
if (isConvertibleToString!Range)
83138317
{
@@ -8496,6 +8500,7 @@ auto asCapitalized(Range)(Range str)
84968500
assert("hEllo".asCapitalized.equal("Hello"));
84978501
}
84988502

8503+
/// ditto
84998504
auto asCapitalized(Range)(auto ref Range str)
85008505
if (isConvertibleToString!Range)
85018506
{
@@ -8818,16 +8823,6 @@ void toLowerInPlace(C)(ref C[] s) @trusted pure
88188823
{
88198824
toCaseInPlace!(LowerTriple)(s);
88208825
}
8821-
// overloads for the most common cases to reduce compile time
8822-
@safe pure /*TODO nothrow*/
8823-
{
8824-
void toLowerInPlace(ref char[] s)
8825-
{ toLowerInPlace!char(s); }
8826-
void toLowerInPlace(ref wchar[] s)
8827-
{ toLowerInPlace!wchar(s); }
8828-
void toLowerInPlace(ref dchar[] s)
8829-
{ toLowerInPlace!dchar(s); }
8830-
}
88318826

88328827
/++
88338828
Converts $(D s) to uppercase (by performing Unicode uppercase mapping) in place.
@@ -8840,16 +8835,6 @@ void toUpperInPlace(C)(ref C[] s) @trusted pure
88408835
{
88418836
toCaseInPlace!(UpperTriple)(s);
88428837
}
8843-
// overloads for the most common cases to reduce compile time/code size
8844-
@safe pure /*TODO nothrow*/
8845-
{
8846-
void toUpperInPlace(ref char[] s)
8847-
{ toUpperInPlace!char(s); }
8848-
void toUpperInPlace(ref wchar[] s)
8849-
{ toUpperInPlace!wchar(s); }
8850-
void toUpperInPlace(ref dchar[] s)
8851-
{ toUpperInPlace!dchar(s); }
8852-
}
88538838

88548839
/++
88558840
If $(D c) is a Unicode uppercase $(CHARACTER), then its lowercase equivalent
@@ -8889,17 +8874,6 @@ S toLower(S)(S s) @trusted pure
88898874
static import std.ascii;
88908875
return toCase!(LowerTriple, std.ascii.toLower)(s);
88918876
}
8892-
// overloads for the most common cases to reduce compile time
8893-
@safe pure /*TODO nothrow*/
8894-
{
8895-
string toLower(string s)
8896-
{ return toLower!string(s); }
8897-
wstring toLower(wstring s)
8898-
{ return toLower!wstring(s); }
8899-
dstring toLower(dstring s)
8900-
{ return toLower!dstring(s); }
8901-
}
8902-
89038877

89048878
@system unittest //@@@BUG std.format is not @safe
89058879
{
@@ -9055,16 +9029,6 @@ S toUpper(S)(S s) @trusted pure
90559029
static import std.ascii;
90569030
return toCase!(UpperTriple, std.ascii.toUpper)(s);
90579031
}
9058-
// overloads for the most common cases to reduce compile time
9059-
@safe pure /*TODO nothrow*/
9060-
{
9061-
string toUpper(string s)
9062-
{ return toUpper!string(s); }
9063-
wstring toUpper(wstring s)
9064-
{ return toUpper!wstring(s); }
9065-
dstring toUpper(dstring s)
9066-
{ return toUpper!dstring(s); }
9067-
}
90689032

90699033
@safe unittest
90709034
{

0 commit comments

Comments
 (0)