-
-
Notifications
You must be signed in to change notification settings - Fork 753
Make private, remove, or document undocumented public symbols in std.uni #4790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1898,23 +1898,27 @@ public alias CodepointSet = InversionList!GcPolicy; | |
| */ | ||
| public struct CodepointInterval | ||
| { | ||
| pure: | ||
| uint[2] _tuple; | ||
| alias _tuple this; | ||
| uint[2] tuple; | ||
| alias tuple this; | ||
|
|
||
| @safe pure nothrow @nogc: | ||
|
|
||
| /// Constructor | ||
| this(uint low, uint high) | ||
| { | ||
| _tuple[0] = low; | ||
| _tuple[1] = high; | ||
| tuple[0] = low; | ||
| tuple[1] = high; | ||
| } | ||
|
|
||
| /// Support for equality testing | ||
| bool opEquals(T)(T val) const | ||
| { | ||
| return this[0] == val[0] && this[1] == val[1]; | ||
| } | ||
| @property ref inout(uint) a() inout { return _tuple[0]; } | ||
| @property ref inout(uint) b() inout { return _tuple[1]; } | ||
|
|
||
| /// Access to the interval members | ||
| @property ref inout(uint) a() inout { return tuple[0]; } | ||
| /// ditto | ||
| @property ref inout(uint) b() inout { return tuple[1]; } | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -7983,7 +7987,7 @@ version(std_uni_bootstrap) | |
| { | ||
| // old version used for bootstrapping of gen_uni.d that generates | ||
| // up to date optimal versions of all of isXXX functions | ||
| @safe pure nothrow @nogc public bool isWhite(dchar c) | ||
| package @safe pure nothrow @nogc bool isWhite(dchar c) | ||
| { | ||
| import std.ascii : isWhite; | ||
| return isWhite(c) || | ||
|
|
@@ -8324,15 +8328,15 @@ auto asUpperCase(Range)(Range str) | |
| assert("hEllo".asUpperCase.equal("HELLO")); | ||
| } | ||
|
|
||
| // explicitly undocumented | ||
| /// ditto | ||
| auto asLowerCase(Range)(auto ref Range str) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MartinNowak git says that you made these overloads. Why didn't you document them? I don't see why this should be hidden from the user.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not exactly pretty have all of those overloads in the docs. If it weren't for the fact that the secondary overloads use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO the ddoc looks much better then the ddox version on functions with multiple overloads |
||
| if (isConvertibleToString!Range) | ||
| { | ||
| import std.traits : StringTypeOf; | ||
| return asLowerCase!(StringTypeOf!Range)(str); | ||
| } | ||
|
|
||
| // explicitly undocumented | ||
| /// ditto | ||
| auto asUpperCase(Range)(auto ref Range str) | ||
| if (isConvertibleToString!Range) | ||
| { | ||
|
|
@@ -8521,6 +8525,7 @@ auto asCapitalized(Range)(Range str) | |
| assert("hEllo".asCapitalized.equal("Hello")); | ||
| } | ||
|
|
||
| /// ditto | ||
| auto asCapitalized(Range)(auto ref Range str) | ||
| if (isConvertibleToString!Range) | ||
| { | ||
|
|
@@ -8843,16 +8848,6 @@ void toLowerInPlace(C)(ref C[] s) @trusted pure | |
| { | ||
| toCaseInPlace!(LowerTriple)(s); | ||
| } | ||
| // overloads for the most common cases to reduce compile time | ||
| @safe pure /*TODO nothrow*/ | ||
| { | ||
| void toLowerInPlace(ref char[] s) | ||
| { toLowerInPlace!char(s); } | ||
| void toLowerInPlace(ref wchar[] s) | ||
| { toLowerInPlace!wchar(s); } | ||
| void toLowerInPlace(ref dchar[] s) | ||
| { toLowerInPlace!dchar(s); } | ||
| } | ||
|
|
||
| /++ | ||
| Converts $(D s) to uppercase (by performing Unicode uppercase mapping) in place. | ||
|
|
@@ -8865,16 +8860,6 @@ void toUpperInPlace(C)(ref C[] s) @trusted pure | |
| { | ||
| toCaseInPlace!(UpperTriple)(s); | ||
| } | ||
| // overloads for the most common cases to reduce compile time/code size | ||
| @safe pure /*TODO nothrow*/ | ||
| { | ||
| void toUpperInPlace(ref char[] s) | ||
| { toUpperInPlace!char(s); } | ||
| void toUpperInPlace(ref wchar[] s) | ||
| { toUpperInPlace!wchar(s); } | ||
| void toUpperInPlace(ref dchar[] s) | ||
| { toUpperInPlace!dchar(s); } | ||
| } | ||
|
|
||
| /++ | ||
| If $(D c) is a Unicode uppercase $(CHARACTER), then its lowercase equivalent | ||
|
|
@@ -8914,17 +8899,6 @@ S toLower(S)(S s) @trusted pure | |
| static import std.ascii; | ||
| return toCase!(LowerTriple, std.ascii.toLower)(s); | ||
| } | ||
| // overloads for the most common cases to reduce compile time | ||
| @safe pure /*TODO nothrow*/ | ||
| { | ||
| string toLower(string s) | ||
| { return toLower!string(s); } | ||
| wstring toLower(wstring s) | ||
| { return toLower!wstring(s); } | ||
| dstring toLower(dstring s) | ||
| { return toLower!dstring(s); } | ||
| } | ||
|
|
||
|
|
||
| @system unittest //@@@BUG std.format is not @safe | ||
| { | ||
|
|
@@ -9080,16 +9054,6 @@ S toUpper(S)(S s) @trusted pure | |
| static import std.ascii; | ||
| return toCase!(UpperTriple, std.ascii.toUpper)(s); | ||
| } | ||
| // overloads for the most common cases to reduce compile time | ||
| @safe pure /*TODO nothrow*/ | ||
| { | ||
| string toUpper(string s) | ||
| { return toUpper!string(s); } | ||
| wstring toUpper(wstring s) | ||
| { return toUpper!wstring(s); } | ||
| dstring toUpper(dstring s) | ||
| { return toUpper!dstring(s); } | ||
| } | ||
|
|
||
| @safe unittest | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
opEqualseven nessesary?_tupleis the only member of this struct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code is old enough, it might have needed an explicit
opEqualsto deal withconst, but I don't think that that's the case anymore. You should probably verify that though. Another possibility is so that it can be compared with either a tuple or an array.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that looks like what it's for