Remove use of automatic adjacent string literal concatenation from phobos

This commit is contained in:
Daniel Murphy 2014-01-20 03:42:21 +11:00
parent cf5a46d716
commit a656f26e9e
26 changed files with 94 additions and 94 deletions

View file

@ -4799,8 +4799,8 @@ unittest
{ {
debug(std_algorithm) scope(success) debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done."); writeln("unittest @", __FILE__, ":", __LINE__, " done.");
string h = "/homes/aalexand/d/dmd/bin/../lib/libphobos.a(dmain2.o)" string h = "/homes/aalexand/d/dmd/bin/../lib/libphobos.a(dmain2.o)"~
"(.gnu.linkonce.tmain+0x74): In function `main' undefined reference" "(.gnu.linkonce.tmain+0x74): In function `main' undefined reference"~
" to `_Dmain':"; " to `_Dmain':";
string[] ns = ["libphobos", "function", " undefined", "`", ":"]; string[] ns = ["libphobos", "function", " undefined", "`", ":"];
foreach (n ; ns) { foreach (n ; ns) {
@ -7008,7 +7008,7 @@ minCount(alias pred = "a < b", Range)(Range range)
alias RetType = Tuple!(T, size_t); alias RetType = Tuple!(T, size_t);
static assert (is(typeof(RetType(range.front, 1))), static assert (is(typeof(RetType(range.front, 1))),
format("Error: Cannot call minCount on a %s, because it is not possible " format("Error: Cannot call minCount on a %s, because it is not possible "~
"to copy the result value (a %s) into a Tuple.", Range.stringof, T.stringof)); "to copy the result value (a %s) into a Tuple.", Range.stringof, T.stringof));
enforce(!range.empty, "Can't count elements from an empty range"); enforce(!range.empty, "Can't count elements from an empty range");
@ -7071,7 +7071,7 @@ minCount(alias pred = "a < b", Range)(Range range)
} }
else else
static assert(false, static assert(false,
format("Sorry, can't find the minCount of a %s: Don't know how " format("Sorry, can't find the minCount of a %s: Don't know how "~
"to keep track of the smallest %s element.", Range.stringof, T.stringof)); "to keep track of the smallest %s element.", Range.stringof, T.stringof));
} }
@ -10389,7 +10389,7 @@ bool isSorted(alias less = "a < b", Range)(Range r) if (isForwardRange!(Range))
if (!binaryFun!less(r[i + 1], r[i])) continue; if (!binaryFun!less(r[i + 1], r[i])) continue;
assert( assert(
!binaryFun!less(r[i], r[i + 1]), !binaryFun!less(r[i], r[i + 1]),
text("Predicate for isSorted is not antisymmetric. Both" text("Predicate for isSorted is not antisymmetric. Both",
" pred(a, b) and pred(b, a) are true for a=", r[i], " pred(a, b) and pred(b, a) are true for a=", r[i],
" and b=", r[i+1], " in positions ", i, " and ", " and b=", r[i+1], " in positions ", i, " and ",
i + 1)); i + 1));
@ -10408,7 +10408,7 @@ bool isSorted(alias less = "a < b", Range)(Range r) if (isForwardRange!(Range))
// Check for antisymmetric predicate // Check for antisymmetric predicate
assert( assert(
!binaryFun!less(r.front, ahead.front), !binaryFun!less(r.front, ahead.front),
text("Predicate for isSorted is not antisymmetric. Both" text("Predicate for isSorted is not antisymmetric. Both",
" pred(a, b) and pred(b, a) are true for a=", r.front, " pred(a, b) and pred(b, a) are true for a=", r.front,
" and b=", ahead.front, " in positions ", i, " and ", " and b=", ahead.front, " in positions ", i, " and ",
i + 1)); i + 1));

View file

@ -103,7 +103,7 @@ private template createAccessors(
{ {
// getter // getter
enum result = "@property @safe "~T.stringof~" "~name~"() pure nothrow const { auto result = " enum result = "@property @safe "~T.stringof~" "~name~"() pure nothrow const { auto result = "
"("~store~" & " ~"("~store~" & "
~ myToString(maskAllElse) ~ ") >>" ~ myToString(maskAllElse) ~ ") >>"
~ myToString(offset) ~ ";" ~ myToString(offset) ~ ";"
~ (T.min < 0 ~ (T.min < 0
@ -116,9 +116,9 @@ private template createAccessors(
~"assert(v >= "~name~"_min); " ~"assert(v >= "~name~"_min); "
~"assert(v <= "~name~"_max); " ~"assert(v <= "~name~"_max); "
~store~" = cast(typeof("~store~"))" ~store~" = cast(typeof("~store~"))"
" (("~store~" & ~cast(typeof("~store~"))"~myToString(maskAllElse)~")" ~" (("~store~" & ~cast(typeof("~store~"))"~myToString(maskAllElse)~")"
" | ((cast(typeof("~store~")) v << "~myToString(offset)~")" ~" | ((cast(typeof("~store~")) v << "~myToString(offset)~")"
" & "~myToString(maskAllElse)~"));}\n" ~" & "~myToString(maskAllElse)~"));}\n"
// constants // constants
~"enum "~T.stringof~" "~name~"_min = cast("~T.stringof~")" ~"enum "~T.stringof~" "~name~"_min = cast("~T.stringof~")"
~myToString(minVal)~"; " ~myToString(minVal)~"; "

View file

@ -626,7 +626,7 @@ private void _send(T...)( MsgType type, Tid tid, T vals )
void receive(T...)( T ops ) void receive(T...)( T ops )
in in
{ {
assert(mbox !is null, "Cannot receive a message until a thread was spawned " assert(mbox !is null, "Cannot receive a message until a thread was spawned "~
"or thisTid was passed to a running thread."); "or thisTid was passed to a running thread.");
} }
body body
@ -708,7 +708,7 @@ private template receiveOnlyRet(T...)
receiveOnlyRet!(T) receiveOnly(T...)() receiveOnlyRet!(T) receiveOnly(T...)()
in in
{ {
assert(mbox !is null, "Cannot receive a message until a thread was spawned " assert(mbox !is null, "Cannot receive a message until a thread was spawned "~
"or thisTid was passed to a running thread."); "or thisTid was passed to a running thread.");
} }
body body
@ -775,7 +775,7 @@ unittest
bool receiveTimeout(T...)( Duration duration, T ops ) bool receiveTimeout(T...)( Duration duration, T ops )
in in
{ {
assert(mbox !is null, "Cannot receive a message until a thread was spawned " assert(mbox !is null, "Cannot receive a message until a thread was spawned "~
"or thisTid was passed to a running thread."); "or thisTid was passed to a running thread.");
} }
body body

View file

@ -2403,7 +2403,7 @@ Target parse(Target, Source)(ref Source p)
{ case '-': sexp++; { case '-': sexp++;
goto case; goto case;
case '+': p.popFront(); enforce(!p.empty, case '+': p.popFront(); enforce(!p.empty,
new ConvException("Error converting input" new ConvException("Error converting input"~
" to floating point")); " to floating point"));
break; break;
default: {} default: {}
@ -2421,7 +2421,7 @@ Target parse(Target, Source)(ref Source p)
ndigits = 1; ndigits = 1;
} }
exp += (sexp) ? -e : e; exp += (sexp) ? -e : e;
enforce(ndigits, new ConvException("Error converting input" enforce(ndigits, new ConvException("Error converting input"~
" to floating point")); " to floating point"));
if (msdec) if (msdec)

View file

@ -396,7 +396,7 @@ auto csvReader(Contents = string,
// Test standard iteration over input. // Test standard iteration over input.
unittest unittest
{ {
string str = `one,"two ""quoted"""` ~ "\n\"three\nnew line\",""\nfive,six"; string str = `one,"two ""quoted"""` ~ "\n\"three\nnew line\",\nfive,six";
auto records = csvReader(str); auto records = csvReader(str);
int count; int count;
@ -700,7 +700,7 @@ unittest
return text[0]; return text[0];
} }
} }
auto ir = InputRange("Name,Occupation,Salary\r"d auto ir = InputRange("Name,Occupation,Salary\r"d~
"Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n"d); "Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n"d);
foreach(record; csvReader(ir, cast(string[])null)) foreach(record; csvReader(ir, cast(string[])null))
@ -1178,7 +1178,7 @@ public:
if(_input.rowLength != 0) if(_input.rowLength != 0)
if(_input.col != _input.rowLength) if(_input.col != _input.rowLength)
throw new CSVException( throw new CSVException(
format("Row %s's length %s does not match " format("Row %s's length %s does not match "~
"previous length of %s.", _input.row, "previous length of %s.", _input.row,
_input.col, _input.rowLength)); _input.col, _input.rowLength));
return; return;
@ -1187,7 +1187,7 @@ public:
if(_input.rowLength != 0) if(_input.rowLength != 0)
if(_input.col > _input.rowLength) if(_input.col > _input.rowLength)
throw new CSVException( throw new CSVException(
format("Row %s's length %s does not match " format("Row %s's length %s does not match "~
"previous length of %s.", _input.row, "previous length of %s.", _input.row,
_input.col, _input.rowLength)); _input.col, _input.rowLength));
} }

View file

@ -296,7 +296,7 @@ unittest
digest = crc32Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); digest = crc32Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[])x"d2e6c21f"); assert(digest == cast(ubyte[])x"d2e6c21f");
digest = crc32Of("1234567890123456789012345678901234567890" digest = crc32Of("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890"); "1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[])x"724aa97c"); assert(digest == cast(ubyte[])x"724aa97c");

View file

@ -883,7 +883,7 @@ class WrapperDigest(T) if(isDigest!T) : Digest
} }
body body
{ {
enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " ~
"big, check " ~ typeof(this).stringof ~ ".length!"; "big, check " ~ typeof(this).stringof ~ ".length!";
asArray!(digestLength!T)(buf, msg) = _digest.finish(); asArray!(digestLength!T)(buf, msg) = _digest.finish();
return buf[0 .. digestLength!T]; return buf[0 .. digestLength!T];
@ -919,7 +919,7 @@ class WrapperDigest(T) if(isDigest!T) : Digest
} }
body body
{ {
enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " ~
"big, check " ~ typeof(this).stringof ~ ".length!"; "big, check " ~ typeof(this).stringof ~ ".length!";
asArray!(digestLength!T)(buf, msg) = _digest.peek(); asArray!(digestLength!T)(buf, msg) = _digest.peek();
return buf[0 .. digestLength!T]; return buf[0 .. digestLength!T];

View file

@ -467,7 +467,7 @@ unittest
digest = md5Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); digest = md5Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[])x"d174ab98d277d9f5a5611c2c9f419d9f"); assert(digest == cast(ubyte[])x"d174ab98d277d9f5a5611c2c9f419d9f");
digest = md5Of("1234567890123456789012345678901234567890" digest = md5Of("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890"); "1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[])x"57edf4a22be3c955ac49da2e2107b67a"); assert(digest == cast(ubyte[])x"57edf4a22be3c955ac49da2e2107b67a");

View file

@ -629,7 +629,7 @@ unittest
digest = ripemd160Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); digest = ripemd160Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[])x"b0e20b6e3116640286ed3a87a5713079b21f5189"); assert(digest == cast(ubyte[])x"b0e20b6e3116640286ed3a87a5713079b21f5189");
digest = ripemd160Of("1234567890123456789012345678901234567890" digest = ripemd160Of("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890"); "1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[])x"9b752e45573d4b39f4dbd3323cab82bf63326bfb"); assert(digest == cast(ubyte[])x"9b752e45573d4b39f4dbd3323cab82bf63326bfb");

View file

@ -528,7 +528,7 @@ unittest
digest = sha1Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); digest = sha1Of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
assert(digest == cast(ubyte[])x"761c457bf73b14d27e9e9265c46f4b4dda11f940"); assert(digest == cast(ubyte[])x"761c457bf73b14d27e9e9265c46f4b4dda11f940");
digest = sha1Of("1234567890123456789012345678901234567890" digest = sha1Of("1234567890123456789012345678901234567890"~
"1234567890123456789012345678901234567890"); "1234567890123456789012345678901234567890");
assert(digest == cast(ubyte[])x"50abf5706a150990a08b2c5ea40fa0e585554732"); assert(digest == cast(ubyte[])x"50abf5706a150990a08b2c5ea40fa0e585554732");

View file

@ -819,9 +819,9 @@ template EncoderInstance(CharType : Windows1252Char)
} }
immutable wstring charMap = immutable wstring charMap =
"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021" "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021"~
"\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD" "\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD"~
"\uFFFD\u2018\u2019\u201C\u201D\u2022\u2103\u2014" "\uFFFD\u2018\u2019\u201C\u201D\u2022\u2103\u2014"~
"\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178" "\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178"
; ;
@ -2463,7 +2463,7 @@ class EncodingSchemeASCII : EncodingScheme
"ISO_646.irv:1991", "ISO_646.irv:1991",
"US-ASCII", "US-ASCII",
"cp367", "cp367",
"csASCII" "csASCII",
"iso-ir-6", "iso-ir-6",
"us" "us"
]; ];

View file

@ -410,11 +410,11 @@ unittest
"delegate void() " ~ "delegate void() " ~
(EncloseSafe ? "@safe " : "") ~ (EncloseSafe ? "@safe " : "") ~
(EnclosePure ? "pure " : "") ~ (EnclosePure ? "pure " : "") ~
"{ ""enforce(true, { " "{ enforce(true, { " ~
"int n; " ~ "int n; " ~
(BodySafe ? "" : "auto p = &n + 10; " ) ~ // unsafe code (BodySafe ? "" : "auto p = &n + 10; " ) ~ // unsafe code
(BodyPure ? "" : "static int g; g = 10; ") ~ // impure code (BodyPure ? "" : "static int g; g = 10; ") ~ // impure code
"}); " "}); " ~
"}"; "}";
enum expect = enum expect =
(BodySafe || !EncloseSafe) && (!EnclosePure || BodyPure); (BodySafe || !EncloseSafe) && (!EnclosePure || BodyPure);

View file

@ -139,7 +139,7 @@ L_unrolled:
~ indexedLoopUnroll( 8, ~ indexedLoopUnroll( 8,
"mov EAX, [@*4-8*4+EDX+ECX*4];" "mov EAX, [@*4-8*4+EDX+ECX*4];"
~ ( op == '+' ? "adc" : "sbb" ) ~ " EAX, [@*4-8*4+ESI+ECX*4];" ~ ( op == '+' ? "adc" : "sbb" ) ~ " EAX, [@*4-8*4+ESI+ECX*4];"
"mov [@*4-8*4+EDI+ECX*4], EAX;") ~ "mov [@*4-8*4+EDI+ECX*4], EAX;")
~ "}"); ~ "}");
asm { asm {
setc AL; // save carry setc AL; // save carry
@ -156,7 +156,7 @@ L_residual:
~ indexedLoopUnroll( 1, ~ indexedLoopUnroll( 1,
"mov EAX, [@*4+EDX+ECX*4];" "mov EAX, [@*4+EDX+ECX*4];"
~ ( op == '+' ? "adc" : "sbb" ) ~ " EAX, [@*4+ESI+ECX*4];" ~ ( op == '+' ? "adc" : "sbb" ) ~ " EAX, [@*4+ESI+ECX*4];"
"mov [@*4+EDI+ECX*4], EAX;") ~ "}"); ~ "mov [@*4+EDI+ECX*4], EAX;") ~ "}");
asm { asm {
setc AL; // save carry setc AL; // save carry
add ECX, 1; add ECX, 1;

View file

@ -162,14 +162,14 @@ version(LittleEndian)
{ {
static assert(real.mant_dig == 53 || real.mant_dig==64 static assert(real.mant_dig == 53 || real.mant_dig==64
|| real.mant_dig == 113, || real.mant_dig == 113,
"Only 64-bit, 80-bit, and 128-bit reals" "Only 64-bit, 80-bit, and 128-bit reals"~
" are supported for LittleEndian CPUs"); " are supported for LittleEndian CPUs");
} }
else else
{ {
static assert(real.mant_dig == 53 || real.mant_dig==106 static assert(real.mant_dig == 53 || real.mant_dig==106
|| real.mant_dig == 113, || real.mant_dig == 113,
"Only 64-bit and 128-bit reals are supported for BigEndian CPUs." "Only 64-bit and 128-bit reals are supported for BigEndian CPUs."~
" double-double reals have partial support"); " double-double reals have partial support");
} }

View file

@ -3748,7 +3748,7 @@ struct Curl
{ {
_onReceiveHeader = (in char[] od) _onReceiveHeader = (in char[] od)
{ {
throwOnStopped("Receive header callback called on " throwOnStopped("Receive header callback called on "~
"cleaned up Curl instance"); "cleaned up Curl instance");
callback(od); callback(od);
}; };
@ -3866,7 +3866,7 @@ struct Curl
{ {
_onSocketOption = (curl_socket_t sock, CurlSockType st) _onSocketOption = (curl_socket_t sock, CurlSockType st)
{ {
throwOnStopped("Socket option callback called on " throwOnStopped("Socket option callback called on "~
"cleaned up Curl instance"); "cleaned up Curl instance");
return callback(sock, st); return callback(sock, st);
}; };
@ -3908,7 +3908,7 @@ struct Curl
{ {
_onProgress = (size_t dlt, size_t dln, size_t ult, size_t uln) _onProgress = (size_t dlt, size_t dln, size_t ult, size_t uln)
{ {
throwOnStopped("Progress callback called on cleaned " throwOnStopped("Progress callback called on cleaned "~
"up Curl instance"); "up Curl instance");
return callback(dlt, dln, ult, uln); return callback(dlt, dln, ult, uln);
}; };
@ -4186,9 +4186,9 @@ private static size_t _receiveAsyncLines(Terminator, Unit)
// onReceive. Can be up to a max of 4 bytes. // onReceive. Can be up to a max of 4 bytes.
enforceEx!CurlException(data.length <= 4, enforceEx!CurlException(data.length <= 4,
format( format(
"Too many bytes left not decoded %s" "Too many bytes left not decoded %s"~
" > 4. Maybe the charset specified in" " > 4. Maybe the charset specified in"~
" headers does not match " " headers does not match "~
"the actual content downloaded?", "the actual content downloaded?",
data.length)); data.length));
leftOverBytes ~= data; leftOverBytes ~= data;

View file

@ -229,7 +229,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = CheckDns.no
break; break;
default: default:
throw new Exception("More text found where none is allowed, but unrecognised prior " throw new Exception("More text found where none is allowed, but unrecognised prior " ~
"context: " ~ to!(string)(contextPrior)); "context: " ~ to!(string)(contextPrior));
} }
} }
@ -345,7 +345,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = CheckDns.no
break; break;
default: default:
throw new Exception("More text found where none is allowed, but unrecognised prior " throw new Exception("More text found where none is allowed, but unrecognised prior " ~
"context: " ~ to!(string)(contextPrior)); "context: " ~ to!(string)(contextPrior));
} }
@ -851,19 +851,19 @@ unittest
// EmailStatusCode.any).statusCode == EmailStatusCode.dnsWarningNoRecord); // EmailStatusCode.any).statusCode == EmailStatusCode.dnsWarningNoRecord);
// DNS check is currently not implemented // DNS check is currently not implemented
assert(`abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyz` assert((`abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@abcdefghijklmnopqrstuvwxyz`~
`abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.` `abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.`~
`abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij`.isEmail(CheckDns.no, `abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij`).isEmail(CheckDns.no,
EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322TooLong); EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322TooLong);
assert(`a@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyz` assert((`a@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyz`~
`abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.` `abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.`~
`abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg.hij`.isEmail(CheckDns.no, `abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg.hij`).isEmail(CheckDns.no,
EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322TooLong); EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322TooLong);
assert(`a@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyz` assert((`a@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyz`~
`abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.` `abcdefghijklmnopqrstuvwxyzabcdefghikl.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.`~
`abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg.hijk`.isEmail(CheckDns.no, `abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg.hijk`).isEmail(CheckDns.no,
EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322DomainTooLong); EmailStatusCode.any).statusCode == EmailStatusCode.rfc5322DomainTooLong);
assert(`"test"@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert(`"test"@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
@ -1000,7 +1000,7 @@ unittest
EmailStatusCode.foldingWhitespace, `Folding whitespace`); EmailStatusCode.foldingWhitespace, `Folding whitespace`);
assert("\u000D\u000A \u000D\u000A test@iana.org".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert("\u000D\u000A \u000D\u000A test@iana.org".isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
EmailStatusCode.deprecatedFoldingWhitespace, `FWS with one line composed entirely of WSP` EmailStatusCode.deprecatedFoldingWhitespace, `FWS with one line composed entirely of WSP`~
` -- only allowed as obsolete FWS (someone might allow only non-obsolete FWS)`); ` -- only allowed as obsolete FWS (someone might allow only non-obsolete FWS)`);
assert(`(comment)test@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.comment); assert(`(comment)test@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.comment);
@ -1025,21 +1025,21 @@ unittest
assert(`test@(comment)abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.com`.isEmail(CheckDns.no, assert(`test@(comment)abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghikl.com`.isEmail(CheckDns.no,
EmailStatusCode.any).statusCode == EmailStatusCode.deprecatedCommentFoldingWhitespaceNearAt); EmailStatusCode.any).statusCode == EmailStatusCode.deprecatedCommentFoldingWhitespaceNearAt);
assert(`(comment)test@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghik.abcdefghijklmnopqrstuvwxyz` assert((`(comment)test@abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghik.abcdefghijklmnopqrstuvwxyz`~
`abcdefghijklmnopqrstuvwxyzabcdefghik.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.` `abcdefghijklmnopqrstuvwxyzabcdefghik.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.`~
`abcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstu`.isEmail(CheckDns.no, `abcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstu`).isEmail(CheckDns.no,
EmailStatusCode.any).statusCode == EmailStatusCode.comment); EmailStatusCode.any).statusCode == EmailStatusCode.comment);
assert("test@iana.org\u000A".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert("test@iana.org\u000A".isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
EmailStatusCode.errorExpectingText); EmailStatusCode.errorExpectingText);
assert(`test@xn--hxajbheg2az3al.xn--jxalpdlp`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert(`test@xn--hxajbheg2az3al.xn--jxalpdlp`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
EmailStatusCode.valid, `A valid IDN from ICANN's <a href="http://idn.icann.org/#The_example.test_names">` EmailStatusCode.valid, `A valid IDN from ICANN's <a href="http://idn.icann.org/#The_example.test_names">`~
`IDN TLD evaluation gateway</a>`); `IDN TLD evaluation gateway</a>`);
assert(`xn--test@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.valid, assert(`xn--test@iana.org`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.valid,
`RFC 3490: "unless the email standards are revised to invite the use of IDNA for local parts, a domain label` `RFC 3490: "unless the email standards are revised to invite the use of IDNA for local parts, a domain label`~
` that holds the local part of an email address SHOULD NOT begin with the ACE prefix, and even if it does,` ` that holds the local part of an email address SHOULD NOT begin with the ACE prefix, and even if it does,`~
` it is to be interpreted literally as a local part that happens to begin with the ACE prefix"`); ` it is to be interpreted literally as a local part that happens to begin with the ACE prefix"`);
assert(`test@iana.org-`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert(`test@iana.org-`.isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
@ -1179,7 +1179,7 @@ unittest
EmailStatusCode.foldingWhitespace, `FWS`); EmailStatusCode.foldingWhitespace, `FWS`);
assert("test@iana.org\u000D\u000A \u000D\u000A ".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert("test@iana.org\u000D\u000A \u000D\u000A ".isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
EmailStatusCode.deprecatedFoldingWhitespace, `FWS with one line composed entirely of WSP -- ` EmailStatusCode.deprecatedFoldingWhitespace, `FWS with one line composed entirely of WSP -- `~
`only allowed as obsolete FWS (someone might allow only non-obsolete FWS)`); `only allowed as obsolete FWS (someone might allow only non-obsolete FWS)`);
assert("test@iana.org\u000D\u000A".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == assert("test@iana.org\u000D\u000A".isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
@ -1316,13 +1316,13 @@ string statusCodeDescription (EmailStatusCode statusCode)
case EmailStatusCode.dnsWarning: return "Address is valid but a DNS check was not successful"; case EmailStatusCode.dnsWarning: return "Address is valid but a DNS check was not successful";
case EmailStatusCode.rfc5321: return "Address is valid for SMTP but has unusual elements"; case EmailStatusCode.rfc5321: return "Address is valid for SMTP but has unusual elements";
case EmailStatusCode.cFoldingWhitespace: return "Address is valid within the message but cannot be used" case EmailStatusCode.cFoldingWhitespace: return "Address is valid within the message but cannot be used"~
" unmodified for the envelope"; " unmodified for the envelope";
case EmailStatusCode.deprecated_: return "Address contains deprecated elements but may still be valid in" case EmailStatusCode.deprecated_: return "Address contains deprecated elements but may still be valid in"~
" restricted contexts"; " restricted contexts";
case EmailStatusCode.rfc5322: return "The address is only valid according to the broad definition of RFC 5322." case EmailStatusCode.rfc5322: return "The address is only valid according to the broad definition of RFC 5322."~
" It is otherwise invalid"; " It is otherwise invalid";
case EmailStatusCode.any: return ""; case EmailStatusCode.any: return "";
@ -1334,7 +1334,7 @@ string statusCodeDescription (EmailStatusCode statusCode)
case EmailStatusCode.valid: return "Address is valid"; case EmailStatusCode.valid: return "Address is valid";
// Address is valid but a DNS check was not successful // Address is valid but a DNS check was not successful
case EmailStatusCode.dnsWarningNoMXRecord: return "Could not find an MX record for this domain but an A-record" case EmailStatusCode.dnsWarningNoMXRecord: return "Could not find an MX record for this domain but an A-record"~
" does exist"; " does exist";
case EmailStatusCode.dnsWarningNoRecord: return "Could not find an MX record or an A-record for this domain"; case EmailStatusCode.dnsWarningNoRecord: return "Could not find an MX record or an A-record for this domain";
@ -1342,13 +1342,13 @@ string statusCodeDescription (EmailStatusCode statusCode)
// Address is valid for SMTP but has unusual elements // Address is valid for SMTP but has unusual elements
case EmailStatusCode.rfc5321TopLevelDomain: return "Address is valid but at a Top Level Domain"; case EmailStatusCode.rfc5321TopLevelDomain: return "Address is valid but at a Top Level Domain";
case EmailStatusCode.rfc5321TopLevelDomainNumeric: return "Address is valid but the Top Level Domain begins" case EmailStatusCode.rfc5321TopLevelDomainNumeric: return "Address is valid but the Top Level Domain begins"~
" with a number"; " with a number";
case EmailStatusCode.rfc5321QuotedString: return "Address is valid but contains a quoted string"; case EmailStatusCode.rfc5321QuotedString: return "Address is valid but contains a quoted string";
case EmailStatusCode.rfc5321AddressLiteral: return "Address is valid but at a literal address not a domain"; case EmailStatusCode.rfc5321AddressLiteral: return "Address is valid but at a literal address not a domain";
case EmailStatusCode.rfc5321IpV6Deprecated: return "Address is valid but contains a :: that only elides one" case EmailStatusCode.rfc5321IpV6Deprecated: return "Address is valid but contains a :: that only elides one"~
" zero group"; " zero group";
@ -1359,7 +1359,7 @@ string statusCodeDescription (EmailStatusCode statusCode)
// Address contains deprecated elements but may still be valid in restricted contexts // Address contains deprecated elements but may still be valid in restricted contexts
case EmailStatusCode.deprecatedLocalPart: return "The local part is in a deprecated form"; case EmailStatusCode.deprecatedLocalPart: return "The local part is in a deprecated form";
case EmailStatusCode.deprecatedFoldingWhitespace: return "Address contains an obsolete form of" case EmailStatusCode.deprecatedFoldingWhitespace: return "Address contains an obsolete form of"~
" Folding White Space"; " Folding White Space";
case EmailStatusCode.deprecatedQuotedText: return "A quoted string contains a deprecated character"; case EmailStatusCode.deprecatedQuotedText: return "A quoted string contains a deprecated character";
@ -1367,11 +1367,11 @@ string statusCodeDescription (EmailStatusCode statusCode)
case EmailStatusCode.deprecatedComment: return "Address contains a comment in a position that is deprecated"; case EmailStatusCode.deprecatedComment: return "Address contains a comment in a position that is deprecated";
case EmailStatusCode.deprecatedCommentText: return "A comment contains a deprecated character"; case EmailStatusCode.deprecatedCommentText: return "A comment contains a deprecated character";
case EmailStatusCode.deprecatedCommentFoldingWhitespaceNearAt: return "Address contains a comment or" case EmailStatusCode.deprecatedCommentFoldingWhitespaceNearAt: return "Address contains a comment or"~
" Folding White Space around the @ sign"; " Folding White Space around the @ sign";
// The address is only valid according to the broad definition of RFC 5322 // The address is only valid according to the broad definition of RFC 5322
case EmailStatusCode.rfc5322Domain: return "Address is RFC 5322 compliant but contains domain characters that" case EmailStatusCode.rfc5322Domain: return "Address is RFC 5322 compliant but contains domain characters that"~
" are not allowed by DNS"; " are not allowed by DNS";
case EmailStatusCode.rfc5322TooLong: return "Address is too long"; case EmailStatusCode.rfc5322TooLong: return "Address is too long";
@ -1380,7 +1380,7 @@ string statusCodeDescription (EmailStatusCode statusCode)
case EmailStatusCode.rfc5322LabelTooLong: return "The domain part contains an element that is too long"; case EmailStatusCode.rfc5322LabelTooLong: return "The domain part contains an element that is too long";
case EmailStatusCode.rfc5322DomainLiteral: return "The domain literal is not a valid RFC 5321 address literal"; case EmailStatusCode.rfc5322DomainLiteral: return "The domain literal is not a valid RFC 5321 address literal";
case EmailStatusCode.rfc5322DomainLiteralObsoleteText: return "The domain literal is not a valid RFC 5321" case EmailStatusCode.rfc5322DomainLiteralObsoleteText: return "The domain literal is not a valid RFC 5321"~
" address literal and it contains obsolete characters"; " address literal and it contains obsolete characters";
case EmailStatusCode.rfc5322IpV6GroupCount: case EmailStatusCode.rfc5322IpV6GroupCount:
@ -1407,7 +1407,7 @@ string statusCodeDescription (EmailStatusCode statusCode)
case EmailStatusCode.errorTextAfterQuotedString: return "Address contains text after a quoted string"; case EmailStatusCode.errorTextAfterQuotedString: return "Address contains text after a quoted string";
case EmailStatusCode.errorTextAfterDomainLiteral: return "Extra characters were found after the end of" case EmailStatusCode.errorTextAfterDomainLiteral: return "Extra characters were found after the end of"~
" the domain literal"; " the domain literal";
case EmailStatusCode.errorExpectingQuotedPair: case EmailStatusCode.errorExpectingQuotedPair:

View file

@ -1662,7 +1662,7 @@ public:
alias args[0..$ - 1] args2; alias args[0..$ - 1] args2;
alias Args[0..$ - 1] Args2; alias Args[0..$ - 1] Args2;
enforce(buf.length == len, enforce(buf.length == len,
text("Can't use a user supplied buffer that's the wrong " text("Can't use a user supplied buffer that's the wrong ",
"size. (Expected :", len, " Got: ", buf.length)); "size. (Expected :", len, " Got: ", buf.length));
} }
else static if(randAssignable!(Args[$ - 1]) && Args.length > 1) else static if(randAssignable!(Args[$ - 1]) && Args.length > 1)

View file

@ -621,7 +621,7 @@ Parameter for the generator.
mti = n; mti = n;
if(range.empty && j < n) if(range.empty && j < n)
{ {
throw new Exception(format("MersenneTwisterEngine.seed: Input range didn't provide enough" throw new Exception(format("MersenneTwisterEngine.seed: Input range didn't provide enough"~
" elements: Need %s elemnets.", n)); " elements: Need %s elemnets.", n));
} }

View file

@ -2941,15 +2941,15 @@ if (Rs.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Rs)))
static string makeSwitchIncrementCounter() static string makeSwitchIncrementCounter()
{ {
string result = string result =
"auto next = _current == Rs.length - 1 ? 0 : _current + 1;\n" "auto next = _current == Rs.length - 1 ? 0 : _current + 1;\n"~
"switch (next) {\n"; "switch (next) {\n";
foreach (i, R; Rs) foreach (i, R; Rs)
{ {
auto si = to!string(i); auto si = to!string(i);
auto si_1 = to!string(i ? i - 1 : Rs.length - 1); auto si_1 = to!string(i ? i - 1 : Rs.length - 1);
result ~= "case "~si~": " result ~= "case "~si~": "~
"if (!source["~si~"].empty) { _current = "~si~"; return; }\n" "if (!source["~si~"].empty) { _current = "~si~"; return; }\n"~
"if ("~si~" == _current) { _current = _current.max; return; }\n" "if ("~si~" == _current) { _current = _current.max; return; }\n"~
"goto case "~to!string((i + 1) % Rs.length)~";\n"; "goto case "~to!string((i + 1) % Rs.length)~";\n";
} }
return result ~ "default: assert(0); }"; return result ~ "default: assert(0); }";

View file

@ -6845,16 +6845,16 @@ unittest
TestVectors( `[-+*/\p{in-mathematical-operators}]{2}`, "a+\u2212", "y", "$&", "+\u2212"), TestVectors( `[-+*/\p{in-mathematical-operators}]{2}`, "a+\u2212", "y", "$&", "+\u2212"),
TestVectors( `\p{Ll}+`, "XabcD", "y", "$&", "abc"), TestVectors( `\p{Ll}+`, "XabcD", "y", "$&", "abc"),
TestVectors( `\p{Lu}+`, "абвГДЕ", "y", "$&", "ГДЕ"), TestVectors( `\p{Lu}+`, "абвГДЕ", "y", "$&", "ГДЕ"),
TestVectors( `^\p{Currency Symbol}\p{Sc}` "$₤", "y", "$&", "$₤"), TestVectors( `^\p{Currency Symbol}\p{Sc}`, "$₤", "y", "$&", "$₤"),
TestVectors( `\p{Common}\p{Thai}` "!ฆ", "y", "$&", "!ฆ"), TestVectors( `\p{Common}\p{Thai}`, "!ฆ", "y", "$&", "!ฆ"),
TestVectors( `[\d\s]*\D`, "12 \t3\U00001680\u0F20_2", "y", "$&", "12 \t3\U00001680\u0F20_"), TestVectors( `[\d\s]*\D`, "12 \t3\U00001680\u0F20_2", "y", "$&", "12 \t3\U00001680\u0F20_"),
TestVectors( `[c-wф]фф`, "ффф", "y", "$&", "ффф"), TestVectors( `[c-wф]фф`, "ффф", "y", "$&", "ффф"),
//case insensitive: //case insensitive:
TestVectors( `^abcdEf$`, "AbCdEF" "y", "$&", "AbCdEF", "i"), TestVectors( `^abcdEf$`, "AbCdEF", "y", "$&", "AbCdEF", "i"),
TestVectors( `Русский язык`, "рУсскИй ЯзЫк", "y", "$&", "рУсскИй ЯзЫк", "i"), TestVectors( `Русский язык`, "рУсскИй ЯзЫк", "y", "$&", "рУсскИй ЯзЫк", "i"),
TestVectors( `ⒶⒷⓒ` , "ⓐⓑⒸ", "y", "$&", "ⓐⓑⒸ", "i"), TestVectors( `ⒶⒷⓒ` , "ⓐⓑⒸ", "y", "$&", "ⓐⓑⒸ", "i"),
TestVectors( "\U00010400{2}", "\U00010428\U00010400 ", "y", "$&", "\U00010428\U00010400", "i"), TestVectors( "\U00010400{2}", "\U00010428\U00010400 ", "y", "$&", "\U00010428\U00010400", "i"),
TestVectors( `[adzУ-Я]{4}`, "DzюА" "y", "$&", "DzЮа", "i"), TestVectors( `[adzУ-Я]{4}`, "DzюА", "y", "$&", "DzЮа", "i"),
TestVectors( `\p{L}\p{Lu}{10}`, "абвгдеЖЗИКЛ", "y", "$&", "абвгдеЖЗИКЛ", "i"), TestVectors( `\p{L}\p{Lu}{10}`, "абвгдеЖЗИКЛ", "y", "$&", "абвгдеЖЗИКЛ", "i"),
TestVectors( `(?:Dåb){3}`, "DåbDÅBdÅb", "y", "$&", "DåbDÅBdÅb", "i"), TestVectors( `(?:Dåb){3}`, "DåbDÅBdÅb", "y", "$&", "DåbDÅBdÅb", "i"),
//escapes: //escapes:

View file

@ -732,7 +732,7 @@ unittest
static assert(fqn!(typeof(cFuncPtr)) == format("extern(C) %s function(double, string)", inner_name)); static assert(fqn!(typeof(cFuncPtr)) == format("extern(C) %s function(double, string)", inner_name));
// Delegate type with qualified function type // Delegate type with qualified function type
static assert(fqn!(typeof(attrDeleg)) == format("shared(immutable(%s) " static assert(fqn!(typeof(attrDeleg)) == format("shared(immutable(%s) "~
"delegate(ref double, scope string) nothrow @trusted shared const)", inner_name)); "delegate(ref double, scope string) nothrow @trusted shared const)", inner_name));
// Variable argument function types // Variable argument function types

View file

@ -2730,7 +2730,7 @@ template generateAssertTrap(C, func.../+[BUG 4217]+/)
{ {
static if (functionAttributes!(func) & FunctionAttribute.nothrow_) //XXX static if (functionAttributes!(func) & FunctionAttribute.nothrow_) //XXX
{ {
pragma(msg, "Warning: WhiteHole!(", C, ") used assert(0) instead " pragma(msg, "Warning: WhiteHole!(", C, ") used assert(0) instead ",
"of Error for the auto-implemented nothrow function ", "of Error for the auto-implemented nothrow function ",
C, ".", __traits(identifier, func)); C, ".", __traits(identifier, func));
enum string generateAssertTrap = enum string generateAssertTrap =

View file

@ -3767,7 +3767,7 @@ private:
curIndex = idxB; // open-right curIndex = idxB; // open-right
} }
enum errMsg = "non-monotonic prefix function(s), an unsorted range or " enum errMsg = "non-monotonic prefix function(s), an unsorted range or "~
"duplicate key->value mapping"; "duplicate key->value mapping";
public: public:
@ -4919,7 +4919,7 @@ else
"N", "Number", "N", "Number",
"P", "Punctuation", "P", "Punctuation",
"S", "Symbol", "S", "Symbol",
"Z", "Separator" "Z", "Separator",
"Graphical", "Graphical",
"any", "any",
"ascii" "ascii"

View file

@ -1475,7 +1475,7 @@ enum x500Namespace = UUID("6ba7b814-9dad-11d1-80b4-00c04fd430c8");
* writeln(found); * writeln(found);
* ------------------- * -------------------
*/ */
enum uuidRegex = r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}" enum uuidRegex = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}"~
"-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"; "-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
/// ///
@ -1484,11 +1484,11 @@ unittest
import std.algorithm; import std.algorithm;
import std.regex; import std.regex;
string test = "Lorem ipsum dolor sit amet, consetetur " string test = "Lorem ipsum dolor sit amet, consetetur "~
"6ba7b814-9dad-11d1-80b4-00c04fd430c8 sadipscing \n" "6ba7b814-9dad-11d1-80b4-00c04fd430c8 sadipscing \n"~
"elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore \r\n" "elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore \r\n"~
"magna aliquyam erat, sed diam voluptua. " "magna aliquyam erat, sed diam voluptua. "~
"8ab3060e-2cba-4f23-b74c-b52db3bdfb46 At vero eos et accusam et " "8ab3060e-2cba-4f23-b74c-b52db3bdfb46 At vero eos et accusam et "~
"justo duo dolores et ea rebum."; "justo duo dolores et ea rebum.";
auto r = regex(uuidRegex, "g"); auto r = regex(uuidRegex, "g");

View file

@ -566,7 +566,7 @@ public:
else static if (is(T : const(VariantN))) else static if (is(T : const(VariantN)))
{ {
static assert(false, static assert(false,
"Assigning Variant objects from const Variant" "Assigning Variant objects from const Variant"~
" objects is currently not supported."); " objects is currently not supported.");
} }
else else

View file

@ -2350,7 +2350,7 @@ private
int n = 0; int n = 0;
if (s.startsWith("'yes'") || s.startsWith("\"yes\"")) n = 5; if (s.startsWith("'yes'") || s.startsWith("\"yes\"")) n = 5;
else if (s.startsWith("'no'" ) || s.startsWith("\"no\"" )) n = 4; else if (s.startsWith("'no'" ) || s.startsWith("\"no\"" )) n = 4;
else fail("standalone attribute value must be 'yes', \"yes\"," else fail("standalone attribute value must be 'yes', \"yes\","~
" 'no' or \"no\""); " 'no' or \"no\"");
s = s[n..$]; s = s[n..$];
} }
@ -2686,7 +2686,7 @@ unittest
} }
catch(CheckException e) catch(CheckException e)
{ {
int n = e.toString().indexOf("end tag name \"genres\" differs" int n = e.toString().indexOf("end tag name \"genres\" differs"~
" from start tag name \"genre\""); " from start tag name \"genre\"");
assert(n != -1); assert(n != -1);
} }