From 7bd3b2eabc7d7831c2abc6b15b9817b6f35712b8 Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Fri, 16 Sep 2016 09:48:05 +0100 Subject: [PATCH 1/3] document or make private public symbols --- std/uni.d | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/std/uni.d b/std/uni.d index 89140e0d878..77919231da3 100644 --- a/std/uni.d +++ b/std/uni.d @@ -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) || From f5b8e679aa65659ff71c3582bb6dffd1eced429e Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Fri, 16 Sep 2016 09:48:36 +0100 Subject: [PATCH 2/3] Document alias-this work arounds --- std/uni.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/std/uni.d b/std/uni.d index 77919231da3..86399036f27 100644 --- a/std/uni.d +++ b/std/uni.d @@ -8328,7 +8328,7 @@ auto asUpperCase(Range)(Range str) assert("hEllo".asUpperCase.equal("HELLO")); } -// explicitly undocumented +/// ditto auto asLowerCase(Range)(auto ref Range str) if (isConvertibleToString!Range) { @@ -8336,7 +8336,7 @@ auto asLowerCase(Range)(auto ref Range str) return asLowerCase!(StringTypeOf!Range)(str); } -// explicitly undocumented +/// ditto auto asUpperCase(Range)(auto ref Range str) if (isConvertibleToString!Range) { @@ -8525,6 +8525,7 @@ auto asCapitalized(Range)(Range str) assert("hEllo".asCapitalized.equal("Hello")); } +/// ditto auto asCapitalized(Range)(auto ref Range str) if (isConvertibleToString!Range) { From 727985e504ef1fb737e660f573c15a05c3d68dfe Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Fri, 16 Sep 2016 09:49:21 +0100 Subject: [PATCH 3/3] Remove undocumented template hacks --- std/uni.d | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/std/uni.d b/std/uni.d index 86399036f27..caabe3cb382 100644 --- a/std/uni.d +++ b/std/uni.d @@ -8848,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. @@ -8870,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 @@ -8919,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 { @@ -9085,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 {