diff --git a/std/algorithm/comparison.d b/std/algorithm/comparison.d
index 4366aaacd..7170236ef 100644
--- a/std/algorithm/comparison.d
+++ b/std/algorithm/comparison.d
@@ -280,7 +280,7 @@ auto castSwitch(choices...)(Object switchObject)
if (classInfo == typeid(CastClass))
{
- static if(is(ReturnType!(choice) == void))
+ static if (is(ReturnType!(choice) == void))
{
choice(cast(CastClass) switchObject);
static if (areAllHandlersVoidResult)
@@ -308,7 +308,7 @@ auto castSwitch(choices...)(Object switchObject)
{
if (auto castedObject = cast(choiceParameterTypes[0]) switchObject)
{
- static if(is(ReturnType!(choice) == void))
+ static if (is(ReturnType!(choice) == void))
{
choice(castedObject);
static if (areAllHandlersVoidResult)
@@ -345,7 +345,7 @@ auto castSwitch(choices...)(Object switchObject)
if (switchObject is null)
{
- static if(is(ReturnType!(choice) == void))
+ static if (is(ReturnType!(choice) == void))
{
choice();
static if (areAllHandlersVoidResult)
diff --git a/std/algorithm/iteration.d b/std/algorithm/iteration.d
index a21a71a64..111c52850 100644
--- a/std/algorithm/iteration.d
+++ b/std/algorithm/iteration.d
@@ -461,7 +461,7 @@ template map(fun...) if (fun.length >= 1)
alias _fun = adjoin!_funs;
// Once DMD issue #5710 is fixed, this validation loop can be moved into a template.
- foreach(f; _funs)
+ foreach (f; _funs)
{
static assert(!is(typeof(f(RE.init)) == void),
"Mapping function(s) must not return void: " ~ _funs.stringof);
@@ -4263,7 +4263,7 @@ unittest
@safe pure nothrow @nogc unittest
{
import std.range;
- foreach(n; iota(50))
+ foreach (n; iota(50))
assert(repeat(1.0, n).sum == n);
}
diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d
index 34f36df20..4161cd594 100644
--- a/std/algorithm/mutation.d
+++ b/std/algorithm/mutation.d
@@ -829,7 +829,7 @@ unittest
assert (!typeid(S3).initializer().ptr);
assert ( typeid(S4).initializer().ptr);
- foreach(S; AliasSeq!(S1, S2, S3, S4))
+ foreach (S; AliasSeq!(S1, S2, S3, S4))
{
//initializeAll
{
diff --git a/std/algorithm/searching.d b/std/algorithm/searching.d
index 41f716bf4..6e7f2c484 100644
--- a/std/algorithm/searching.d
+++ b/std/algorithm/searching.d
@@ -514,7 +514,7 @@ if (isNarrowString!R1 && isNarrowString!R2)
wchar[], const(wchar)[], wstring,
dchar[], const(dchar)[], dstring))
{
- foreach(T; AliasSeq!(string, wstring, dstring))
+ foreach (T; AliasSeq!(string, wstring, dstring))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
assert(commonPrefix(to!S(""), to!T("")).empty);
assert(commonPrefix(to!S(""), to!T("hello")).empty);
@@ -1425,9 +1425,9 @@ if (isInputRange!InputRange &&
@safe pure unittest
{
import std.meta : AliasSeq;
- foreach(R; AliasSeq!(string, wstring, dstring))
+ foreach (R; AliasSeq!(string, wstring, dstring))
{
- foreach(E; AliasSeq!(char, wchar, dchar))
+ foreach (E; AliasSeq!(char, wchar, dchar))
{
R r1 = "hello world";
E e1 = 'w';
@@ -1474,9 +1474,9 @@ if (isInputRange!InputRange &&
{
byte[] sarr = [1, 2, 3, 4];
ubyte[] uarr = [1, 2, 3, 4];
- foreach(arr; AliasSeq!(sarr, uarr))
+ foreach (arr; AliasSeq!(sarr, uarr))
{
- foreach(T; AliasSeq!(byte, ubyte, int, uint))
+ foreach (T; AliasSeq!(byte, ubyte, int, uint))
{
assert(find(arr, cast(T) 3) == arr[2 .. $]);
assert(find(arr, cast(T) 9) == arr[$ .. $]);
diff --git a/std/algorithm/setops.d b/std/algorithm/setops.d
index 7c4094174..bc2e5c41d 100644
--- a/std/algorithm/setops.d
+++ b/std/algorithm/setops.d
@@ -1001,7 +1001,7 @@ private:
do {
next.popFront();
if (next.empty) return;
- } while(comp(next.front, r.front));
+ } while (comp(next.front, r.front));
done = Rs.length;
}
if (--done == 0) return;
diff --git a/std/algorithm/sorting.d b/std/algorithm/sorting.d
index 2b01e6789..8b549408d 100644
--- a/std/algorithm/sorting.d
+++ b/std/algorithm/sorting.d
@@ -964,7 +964,7 @@ private size_t getPivot(alias less, Range)(Range r)
((cast(uint) (pred(r[0], r[len - 1]))) << 1) |
(cast(uint) (pred(r[mid], r[len - 1])));
- switch(result) {
+ switch (result) {
case 0b001:
r.swapAt(0, len - 1);
r.swapAt(0, mid);
@@ -1243,7 +1243,7 @@ unittest
size_t[] arr;
arr.length = 1024;
- foreach(k; 0..arr.length) arr[k] = k;
+ foreach (k; 0..arr.length) arr[k] = k;
swapRanges(arr[0..$/2], arr[$/2..$]);
sort!(pred, SwapStrategy.unstable)(arr);
@@ -1538,7 +1538,7 @@ private template TimSortImpl(alias pred, R)
if (stackLen == 2) assert(stack[0].length > stack[1].length);
else if (stackLen > 2)
{
- foreach(k; 2 .. stackLen)
+ foreach (k; 2 .. stackLen)
{
assert(stack[k - 2].length > stack[k - 1].length + stack[k].length);
assert(stack[k - 1].length > stack[k].length);
@@ -1729,7 +1729,7 @@ private template TimSortImpl(alias pred, R)
immutable lef_end = temp.length - 1;
if (lef < lef_end && rig < range.length)
- outer: while(true)
+ outer: while (true)
{
count_lef = 0;
count_rig = 0;
@@ -1740,14 +1740,14 @@ private template TimSortImpl(alias pred, R)
if (lessEqual(temp[lef], range[rig]))
{
range[i++] = temp[lef++];
- if(lef >= lef_end) break outer;
+ if (lef >= lef_end) break outer;
++count_lef;
count_rig = 0;
}
else
{
range[i++] = range[rig++];
- if(rig >= range.length) break outer;
+ if (rig >= range.length) break outer;
count_lef = 0;
++count_rig;
}
@@ -1758,14 +1758,14 @@ private template TimSortImpl(alias pred, R)
{
count_lef = gallopForwardUpper(temp[lef .. $], range[rig]);
foreach (j; 0 .. count_lef) range[i++] = temp[lef++];
- if(lef >= temp.length) break outer;
+ if (lef >= temp.length) break outer;
count_rig = gallopForwardLower(range[rig .. range.length], temp[lef]);
foreach (j; 0 .. count_rig) range[i++] = range[rig++];
- if (rig >= range.length) while(true)
+ if (rig >= range.length) while (true)
{
range[i++] = temp[lef++];
- if(lef >= temp.length) break outer;
+ if (lef >= temp.length) break outer;
}
if (minGallop > 0) --minGallop;
@@ -1811,24 +1811,24 @@ private template TimSortImpl(alias pred, R)
size_t count_lef, count_rig;
outer:
- while(true)
+ while (true)
{
count_lef = 0;
count_rig = 0;
// Linear merge
- while((count_lef | count_rig) < minGallop)
+ while ((count_lef | count_rig) < minGallop)
{
- if(greaterEqual(temp[rig], range[lef]))
+ if (greaterEqual(temp[rig], range[lef]))
{
range[i--] = temp[rig];
- if(rig == 1)
+ if (rig == 1)
{
// Move remaining elements from left
- while(true)
+ while (true)
{
range[i--] = range[lef];
- if(lef == 0) break;
+ if (lef == 0) break;
--lef;
}
@@ -1844,10 +1844,10 @@ private template TimSortImpl(alias pred, R)
else
{
range[i--] = range[lef];
- if(lef == 0) while(true)
+ if (lef == 0) while (true)
{
range[i--] = temp[rig];
- if(rig == 0) break outer;
+ if (rig == 0) break outer;
--rig;
}
--lef;
@@ -1860,29 +1860,29 @@ private template TimSortImpl(alias pred, R)
do
{
count_rig = rig - gallopReverseLower(temp[0 .. rig], range[lef]);
- foreach(j; 0 .. count_rig)
+ foreach (j; 0 .. count_rig)
{
range[i--] = temp[rig];
- if(rig == 0) break outer;
+ if (rig == 0) break outer;
--rig;
}
count_lef = lef - gallopReverseUpper(range[0 .. lef], temp[rig]);
- foreach(j; 0 .. count_lef)
+ foreach (j; 0 .. count_lef)
{
range[i--] = range[lef];
- if(lef == 0) while(true)
+ if (lef == 0) while (true)
{
range[i--] = temp[rig];
- if(rig == 0) break outer;
+ if (rig == 0) break outer;
--rig;
}
--lef;
}
- if(minGallop > 0) --minGallop;
+ if (minGallop > 0) --minGallop;
}
- while(count_lef >= minimalGallop || count_rig >= minimalGallop);
+ while (count_lef >= minimalGallop || count_rig >= minimalGallop);
minGallop += 2;
}
@@ -1992,7 +1992,7 @@ unittest
arr.length = 64 * 64;
// We want duplicate values for testing stability
- foreach(i, ref v; arr) v.value = i / 64;
+ foreach (i, ref v; arr) v.value = i / 64;
// Swap ranges at random middle point (test large merge operation)
immutable mid = uniform(arr.length / 4, arr.length / 4 * 3, rnd);
@@ -2002,7 +2002,7 @@ unittest
randomShuffle(arr[$ / 8 * 7 .. $], rnd);
// Swap few random elements (test galloping mode)
- foreach(i; 0 .. arr.length / 64)
+ foreach (i; 0 .. arr.length / 64)
{
immutable a = uniform(0, arr.length, rnd), b = uniform(0, arr.length, rnd);
swap(arr[a], arr[b]);
@@ -2010,7 +2010,7 @@ unittest
// Now that our test array is prepped, store original index value
// This will allow us to confirm the array was sorted stably
- foreach(i, ref v; arr) v.index = i;
+ foreach (i, ref v; arr) v.index = i;
return arr;
}
@@ -2032,9 +2032,9 @@ unittest
assert(isSorted!comp(arr));
// Test that the array was sorted stably
- foreach(i; 0 .. arr.length - 1)
+ foreach (i; 0 .. arr.length - 1)
{
- if(arr[i].value == arr[i + 1].value) assert(arr[i].index < arr[i + 1].index);
+ if (arr[i].value == arr[i + 1].value) assert(arr[i].index < arr[i + 1].index);
}
return true;
@@ -3047,7 +3047,7 @@ bool nextEvenPermutation(alias less="a < b", BidirectionalRange)
reverse(takeExactly(retro(range), n));
if ((n / 2) % 2 == 1)
oddParity = !oddParity;
- } while(oddParity);
+ } while (oddParity);
return ret;
}
diff --git a/std/array.d b/std/array.d
index 092248f5d..8ddc07a3e 100644
--- a/std/array.d
+++ b/std/array.d
@@ -223,10 +223,10 @@ unittest
int opApply(int delegate(ref int) dg)
{
int res;
- foreach(i; 0..10)
+ foreach (i; 0..10)
{
res = dg(i);
- if(res) break;
+ if (res) break;
}
return res;
@@ -283,7 +283,7 @@ unittest
int i;
}
- foreach(T; AliasSeq!(S, const S, immutable S))
+ foreach (T; AliasSeq!(S, const S, immutable S))
{
auto arr = [T(1), T(2), T(3), T(4)];
assert(array(arr) == arr);
@@ -476,7 +476,7 @@ version(unittest)
// Returns the number of dimensions in an array T.
private template nDimensions(T)
{
- static if(isArray!T)
+ static if (isArray!T)
{
enum nDimensions = 1 + nDimensions!(typeof(T.init[0]));
}
@@ -581,7 +581,7 @@ if (isDynamicArray!T && allSatisfy!(isIntegral, I))
double[][] matrix = minimallyInitializedArray!(double[][])(42);
assert(matrix.length == 42);
- foreach(elem; matrix)
+ foreach (elem; matrix)
{
assert(elem.ptr is null);
}
@@ -637,7 +637,7 @@ private auto arrayAllocImpl(bool minimallyInitialized, T, I...)(I sizes) nothrow
else static if (I.length > 1)
{
ret = arrayAllocImpl!(false, E[])(size);
- foreach(ref elem; ret)
+ foreach (ref elem; ret)
elem = arrayAllocImpl!(minimallyInitialized, E)(sizes[1..$]);
}
@@ -819,10 +819,10 @@ private void copyBackwards(T)(T[] src, T[] dest)
+/
void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
- if(!isSomeString!(T[])
+ if (!isSomeString!(T[])
&& allSatisfy!(isInputRangeOrConvertible!T, U) && U.length > 0)
{
- static if(allSatisfy!(isInputRangeWithLengthOrConvertible!T, U))
+ static if (allSatisfy!(isInputRangeWithLengthOrConvertible!T, U))
{
import std.conv : emplaceRef;
@@ -878,9 +878,9 @@ void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
/// Ditto
void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
- if(isSomeString!(T[]) && allSatisfy!(isCharOrStringOrDcharRange, U))
+ if (isSomeString!(T[]) && allSatisfy!(isCharOrStringOrDcharRange, U))
{
- static if(is(Unqual!T == T)
+ static if (is(Unqual!T == T)
&& allSatisfy!(isInputRangeWithLengthOrConvertible!dchar, U))
{
import std.utf : codeLength;
@@ -888,7 +888,7 @@ void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
//helper function: re-encode dchar to Ts and store at *ptr
static T* putDChar(T* ptr, dchar ch)
{
- static if(is(T == dchar))
+ static if (is(T == dchar))
{
*ptr++ = ch;
return ptr;
@@ -898,9 +898,9 @@ void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
import std.utf : encode;
T[dchar.sizeof/T.sizeof] buf;
size_t len = encode(buf, ch);
- final switch(len)
+ final switch (len)
{
- static if(T.sizeof == char.sizeof)
+ static if (T.sizeof == char.sizeof)
{
case 4:
ptr[3] = buf[3];
@@ -942,7 +942,7 @@ void insertInPlace(T, U...)(ref T[] array, size_t pos, U stuff)
auto ptr = array.ptr + pos;
foreach (i, E; U)
{
- static if(is(E : dchar))
+ static if (is(E : dchar))
{
ptr = putDChar(ptr, stuff[i]);
}
@@ -1017,17 +1017,17 @@ unittest
string file = __FILE__, size_t line = __LINE__)
{
{
- static if(is(T == typeof(T.init.dup)))
+ static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
a.insertInPlace(pos, toInsert);
- if(!std.algorithm.equal(a, result))
+ if (!std.algorithm.equal(a, result))
return false;
}
- static if(isInputRange!U)
+ static if (isInputRange!U)
{
orig.insertInPlace(pos, filter!"true"(toInsert));
return std.algorithm.equal(orig, result);
@@ -1073,7 +1073,7 @@ unittest
// variadic version
bool testVar(T, U...)(T orig, size_t pos, U args)
{
- static if(is(T == typeof(T.init.dup)))
+ static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
@@ -1218,7 +1218,7 @@ pure nothrow bool sameTail(T)(in T[] lhs, in T[] rhs)
@safe pure nothrow unittest
{
- foreach(T; AliasSeq!(int[], const(int)[], immutable(int)[], const int[], immutable int[]))
+ foreach (T; AliasSeq!(int[], const(int)[], immutable(int)[], const int[], immutable int[]))
{
T a = [1, 2, 3, 4, 5];
T b = a;
@@ -1555,7 +1555,7 @@ private enum bool hasCheapIteration(R) = isArray!R;
$(XREF_PACK algorithm,iteration,joiner)
+/
ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep)
- if(isInputRange!RoR &&
+ if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)) &&
isInputRange!R &&
is(Unqual!(ElementType!(ElementType!RoR)) == Unqual!(ElementType!R)))
@@ -1581,12 +1581,12 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep)
else
alias sepArr = sep;
- static if(hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
+ static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
import std.conv : emplaceRef;
size_t length; // length of result array
size_t rorLength; // length of range ror
- foreach(r; ror.save)
+ foreach (r; ror.save)
{
length += r.length;
++rorLength;
@@ -1597,14 +1597,14 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep)
auto result = (() @trusted => uninitializedArray!(RetTypeElement[])(length))();
size_t len;
- foreach(e; ror.front)
+ foreach (e; ror.front)
emplaceRef(result[len++], e);
ror.popFront();
- foreach(r; ror)
+ foreach (r; ror)
{
- foreach(e; sepArr)
+ foreach (e; sepArr)
emplaceRef(result[len++], e);
- foreach(e; r)
+ foreach (e; r)
emplaceRef(result[len++], e);
}
assert(len == result.length);
@@ -1632,7 +1632,7 @@ unittest // Issue 14230
/// Ditto
ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, E sep)
- if(isInputRange!RoR &&
+ if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)) &&
is(E : ElementType!(ElementType!RoR)))
{
@@ -1643,7 +1643,7 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, E sep)
if (ror.empty)
return RetType.init;
- static if(hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
+ static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
static if (isSomeChar!E && isSomeChar!RetTypeElement && E.sizeof > RetTypeElement.sizeof)
{
@@ -1657,7 +1657,7 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, E sep)
import std.conv : emplaceRef;
size_t length;
size_t rorLength;
- foreach(r; ror.save)
+ foreach (r; ror.save)
{
length += r.length;
++rorLength;
@@ -1669,13 +1669,13 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, E sep)
size_t len;
- foreach(e; ror.front)
+ foreach (e; ror.front)
emplaceRef(result[len++], e);
ror.popFront();
- foreach(r; ror)
+ foreach (r; ror)
{
emplaceRef(result[len++], sep);
- foreach(e; r)
+ foreach (e; r)
emplaceRef(result[len++], e);
}
assert(len == result.length);
@@ -1718,7 +1718,7 @@ unittest // Issue 14230
/// Ditto
ElementEncodingType!(ElementType!RoR)[] join(RoR)(RoR ror)
- if(isInputRange!RoR &&
+ if (isInputRange!RoR &&
isInputRange!(Unqual!(ElementType!RoR)))
{
alias RetType = typeof(return);
@@ -1728,17 +1728,17 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR)(RoR ror)
if (ror.empty)
return RetType.init;
- static if(hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
+ static if (hasCheapIteration!RoR && (hasLength!RoRElem || isNarrowString!RoRElem))
{
import std.conv : emplaceRef;
size_t length;
- foreach(r; ror.save)
+ foreach (r; ror.save)
length += r.length;
auto result = (() @trusted => uninitializedArray!(RetTypeElement[])(length))();
size_t len;
- foreach(r; ror)
- foreach(e; r)
+ foreach (r; ror)
+ foreach (e; r)
emplaceRef(result[len++], e);
assert(len == result.length);
return (() @trusted => cast(RetType)result)();
@@ -1813,7 +1813,7 @@ unittest
debug(std_array) printf("array.join.unittest\n");
- foreach(R; AliasSeq!(string, wstring, dstring))
+ foreach (R; AliasSeq!(string, wstring, dstring))
{
R word1 = "日本語";
R word2 = "paul";
@@ -1830,7 +1830,7 @@ unittest
auto filteredLenWordsArr = [filteredLenWord1, filteredLenWord2, filteredLenWord3];
auto filteredWords = filter!"true"(filteredWordsArr);
- foreach(S; AliasSeq!(string, wstring, dstring))
+ foreach (S; AliasSeq!(string, wstring, dstring))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
assert(join(filteredWords, to!S(", ")) == "日本語, paul, jerry");
assert(join(filteredWords, to!(ElementType!S)(',')) == "日本語,paul,jerry");
@@ -2079,11 +2079,11 @@ unittest
array without changing the contents of $(D subject).
+/
T[] replace(T, Range)(T[] subject, size_t from, size_t to, Range stuff)
- if(isInputRange!Range &&
+ if (isInputRange!Range &&
(is(ElementType!Range : T) ||
isSomeString!(T[]) && is(ElementType!Range : dchar)))
{
- static if(hasLength!Range && is(ElementEncodingType!Range : T))
+ static if (hasLength!Range && is(ElementEncodingType!Range : T))
{
import std.algorithm : copy;
assert(from <= to);
@@ -2091,7 +2091,7 @@ T[] replace(T, Range)(T[] subject, size_t from, size_t to, Range stuff)
auto retval = new Unqual!(T)[](subject.length - sliceLen + stuff.length);
retval[0 .. from] = subject[0 .. from];
- if(!stuff.empty)
+ if (!stuff.empty)
copy(stuff, retval[from .. from + stuff.length]);
retval[from + stuff.length .. $] = subject[to .. $];
@@ -2195,9 +2195,9 @@ unittest
shrinks the array as needed.
+/
void replaceInPlace(T, Range)(ref T[] array, size_t from, size_t to, Range stuff)
- if(is(typeof(replace(array, from, to, stuff))))
+ if (is(typeof(replace(array, from, to, stuff))))
{
- static if(isDynamicArray!Range &&
+ static if (isDynamicArray!Range &&
is(Unqual!(ElementEncodingType!Range) == T) &&
!isNarrowString!(T[]))
{
@@ -2294,8 +2294,8 @@ unittest
alias allChars = AliasSeq!(char, immutable(char), const(char),
wchar, immutable(wchar), const(wchar),
dchar, immutable(dchar), const(dchar));
- foreach(T; allChars)
- foreach(U; allChars)
+ foreach (T; allChars)
+ foreach (U; allChars)
testStringReplaceInPlace!(T, U)();
void testInout(inout(int)[] a)
@@ -2327,17 +2327,17 @@ unittest
string file = __FILE__, size_t line = __LINE__)
{
{
- static if(is(T == typeof(T.init.dup)))
+ static if (is(T == typeof(T.init.dup)))
auto a = orig.dup;
else
auto a = orig.idup;
a.replaceInPlace(from, to, toReplace);
- if(!std.algorithm.equal(a, result))
+ if (!std.algorithm.equal(a, result))
return false;
}
- static if(isInputRange!U)
+ static if (isInputRange!U)
{
orig.replaceInPlace(from, to, filter!"true"(toReplace));
return std.algorithm.equal(orig, result);
@@ -3015,11 +3015,11 @@ private size_t appenderNewCapacity(size_t TSizeOf)(size_t curLen, size_t reqLen)
{
import core.bitop : bsr;
import std.algorithm : max;
- if(curLen == 0)
+ if (curLen == 0)
return max(reqLen,8);
ulong mult = 100 + (1000UL) / (bsr(curLen * TSizeOf) + 1);
// limit to doubling the length, we don't want to grow too much
- if(mult > 200)
+ if (mult > 200)
mult = 200;
auto sugLen = cast(size_t)((curLen * mult + 99) / 100);
return max(reqLen, sugLen);
@@ -3416,7 +3416,7 @@ unittest //Test large allocations (for GC.extend)
import std.algorithm : equal;
Appender!(char[]) app;
app.reserve(1); //cover reserve on non-initialized
- foreach(_; 0 .. 100_000)
+ foreach (_; 0 .. 100_000)
app.put('a');
assert(equal(app.data, 'a'.repeat(100_000)));
}
diff --git a/std/ascii.d b/std/ascii.d
index 90c24e1f4..6be29fceb 100644
--- a/std/ascii.d
+++ b/std/ascii.d
@@ -84,10 +84,10 @@ bool isAlphaNum(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; chain(digits, octalDigits, fullHexDigits, letters, lowercase, uppercase))
+ foreach (c; chain(digits, octalDigits, fullHexDigits, letters, lowercase, uppercase))
assert(isAlphaNum(c));
- foreach(c; whitespace)
+ foreach (c; whitespace)
assert(!isAlphaNum(c));
}
@@ -115,10 +115,10 @@ bool isAlpha(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; chain(letters, lowercase, uppercase))
+ foreach (c; chain(letters, lowercase, uppercase))
assert(isAlpha(c));
- foreach(c; chain(digits, octalDigits, whitespace))
+ foreach (c; chain(digits, octalDigits, whitespace))
assert(!isAlpha(c));
}
@@ -146,10 +146,10 @@ bool isLower(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; lowercase)
+ foreach (c; lowercase)
assert(isLower(c));
- foreach(c; chain(digits, uppercase, whitespace))
+ foreach (c; chain(digits, uppercase, whitespace))
assert(!isLower(c));
}
@@ -177,10 +177,10 @@ bool isUpper(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; uppercase)
+ foreach (c; uppercase)
assert(isUpper(c));
- foreach(c; chain(digits, lowercase, whitespace))
+ foreach (c; chain(digits, lowercase, whitespace))
assert(!isUpper(c));
}
@@ -209,10 +209,10 @@ bool isDigit(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; digits)
+ foreach (c; digits)
assert(isDigit(c));
- foreach(c; chain(letters, whitespace))
+ foreach (c; chain(letters, whitespace))
assert(!isDigit(c));
}
@@ -238,10 +238,10 @@ bool isOctalDigit(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; octalDigits)
+ foreach (c; octalDigits)
assert(isOctalDigit(c));
- foreach(c; chain(letters, ['8', '9'], whitespace))
+ foreach (c; chain(letters, ['8', '9'], whitespace))
assert(!isOctalDigit(c));
}
@@ -268,10 +268,10 @@ bool isHexDigit(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; fullHexDigits)
+ foreach (c; fullHexDigits)
assert(isHexDigit(c));
- foreach(c; chain(lowercase[6 .. $], uppercase[6 .. $], whitespace))
+ foreach (c; chain(lowercase[6 .. $], uppercase[6 .. $], whitespace))
assert(!isHexDigit(c));
}
@@ -305,10 +305,10 @@ bool isWhite(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(c; whitespace)
+ foreach (c; whitespace)
assert(isWhite(c));
- foreach(c; chain(digits, letters))
+ foreach (c; chain(digits, letters))
assert(!isWhite(c));
}
@@ -341,11 +341,11 @@ bool isControl(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(dchar c; 0 .. 32)
+ foreach (dchar c; 0 .. 32)
assert(isControl(c));
assert(isControl(127));
- foreach(c; chain(digits, letters, [' ']))
+ foreach (c; chain(digits, letters, [' ']))
assert(!isControl(c));
}
@@ -385,9 +385,9 @@ bool isPunctuation(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(dchar c; 0 .. 128)
+ foreach (dchar c; 0 .. 128)
{
- if(isControl(c) || isAlphaNum(c) || c == ' ')
+ if (isControl(c) || isAlphaNum(c) || c == ' ')
assert(!isPunctuation(c));
else
assert(isPunctuation(c));
@@ -421,9 +421,9 @@ bool isGraphical(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(dchar c; 0 .. 128)
+ foreach (dchar c; 0 .. 128)
{
- if(isControl(c) || c == ' ')
+ if (isControl(c) || c == ' ')
assert(!isGraphical(c));
else
assert(isGraphical(c));
@@ -456,9 +456,9 @@ bool isPrintable(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(dchar c; 0 .. 128)
+ foreach (dchar c; 0 .. 128)
{
- if(isControl(c))
+ if (isControl(c))
assert(!isPrintable(c));
else
assert(isPrintable(c));
@@ -486,7 +486,7 @@ bool isASCII(dchar c) @safe pure nothrow @nogc
unittest
{
- foreach(dchar c; 0 .. 128)
+ foreach (dchar c; 0 .. 128)
assert(isASCII(c));
assert(!isASCII(128));
@@ -505,7 +505,7 @@ unittest
ASCII character, otherwise $(D c) itself.
+/
auto toLower(C)(C c)
- if(is(C : dchar))
+ if (is(C : dchar))
{
import std.traits : isAggregateType, OriginalType, Unqual;
@@ -532,20 +532,20 @@ auto toLower(C)(C c)
@safe pure nothrow unittest
{
- foreach(C; AliasSeq!(char, wchar, dchar, immutable char, ubyte))
+ foreach (C; AliasSeq!(char, wchar, dchar, immutable char, ubyte))
{
- foreach(i, c; uppercase)
+ foreach (i, c; uppercase)
assert(toLower(cast(C)c) == lowercase[i]);
- foreach(C c; 0 .. 128)
+ foreach (C c; 0 .. 128)
{
- if(c < 'A' || c > 'Z')
+ if (c < 'A' || c > 'Z')
assert(toLower(c) == c);
else
assert(toLower(c) != c);
}
- foreach(C c; 128 .. C.max)
+ foreach (C c; 128 .. C.max)
assert(toLower(c) == c);
//CTFE
@@ -567,7 +567,7 @@ auto toLower(C)(C c)
character, otherwise $(D c) itself.
+/
auto toUpper(C)(C c)
- if(is(C : dchar))
+ if (is(C : dchar))
{
import std.traits : isAggregateType, OriginalType, Unqual;
@@ -593,20 +593,20 @@ auto toUpper(C)(C c)
@safe pure nothrow unittest
{
- foreach(C; AliasSeq!(char, wchar, dchar, immutable char, ubyte))
+ foreach (C; AliasSeq!(char, wchar, dchar, immutable char, ubyte))
{
- foreach(i, c; lowercase)
+ foreach (i, c; lowercase)
assert(toUpper(cast(C)c) == uppercase[i]);
- foreach(C c; 0 .. 128)
+ foreach (C c; 0 .. 128)
{
- if(c < 'a' || c > 'z')
+ if (c < 'a' || c > 'z')
assert(toUpper(c) == c);
else
assert(toUpper(c) != c);
}
- foreach(C c; 128 .. C.max)
+ foreach (C c; 128 .. C.max)
assert(toUpper(c) == c);
//CTFE
diff --git a/std/bigint.d b/std/bigint.d
index 269959d1f..6372c159f 100644
--- a/std/bigint.d
+++ b/std/bigint.d
@@ -1531,7 +1531,7 @@ unittest // 13963
{
BigInt x = 1;
import std.meta : AliasSeq;
- foreach(Int; AliasSeq!(byte, ubyte, short, ushort, int, uint))
+ foreach (Int; AliasSeq!(byte, ubyte, short, ushort, int, uint))
{
assert(is(typeof(x % Int(1)) == int));
}
diff --git a/std/bitmanip.d b/std/bitmanip.d
index 947312c5d..a6221295f 100644
--- a/std/bitmanip.d
+++ b/std/bitmanip.d
@@ -197,7 +197,7 @@ private template createReferenceAccessor(string store, T, ulong bits, string nam
private template sizeOfBitField(T...)
{
- static if(T.length < 2)
+ static if (T.length < 2)
enum sizeOfBitField = 0;
else
enum sizeOfBitField = T[2] + sizeOfBitField!(T[3 .. $]);
@@ -311,7 +311,7 @@ The example above creates a tagged reference to an Object in the struct A. This
as $(D taggedPointer), except the first argument which must be a class type instead of a pointer type.
*/
-template taggedClassRef(T, string name, Ts...) if(is(T == class)) {
+template taggedClassRef(T, string name, Ts...) if (is(T == class)) {
enum taggedClassRef = createTaggedReference!(T, 8, name, Ts).result;
}
@@ -2013,7 +2013,7 @@ public:
void toString(scope void delegate(const(char)[]) sink,
FormatSpec!char fmt) const
{
- switch(fmt.spec)
+ switch (fmt.spec)
{
case 'b':
return formatBitString(sink);
@@ -2169,17 +2169,17 @@ unittest
Swaps the endianness of the given integral value or character.
+/
T swapEndian(T)(T val) @safe pure nothrow @nogc
- if(isIntegral!T || isSomeChar!T || isBoolean!T)
+ if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
- static if(val.sizeof == 1)
+ static if (val.sizeof == 1)
return val;
- else static if(isUnsigned!T)
+ else static if (isUnsigned!T)
return swapEndianImpl(val);
- else static if(isIntegral!T)
+ else static if (isIntegral!T)
return cast(T)swapEndianImpl(cast(Unsigned!T) val);
- else static if(is(Unqual!T == wchar))
+ else static if (is(Unqual!T == wchar))
return cast(T)swapEndian(cast(ushort)val);
- else static if(is(Unqual!T == dchar))
+ else static if (is(Unqual!T == dchar))
return cast(T)swapEndian(cast(uint)val);
else
static assert(0, T.stringof ~ " unsupported by swapEndian.");
@@ -2207,7 +2207,7 @@ private ulong swapEndianImpl(ulong val) @trusted pure nothrow @nogc
unittest
{
import std.meta;
- foreach(T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar))
+ foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar))
{
scope(failure) writefln("Failed type: %s", T.stringof);
T val;
@@ -2220,22 +2220,22 @@ unittest
assert(swapEndian(swapEndian(T.min)) == T.min);
assert(swapEndian(swapEndian(T.max)) == T.max);
- foreach(i; 2 .. 10)
+ foreach (i; 2 .. 10)
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(swapEndian(swapEndian(maxI)) == maxI);
- static if(isSigned!T)
+ static if (isSigned!T)
assert(swapEndian(swapEndian(minI)) == minI);
}
- static if(isSigned!T)
+ static if (isSigned!T)
assert(swapEndian(swapEndian(cast(T)0)) == 0);
// used to trigger BUG6354
- static if(T.sizeof > 1 && isUnsigned!T)
+ static if (T.sizeof > 1 && isUnsigned!T)
{
T left = 0xffU;
left <<= (T.sizeof - 1) * 8;
@@ -2254,14 +2254,14 @@ unittest
private union EndianSwapper(T)
- if(canSwapEndianness!T)
+ if (canSwapEndianness!T)
{
Unqual!T value;
ubyte[T.sizeof] array;
- static if(is(FloatingPointTypeOf!T == float))
+ static if (is(FloatingPointTypeOf!T == float))
uint intValue;
- else static if(is(FloatingPointTypeOf!T == double))
+ else static if (is(FloatingPointTypeOf!T == double))
ulong intValue;
}
@@ -2281,7 +2281,7 @@ private union EndianSwapper(T)
unusable if you tried to transfer it to another machine).
+/
auto nativeToBigEndian(T)(T val) @safe pure nothrow @nogc
- if(canSwapEndianness!T)
+ if (canSwapEndianness!T)
{
return nativeToBigEndianImpl(val);
}
@@ -2299,7 +2299,7 @@ unittest
}
private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
- if(isIntegral!T || isSomeChar!T || isBoolean!T)
+ if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
EndianSwapper!T es = void;
@@ -2312,7 +2312,7 @@ private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
}
private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
- if(isFloatOrDouble!T)
+ if (isFloatOrDouble!T)
{
version(LittleEndian)
return floatEndianImpl!(T, true)(val);
@@ -2323,7 +2323,7 @@ private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
unittest
{
import std.meta;
- foreach(T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
+ foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
char, wchar, dchar
/* The trouble here is with floats and doubles being compared against nan
* using a bit compare. There are two kinds of nans, quiet and signaling.
@@ -2348,28 +2348,28 @@ unittest
assert(bigEndianToNative!T(nativeToBigEndian(T.min)) == T.min);
assert(bigEndianToNative!T(nativeToBigEndian(T.max)) == T.max);
- static if(isSigned!T)
+ static if (isSigned!T)
assert(bigEndianToNative!T(nativeToBigEndian(cast(T)0)) == 0);
- static if(!is(T == bool))
+ static if (!is(T == bool))
{
- foreach(i; [2, 4, 6, 7, 9, 11])
+ foreach (i; [2, 4, 6, 7, 9, 11])
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(bigEndianToNative!T(nativeToBigEndian(maxI)) == maxI);
- static if(T.sizeof > 1)
+ static if (T.sizeof > 1)
assert(nativeToBigEndian(maxI) != nativeToLittleEndian(maxI));
else
assert(nativeToBigEndian(maxI) == nativeToLittleEndian(maxI));
- static if(isSigned!T)
+ static if (isSigned!T)
{
assert(bigEndianToNative!T(nativeToBigEndian(minI)) == minI);
- static if(T.sizeof > 1)
+ static if (T.sizeof > 1)
assert(nativeToBigEndian(minI) != nativeToLittleEndian(minI));
else
assert(nativeToBigEndian(minI) == nativeToLittleEndian(minI));
@@ -2377,12 +2377,12 @@ unittest
}
}
- static if(isUnsigned!T || T.sizeof == 1 || is(T == wchar))
+ static if (isUnsigned!T || T.sizeof == 1 || is(T == wchar))
assert(nativeToBigEndian(T.max) == nativeToLittleEndian(T.max));
else
assert(nativeToBigEndian(T.max) != nativeToLittleEndian(T.max));
- static if(isUnsigned!T || T.sizeof == 1 || isSomeChar!T)
+ static if (isUnsigned!T || T.sizeof == 1 || isSomeChar!T)
assert(nativeToBigEndian(T.min) == nativeToLittleEndian(T.min));
else
assert(nativeToBigEndian(T.min) != nativeToLittleEndian(T.min));
@@ -2403,7 +2403,7 @@ unittest
can't actually have swapped floating point values as floating point values).
+/
T bigEndianToNative(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if(canSwapEndianness!T && n == T.sizeof)
+ if (canSwapEndianness!T && n == T.sizeof)
{
return bigEndianToNativeImpl!(T, n)(val);
}
@@ -2421,7 +2421,7 @@ unittest
}
private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if((isIntegral!T || isSomeChar!T || isBoolean!T) &&
+ if ((isIntegral!T || isSomeChar!T || isBoolean!T) &&
n == T.sizeof)
{
EndianSwapper!T es = void;
@@ -2436,7 +2436,7 @@ private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @n
}
private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if(isFloatOrDouble!T && n == T.sizeof)
+ if (isFloatOrDouble!T && n == T.sizeof)
{
version(LittleEndian)
return cast(T) floatEndianImpl!(n, true)(val);
@@ -2455,7 +2455,7 @@ private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @n
can't actually have swapped floating point values as floating point values).
+/
auto nativeToLittleEndian(T)(T val) @safe pure nothrow @nogc
- if(canSwapEndianness!T)
+ if (canSwapEndianness!T)
{
return nativeToLittleEndianImpl(val);
}
@@ -2473,7 +2473,7 @@ unittest
}
private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
- if(isIntegral!T || isSomeChar!T || isBoolean!T)
+ if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
EndianSwapper!T es = void;
@@ -2486,7 +2486,7 @@ private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
}
private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
- if(isFloatOrDouble!T)
+ if (isFloatOrDouble!T)
{
version(BigEndian)
return floatEndianImpl!(T, true)(val);
@@ -2497,7 +2497,7 @@ private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
unittest
{
import std.meta;
- foreach(T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
+ foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
char, wchar, dchar/*,
float, double*/))
{
@@ -2513,19 +2513,19 @@ unittest
assert(littleEndianToNative!T(nativeToLittleEndian(T.min)) == T.min);
assert(littleEndianToNative!T(nativeToLittleEndian(T.max)) == T.max);
- static if(isSigned!T)
+ static if (isSigned!T)
assert(littleEndianToNative!T(nativeToLittleEndian(cast(T)0)) == 0);
- static if(!is(T == bool))
+ static if (!is(T == bool))
{
- foreach(i; 2 .. 10)
+ foreach (i; 2 .. 10)
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(littleEndianToNative!T(nativeToLittleEndian(maxI)) == maxI);
- static if(isSigned!T)
+ static if (isSigned!T)
assert(littleEndianToNative!T(nativeToLittleEndian(minI)) == minI);
}
}
@@ -2550,7 +2550,7 @@ unittest
unusable if you tried to transfer it to another machine).
+/
T littleEndianToNative(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if(canSwapEndianness!T && n == T.sizeof)
+ if (canSwapEndianness!T && n == T.sizeof)
{
return littleEndianToNativeImpl!T(val);
}
@@ -2568,7 +2568,7 @@ unittest
}
private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if((isIntegral!T || isSomeChar!T || isBoolean!T) &&
+ if ((isIntegral!T || isSomeChar!T || isBoolean!T) &&
n == T.sizeof)
{
EndianSwapper!T es = void;
@@ -2583,7 +2583,7 @@ private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow
}
private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
- if(((isFloatOrDouble!T) &&
+ if (((isFloatOrDouble!T) &&
n == T.sizeof))
{
version(BigEndian)
@@ -2593,26 +2593,26 @@ private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow
}
private auto floatEndianImpl(T, bool swap)(T val) @safe pure nothrow @nogc
- if(isFloatOrDouble!T)
+ if (isFloatOrDouble!T)
{
EndianSwapper!T es = void;
es.value = val;
- static if(swap)
+ static if (swap)
es.intValue = swapEndian(es.intValue);
return es.array;
}
private auto floatEndianImpl(size_t n, bool swap)(ubyte[n] val) @safe pure nothrow @nogc
- if(n == 4 || n == 8)
+ if (n == 4 || n == 8)
{
- static if(n == 4) EndianSwapper!float es = void;
- else static if(n == 8) EndianSwapper!double es = void;
+ static if (n == 4) EndianSwapper!float es = void;
+ else static if (n == 8) EndianSwapper!double es = void;
es.array = val;
- static if(swap)
+ static if (swap)
es.intValue = swapEndian(es.intValue);
return es.value;
@@ -2627,7 +2627,7 @@ private template isFloatOrDouble(T)
unittest
{
import std.meta;
- foreach(T; AliasSeq!(float, double))
+ foreach (T; AliasSeq!(float, double))
{
static assert(isFloatOrDouble!(T));
static assert(isFloatOrDouble!(const T));
@@ -2656,7 +2656,7 @@ private template canSwapEndianness(T)
unittest
{
import std.meta;
- foreach(T; AliasSeq!(bool, ubyte, byte, ushort, short, uint, int, ulong,
+ foreach (T; AliasSeq!(bool, ubyte, byte, ushort, short, uint, int, ulong,
long, char, wchar, dchar, float, double))
{
static assert(canSwapEndianness!(T));
@@ -2668,7 +2668,7 @@ unittest
}
//!
- foreach(T; AliasSeq!(real, string, wstring, dstring))
+ foreach (T; AliasSeq!(real, string, wstring, dstring))
{
static assert(!canSwapEndianness!(T));
static assert(!canSwapEndianness!(const T));
@@ -2699,7 +2699,7 @@ T peek(T, Endian endianness = Endian.bigEndian, R)(R range)
isForwardRange!R &&
is(ElementType!R : const ubyte))
{
- static if(hasSlicing!R)
+ static if (hasSlicing!R)
const ubyte[T.sizeof] bytes = range[0 .. T.sizeof];
else
{
@@ -2707,14 +2707,14 @@ T peek(T, Endian endianness = Endian.bigEndian, R)(R range)
//Make sure that range is not consumed, even if it's a class.
range = range.save;
- foreach(ref e; bytes)
+ foreach (ref e; bytes)
{
e = range.front;
range.popFront();
}
}
- static if(endianness == Endian.bigEndian)
+ static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
@@ -2722,7 +2722,7 @@ T peek(T, Endian endianness = Endian.bigEndian, R)(R range)
/++ Ditto +/
T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t index)
- if(canSwapEndianness!T &&
+ if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : const ubyte))
@@ -2732,7 +2732,7 @@ T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t index)
/++ Ditto +/
T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t* index)
- if(canSwapEndianness!T &&
+ if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : const ubyte))
@@ -2744,7 +2744,7 @@ T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t* index)
const ubyte[T.sizeof] bytes = range[begin .. end];
*index = end;
- static if(endianness == Endian.bigEndian)
+ static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
@@ -2997,9 +2997,9 @@ unittest
range = The range to read from.
+/
T read(T, Endian endianness = Endian.bigEndian, R)(ref R range)
- if(canSwapEndianness!T && isInputRange!R && is(ElementType!R : const ubyte))
+ if (canSwapEndianness!T && isInputRange!R && is(ElementType!R : const ubyte))
{
- static if(hasSlicing!R)
+ static if (hasSlicing!R)
{
const ubyte[T.sizeof] bytes = range[0 .. T.sizeof];
range.popFrontN(T.sizeof);
@@ -3008,14 +3008,14 @@ T read(T, Endian endianness = Endian.bigEndian, R)(ref R range)
{
ubyte[T.sizeof] bytes;
- foreach(ref e; bytes)
+ foreach (ref e; bytes)
{
e = range.front;
range.popFront();
}
}
- static if(endianness == Endian.bigEndian)
+ static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
@@ -3242,7 +3242,7 @@ unittest
is updated to the index after the bytes read.
+/
void write(T, Endian endianness = Endian.bigEndian, R)(R range, T value, size_t index)
- if(canSwapEndianness!T &&
+ if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : ubyte))
@@ -3252,14 +3252,14 @@ void write(T, Endian endianness = Endian.bigEndian, R)(R range, T value, size_t
/++ Ditto +/
void write(T, Endian endianness = Endian.bigEndian, R)(R range, T value, size_t* index)
- if(canSwapEndianness!T &&
+ if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : ubyte))
{
assert(index);
- static if(endianness == Endian.bigEndian)
+ static if (endianness == Endian.bigEndian)
immutable bytes = nativeToBigEndian!T(value);
else
immutable bytes = nativeToLittleEndian!T(value);
@@ -3586,9 +3586,9 @@ unittest
value = The value to _append.
+/
void append(T, Endian endianness = Endian.bigEndian, R)(R range, T value)
- if(canSwapEndianness!T && isOutputRange!(R, ubyte))
+ if (canSwapEndianness!T && isOutputRange!(R, ubyte))
{
- static if(endianness == Endian.bigEndian)
+ static if (endianness == Endian.bigEndian)
immutable bytes = nativeToBigEndian!T(value);
else
immutable bytes = nativeToLittleEndian!T(value);
@@ -3747,7 +3747,7 @@ unittest
import std.format : format;
import std.array;
import std.meta;
- foreach(endianness; AliasSeq!(Endian.bigEndian, Endian.littleEndian))
+ foreach (endianness; AliasSeq!(Endian.bigEndian, Endian.littleEndian))
{
auto toWrite = appender!(ubyte[])();
alias Types = AliasSeq!(uint, int, long, ulong, short, ubyte, ushort, byte, uint);
@@ -3756,7 +3756,7 @@ unittest
size_t index = 0;
size_t length = 0;
- foreach(T; Types)
+ foreach (T; Types)
{
toWrite.append!(T, endianness)(cast(T)values[index++]);
length += T.sizeof;
@@ -3766,7 +3766,7 @@ unittest
assert(toRead.length == length);
index = 0;
- foreach(T; Types)
+ foreach (T; Types)
{
assert(toRead.peek!(T, endianness)() == values[index], format("Failed Index: %s", index));
assert(toRead.peek!(T, endianness)(0) == values[index], format("Failed Index: %s", index));
diff --git a/std/concurrency.d b/std/concurrency.d
index 88b5e8074..dec82d834 100644
--- a/std/concurrency.d
+++ b/std/concurrency.d
@@ -85,7 +85,7 @@ private
template hasLocalAliasing(T...)
{
- static if( !T.length )
+ static if ( !T.length )
enum hasLocalAliasing = false;
else
enum hasLocalAliasing = (std.traits.hasUnsharedAliasing!(T[0]) && !is(T[0] == Tid)) ||
@@ -105,20 +105,20 @@ private
Variant data;
this(T...)( MsgType t, T vals )
- if( T.length < 1 )
+ if ( T.length < 1 )
{
static assert( false, "messages must contain at least one item" );
}
this(T...)( MsgType t, T vals )
- if( T.length == 1 )
+ if ( T.length == 1 )
{
type = t;
data = vals[0];
}
this(T...)( MsgType t, T vals )
- if( T.length > 1 )
+ if ( T.length > 1 )
{
type = t;
data = Tuple!(T)( vals );
@@ -126,7 +126,7 @@ private
@property auto convertsTo(T...)()
{
- static if( T.length == 1 )
+ static if ( T.length == 1 )
return is( T[0] == Variant ) ||
data.convertsTo!(T);
else
@@ -135,9 +135,9 @@ private
@property auto get(T...)()
{
- static if( T.length == 1 )
+ static if ( T.length == 1 )
{
- static if( is( T[0] == Variant ) )
+ static if ( is( T[0] == Variant ) )
return data;
else
return data.get!(T);
@@ -152,9 +152,9 @@ private
{
alias Args = Parameters!(Op);
- static if( Args.length == 1 )
+ static if ( Args.length == 1 )
{
- static if( is( Args[0] == Variant ) )
+ static if ( is( Args[0] == Variant ) )
return op( data );
else
return op( data.get!(Args) );
@@ -168,19 +168,19 @@ private
void checkops(T...)( T ops )
{
- foreach( i, t1; T )
+ foreach ( i, t1; T )
{
static assert( isFunctionPointer!t1 || isDelegate!t1 );
alias a1 = Parameters!(t1);
alias r1 = ReturnType!(t1);
- static if( i < T.length - 1 && is( r1 == void ) )
+ static if ( i < T.length - 1 && is( r1 == void ) )
{
static assert( a1.length != 1 || !is( a1[0] == Variant ),
"function with arguments " ~ a1.stringof ~
" occludes successive function" );
- foreach( t2; T[i+1 .. $] )
+ foreach ( t2; T[i+1 .. $] )
{
static assert( isFunctionPointer!t2 || isDelegate!t2 );
alias a2 = Parameters!(t2);
@@ -195,7 +195,7 @@ private
@property ref ThreadInfo thisInfo()
{
- if( scheduler is null )
+ if ( scheduler is null )
return ThreadInfo.thisInfo;
return scheduler.thisInfo;
}
@@ -359,7 +359,7 @@ unittest
// TODO: remove when concurrency is safe
auto trus = delegate() @trusted
{
- if( thisInfo.ident != Tid.init )
+ if ( thisInfo.ident != Tid.init )
return thisInfo.ident;
thisInfo.ident = Tid( new MessageBox );
return thisInfo.ident;
@@ -529,7 +529,7 @@ private Tid _spawn(F, T...)( bool linked, F fn, T args )
}
// TODO: MessageList and &exec should be shared.
- if( scheduler !is null )
+ if ( scheduler !is null )
scheduler.spawn( &exec );
else
{
@@ -727,7 +727,7 @@ unittest
private template receiveOnlyRet(T...)
{
- static if( T.length == 1 )
+ static if ( T.length == 1 )
alias receiveOnlyRet = T[0];
else
alias receiveOnlyRet = Tuple!(T);
@@ -774,7 +774,7 @@ body
thisInfo.ident.mbox.get(
( T val )
{
- static if( T.length )
+ static if ( T.length )
ret.field = val;
},
( LinkTerminated e )
@@ -796,7 +796,7 @@ body
format("Unexpected message type: expected '%s', got '%s'",
exp, val.type.toString()));
} );
- static if( T.length == 1 )
+ static if ( T.length == 1 )
return ret[0];
else
return ret;
@@ -924,7 +924,7 @@ private
*/
void setMaxMailboxSize( Tid tid, size_t messages, OnCrowding doThis )
{
- final switch( doThis )
+ final switch ( doThis )
{
case OnCrowding.block:
return tid.mbox.setMaxMsgs( messages, &onCrowdingBlock );
@@ -981,9 +981,9 @@ private void unregisterMe()
{
synchronized( registryLock )
{
- if( auto allNames = me in namesByTid )
+ if ( auto allNames = me in namesByTid )
{
- foreach( name; *allNames )
+ foreach ( name; *allNames )
tidByName.remove( name );
namesByTid.remove( me );
}
@@ -1011,9 +1011,9 @@ bool register( string name, Tid tid )
{
synchronized( registryLock )
{
- if( name in tidByName )
+ if ( name in tidByName )
return false;
- if( tid.mbox.isClosed )
+ if ( tid.mbox.isClosed )
return false;
namesByTid[tid] ~= name;
tidByName[name] = tid;
@@ -1035,7 +1035,7 @@ bool unregister( string name )
{
synchronized( registryLock )
{
- if( auto tid = name in tidByName )
+ if ( auto tid = name in tidByName )
{
auto allNames = *tid in namesByTid;
auto pos = countUntil( *allNames, name );
@@ -1061,7 +1061,7 @@ Tid locate( string name )
{
synchronized( registryLock )
{
- if( auto tid = name in tidByName )
+ if ( auto tid = name in tidByName )
return *tid;
return Tid.init;
}
@@ -1109,11 +1109,11 @@ struct ThreadInfo
*/
void cleanup()
{
- if( ident.mbox !is null )
+ if ( ident.mbox !is null )
ident.mbox.close();
- foreach( tid; links.keys )
+ foreach ( tid; links.keys )
_send( MsgType.linkDead, tid, ident );
- if( owner != Tid.init )
+ if ( owner != Tid.init )
_send( MsgType.linkDead, owner, ident );
unregisterMe(); // clean up registry entries
}
@@ -1324,7 +1324,7 @@ class FiberScheduler :
// NOTE: It's possible that we should test whether the calling Fiber
// is an InfoFiber before yielding, but I think it's reasonable
// that any (non-Generator) fiber should yield here.
- if(Fiber.getThis())
+ if (Fiber.getThis())
Fiber.yield();
}
@@ -1340,7 +1340,7 @@ class FiberScheduler :
{
auto f = cast(InfoFiber) Fiber.getThis();
- if( f !is null )
+ if ( f !is null )
return f.info;
return ThreadInfo.thisInfo;
}
@@ -1381,7 +1381,7 @@ private:
{
scope(exit) notified = false;
- while( !notified )
+ while ( !notified )
switchContext();
}
@@ -1428,17 +1428,17 @@ private:
{
import std.algorithm : remove;
- while( m_fibers.length > 0 )
+ while ( m_fibers.length > 0 )
{
auto t = m_fibers[m_pos].call( Fiber.Rethrow.no );
if (t !is null && !(cast(OwnerTerminated) t))
throw t;
- if( m_fibers[m_pos].state == Fiber.State.TERM )
+ if ( m_fibers[m_pos].state == Fiber.State.TERM )
{
- if( m_pos >= (m_fibers = remove( m_fibers, m_pos )).length )
+ if ( m_pos >= (m_fibers = remove( m_fibers, m_pos )).length )
m_pos = 0;
}
- else if( m_pos++ >= m_fibers.length - 1 )
+ else if ( m_pos++ >= m_fibers.length - 1 )
{
m_pos = 0;
}
@@ -1794,7 +1794,7 @@ private
m_lock = new Mutex;
m_closed = false;
- if( scheduler is null )
+ if ( scheduler is null )
{
m_putMsg = new Condition( m_lock );
m_notFull = new Condition( m_lock );
@@ -1856,23 +1856,23 @@ private
{
// TODO: Generate an error here if m_closed is true, or maybe
// put a message in the caller's queue?
- if( !m_closed )
+ if ( !m_closed )
{
- while( true )
+ while ( true )
{
- if( isPriorityMsg( msg ) )
+ if ( isPriorityMsg( msg ) )
{
m_sharedPty.put( msg );
m_putMsg.notify();
return;
}
- if( !mboxFull() || isControlMsg( msg ) )
+ if ( !mboxFull() || isControlMsg( msg ) )
{
m_sharedBox.put( msg );
m_putMsg.notify();
return;
}
- if( m_onMaxMsgs !is null && !m_onMaxMsgs( thisTid ) )
+ if ( m_onMaxMsgs !is null && !m_onMaxMsgs( thisTid ) )
{
return;
}
@@ -1905,7 +1905,7 @@ private
{
static assert( T.length );
- static if( isImplicitlyConvertible!(T[0], Duration) )
+ static if ( isImplicitlyConvertible!(T[0], Duration) )
{
alias Ops = AliasSeq!(T[1 .. $]);
alias ops = vals[1 .. $];
@@ -1921,14 +1921,14 @@ private
bool onStandardMsg( ref Message msg )
{
- foreach( i, t; Ops )
+ foreach ( i, t; Ops )
{
alias Args = Parameters!(t);
auto op = ops[i];
- if( msg.convertsTo!(Args) )
+ if ( msg.convertsTo!(Args) )
{
- static if( is( ReturnType!(t) == bool ) )
+ static if ( is( ReturnType!(t) == bool ) )
{
return msg.map( op );
}
@@ -1947,26 +1947,26 @@ private
assert( msg.convertsTo!(Tid) );
auto tid = msg.get!(Tid);
- if( bool* pDepends = (tid in thisInfo.links) )
+ if ( bool* pDepends = (tid in thisInfo.links) )
{
auto depends = *pDepends;
thisInfo.links.remove( tid );
// Give the owner relationship precedence.
- if( depends && tid != thisInfo.owner )
+ if ( depends && tid != thisInfo.owner )
{
auto e = new LinkTerminated( tid );
auto m = Message( MsgType.standard, e );
- if( onStandardMsg( m ) )
+ if ( onStandardMsg( m ) )
return true;
throw e;
}
}
- if( tid == thisInfo.owner )
+ if ( tid == thisInfo.owner )
{
thisInfo.owner = Tid.init;
auto e = new OwnerTerminated( tid );
auto m = Message( MsgType.standard, e );
- if( onStandardMsg( m ) )
+ if ( onStandardMsg( m ) )
return true;
throw e;
}
@@ -1975,7 +1975,7 @@ private
bool onControlMsg( ref Message msg )
{
- switch( msg.type )
+ switch ( msg.type )
{
case MsgType.linkDead:
return onLinkDeadMsg( msg );
@@ -1992,9 +1992,9 @@ private
// we can be certain that the message was handled.
scope(failure) list.removeAt( range );
- if( isControlMsg( range.front ) )
+ if ( isControlMsg( range.front ) )
{
- if( onControlMsg( range.front ) )
+ if ( onControlMsg( range.front ) )
{
// Although the linkDead message is a control message,
// it can be handled by the user. Since the linkDead
@@ -2002,7 +2002,7 @@ private
// it has been handled and we can return from receive.
// This is a weird special case that will have to be
// handled in a more general way if more are added.
- if( !isLinkDeadMsg( range.front ) )
+ if ( !isLinkDeadMsg( range.front ) )
{
list.removeAt( range );
continue;
@@ -2015,7 +2015,7 @@ private
}
else
{
- if( onStandardMsg( range.front ) )
+ if ( onStandardMsg( range.front ) )
{
list.removeAt( range );
return true;
@@ -2030,35 +2030,35 @@ private
bool pty( ref ListT list )
{
- if( !list.empty )
+ if ( !list.empty )
{
auto range = list[];
- if( onStandardMsg( range.front ) )
+ if ( onStandardMsg( range.front ) )
{
list.removeAt( range );
return true;
}
- if( range.front.convertsTo!(Throwable) )
+ if ( range.front.convertsTo!(Throwable) )
throw range.front.get!(Throwable);
- else if( range.front.convertsTo!(shared(Throwable)) )
+ else if ( range.front.convertsTo!(shared(Throwable)) )
throw range.front.get!(shared(Throwable));
else throw new PriorityMessageException( range.front.data );
}
return false;
}
- static if( timedWait )
+ static if ( timedWait )
{
import core.time;
auto limit = MonoTime.currTime + period;
}
- while( true )
+ while ( true )
{
ListT arrived;
- if( pty( m_localPty ) ||
+ if ( pty( m_localPty ) ||
scan( m_localBox ) )
{
return true;
@@ -2067,7 +2067,7 @@ private
synchronized( m_lock )
{
updateMsgCount();
- while( m_sharedPty.empty && m_sharedBox.empty )
+ while ( m_sharedPty.empty && m_sharedBox.empty )
{
// NOTE: We're notifying all waiters here instead of just
// a few because the onCrowding behavior may have
@@ -2075,11 +2075,11 @@ private
// unnecessarily if the new behavior is not to block.
// This will admittedly result in spurious wakeups
// in other situations, but what can you do?
- if( m_putQueue && !mboxFull() )
+ if ( m_putQueue && !mboxFull() )
m_notFull.notifyAll();
- static if( timedWait )
+ static if ( timedWait )
{
- if( period <= Duration.zero || !m_putMsg.wait( period ) )
+ if ( period <= Duration.zero || !m_putMsg.wait( period ) )
return false;
}
else
@@ -2090,14 +2090,14 @@ private
m_localPty.put( m_sharedPty );
arrived.put( m_sharedBox );
}
- if( m_localPty.empty )
+ if ( m_localPty.empty )
{
scope(exit) m_localBox.put( arrived );
- if( scan( arrived ) )
+ if ( scan( arrived ) )
return true;
else
{
- static if( timedWait )
+ static if ( timedWait )
{
period = limit - MonoTime.currTime;
}
@@ -2124,7 +2124,7 @@ private
auto tid = msg.get!(Tid);
thisInfo.links.remove( tid );
- if( tid == thisInfo.owner )
+ if ( tid == thisInfo.owner )
thisInfo.owner = Tid.init;
}
@@ -2132,7 +2132,7 @@ private
{
for( auto range = list[]; !range.empty; range.popFront() )
{
- if( range.front.type == MsgType.linkDead )
+ if ( range.front.type == MsgType.linkDead )
onLinkDeadMsg( range.front );
}
}
@@ -2292,10 +2292,10 @@ private
*/
void put( ref List!(T) rhs )
{
- if( !rhs.empty )
+ if ( !rhs.empty )
{
put( rhs.m_first );
- while( m_last.next !is null )
+ while ( m_last.next !is null )
{
m_last = m_last.next;
m_count++;
@@ -2325,9 +2325,9 @@ private
Node* n = r.m_prev;
enforce( n && n.next, "attempting to remove invalid list node" );
- if( m_last is m_first )
+ if ( m_last is m_first )
m_last = null;
- else if( m_last is n.next )
+ else if ( m_last is n.next )
m_last = n;
Node* to_free = n.next;
n.next = n.next.next;
@@ -2425,7 +2425,7 @@ private
void put( Node* n )
{
m_count++;
- if( !empty )
+ if ( !empty )
{
m_last.next = n;
m_last = n;
@@ -2462,7 +2462,7 @@ version( unittest )
receive( (Variant val) {} );
receive( (string val)
{
- if( "the quick brown fox" != val )
+ if ( "the quick brown fox" != val )
return false;
return true;
},
diff --git a/std/container/binaryheap.d b/std/container/binaryheap.d
index 8cf14e154..901d111dc 100644
--- a/std/container/binaryheap.d
+++ b/std/container/binaryheap.d
@@ -62,7 +62,7 @@ if (isRandomAccessRange!(Store) || isRandomAccessRange!(typeof(Store.init[])))
import std.algorithm : move, min, HeapOps, swapAt;
import std.typecons : RefCounted, RefCountedAutoInitialize;
- static if(isRandomAccessRange!Store)
+ static if (isRandomAccessRange!Store)
alias Range = Store;
else
alias Range = typeof(Store.init[]);
diff --git a/std/container/rbtree.d b/std/container/rbtree.d
index 9b0347efe..cbfc38e40 100644
--- a/std/container/rbtree.d
+++ b/std/container/rbtree.d
@@ -144,7 +144,7 @@ struct RBNode(V)
@property Node left(Node newNode)
{
_left = newNode;
- if(newNode !is null)
+ if (newNode !is null)
newNode._parent = &this;
return newNode;
}
@@ -158,7 +158,7 @@ struct RBNode(V)
@property Node right(Node newNode)
{
_right = newNode;
- if(newNode !is null)
+ if (newNode !is null)
newNode._parent = &this;
return newNode;
}
@@ -191,7 +191,7 @@ struct RBNode(V)
body
{
// sets _left._parent also
- if(isLeftNode)
+ if (isLeftNode)
parent.left = _left;
else
parent.right = _left;
@@ -234,7 +234,7 @@ struct RBNode(V)
body
{
// sets _right._parent also
- if(isLeftNode)
+ if (isLeftNode)
parent.left = _right;
else
parent.right = _right;
@@ -276,24 +276,24 @@ struct RBNode(V)
void setColor(Node end)
{
// test against the marker node
- if(_parent !is end)
+ if (_parent !is end)
{
- if(_parent.color == Color.Red)
+ if (_parent.color == Color.Red)
{
Node cur = &this;
- while(true)
+ while (true)
{
// because root is always black, _parent._parent always exists
- if(cur._parent.isLeftNode)
+ if (cur._parent.isLeftNode)
{
// parent is left node, y is 'uncle', could be null
Node y = cur._parent._parent._right;
- if(y !is null && y.color == Color.Red)
+ if (y !is null && y.color == Color.Red)
{
cur._parent.color = Color.Black;
y.color = Color.Black;
cur = cur._parent._parent;
- if(cur._parent is end)
+ if (cur._parent is end)
{
// root node
cur.color = Color.Black;
@@ -303,14 +303,14 @@ struct RBNode(V)
{
// not root node
cur.color = Color.Red;
- if(cur._parent.color == Color.Black)
+ if (cur._parent.color == Color.Black)
// satisfied, exit the loop
break;
}
}
else
{
- if(!cur.isLeftNode)
+ if (!cur.isLeftNode)
cur = cur._parent.rotateL();
cur._parent.color = Color.Black;
cur = cur._parent._parent.rotateR();
@@ -323,12 +323,12 @@ struct RBNode(V)
{
// parent is right node, y is 'uncle'
Node y = cur._parent._parent._left;
- if(y !is null && y.color == Color.Red)
+ if (y !is null && y.color == Color.Red)
{
cur._parent.color = Color.Black;
y.color = Color.Black;
cur = cur._parent._parent;
- if(cur._parent is end)
+ if (cur._parent is end)
{
// root node
cur.color = Color.Black;
@@ -338,14 +338,14 @@ struct RBNode(V)
{
// not root node
cur.color = Color.Red;
- if(cur._parent.color == Color.Black)
+ if (cur._parent.color == Color.Black)
// satisfied, exit the loop
break;
}
}
else
{
- if(cur.isLeftNode)
+ if (cur.isLeftNode)
cur = cur._parent.rotateR();
cur._parent.color = Color.Black;
cur = cur._parent._parent.rotateL();
@@ -403,7 +403,7 @@ struct RBNode(V)
//
// replace y's structure with structure of this node.
//
- if(isLeftNode)
+ if (isLeftNode)
_parent.left = y;
else
_parent.right = y;
@@ -411,7 +411,7 @@ struct RBNode(V)
// need special case so y doesn't point back to itself
//
y.left = _left;
- if(_right is y)
+ if (_right is y)
y.right = &this;
else
y.right = _right;
@@ -422,9 +422,9 @@ struct RBNode(V)
//
left = yl;
right = yr;
- if(_parent !is y)
+ if (_parent !is y)
{
- if(isyleft)
+ if (isyleft)
yp.left = &this;
else
yp.right = &this;
@@ -433,34 +433,34 @@ struct RBNode(V)
}
// if this has less than 2 children, remove it
- if(_left !is null)
+ if (_left !is null)
x = _left;
else
x = _right;
bool deferedUnlink = false;
- if(x is null)
+ if (x is null)
{
// pretend this is a null node, defer unlinking the node
x = &this;
deferedUnlink = true;
}
- else if(isLeftNode)
+ else if (isLeftNode)
_parent.left = x;
else
_parent.right = x;
// if the color of this is black, then it needs to be fixed
- if(color == color.Black)
+ if (color == color.Black)
{
// need to recolor the tree.
- while(x._parent !is end && x.color == Node.Color.Black)
+ while (x._parent !is end && x.color == Node.Color.Black)
{
- if(x.isLeftNode)
+ if (x.isLeftNode)
{
// left node
Node w = x._parent._right;
- if(w.color == Node.Color.Red)
+ if (w.color == Node.Color.Red)
{
w.color = Node.Color.Black;
x._parent.color = Node.Color.Red;
@@ -469,7 +469,7 @@ struct RBNode(V)
}
Node wl = w.left;
Node wr = w.right;
- if((wl is null || wl.color == Node.Color.Black) &&
+ if ((wl is null || wl.color == Node.Color.Black) &&
(wr is null || wr.color == Node.Color.Black))
{
w.color = Node.Color.Red;
@@ -477,7 +477,7 @@ struct RBNode(V)
}
else
{
- if(wr is null || wr.color == Node.Color.Black)
+ if (wr is null || wr.color == Node.Color.Black)
{
// wl cannot be null here
wl.color = Node.Color.Black;
@@ -497,7 +497,7 @@ struct RBNode(V)
{
// right node
Node w = x._parent._left;
- if(w.color == Node.Color.Red)
+ if (w.color == Node.Color.Red)
{
w.color = Node.Color.Black;
x._parent.color = Node.Color.Red;
@@ -506,7 +506,7 @@ struct RBNode(V)
}
Node wl = w.left;
Node wr = w.right;
- if((wl is null || wl.color == Node.Color.Black) &&
+ if ((wl is null || wl.color == Node.Color.Black) &&
(wr is null || wr.color == Node.Color.Black))
{
w.color = Node.Color.Red;
@@ -514,7 +514,7 @@ struct RBNode(V)
}
else
{
- if(wl is null || wl.color == Node.Color.Black)
+ if (wl is null || wl.color == Node.Color.Black)
{
// wr cannot be null here
wr.color = Node.Color.Black;
@@ -534,12 +534,12 @@ struct RBNode(V)
x.color = Node.Color.Black;
}
- if(deferedUnlink)
+ if (deferedUnlink)
{
//
// unlink this node from the tree
//
- if(isLeftNode)
+ if (isLeftNode)
_parent.left = null;
else
_parent.right = null;
@@ -557,7 +557,7 @@ struct RBNode(V)
@property inout(RBNode)* leftmost() inout
{
inout(RBNode)* result = &this;
- while(result._left !is null)
+ while (result._left !is null)
result = result._left;
return result;
}
@@ -568,7 +568,7 @@ struct RBNode(V)
@property inout(RBNode)* rightmost() inout
{
inout(RBNode)* result = &this;
- while(result._right !is null)
+ while (result._right !is null)
result = result._right;
return result;
}
@@ -582,9 +582,9 @@ struct RBNode(V)
@property inout(RBNode)* next() inout
{
inout(RBNode)* n = &this;
- if(n.right is null)
+ if (n.right is null)
{
- while(!n.isLeftNode)
+ while (!n.isLeftNode)
n = n._parent;
return n._parent;
}
@@ -601,9 +601,9 @@ struct RBNode(V)
@property inout(RBNode)* prev() inout
{
inout(RBNode)* n = &this;
- if(n.left is null)
+ if (n.left is null)
{
- while(n.isLeftNode)
+ while (n.isLeftNode)
n = n._parent;
return n._parent;
}
@@ -621,9 +621,9 @@ struct RBNode(V)
//
Node copy = alloc(value);
copy.color = color;
- if(_left !is null)
+ if (_left !is null)
copy.left = _left.dup(alloc);
- if(_right !is null)
+ if (_right !is null)
copy.right = _right.dup(alloc);
return copy;
}
@@ -633,9 +633,9 @@ struct RBNode(V)
Node copy = new RBNode!V;
copy.value = value;
copy.color = color;
- if(_left !is null)
+ if (_left !is null)
copy.left = _left.dup();
- if(_right !is null)
+ if (_right !is null)
copy.right = _right.dup();
return copy;
}
@@ -739,7 +739,7 @@ private struct RBRange(N)
* inserted after all existing duplicate elements.
*/
final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
- if(is(typeof(binaryFun!less(T.init, T.init))))
+ if (is(typeof(binaryFun!less(T.init, T.init))))
{
import std.meta : allSatisfy;
import std.range.primitives;
@@ -750,7 +750,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
version(unittest)
{
- static if(is(typeof(less) == string))
+ static if (is(typeof(less) == string))
{
private enum doUnittest = isIntegral!T && (less == "a < b" || less == "a > b");
}
@@ -760,11 +760,11 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
// note, this must be final so it does not affect the vtable layout
final bool arrayEqual(T[] arr)
{
- if(walkLength(this[]) == arr.length)
+ if (walkLength(this[]) == arr.length)
{
- foreach(v; arr)
+ foreach (v; arr)
{
- if(!(v in this))
+ if (!(v in this))
return false;
}
return true;
@@ -815,7 +815,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
alias ConstRange = RBRange!(const(RBNode)*); /// Ditto
alias ImmutableRange = RBRange!(immutable(RBNode)*); /// Ditto
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
import std.range.primitives;
@@ -823,7 +823,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
assert(ts.length == 5);
auto r = ts[];
- static if(less == "a < b")
+ static if (less == "a < b")
auto vals = [1, 2, 3, 4, 5];
else
auto vals = [5, 4, 3, 2, 1];
@@ -844,15 +844,15 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
// find a node based on an element value
private inout(RBNode)* _find(Elem e) inout
{
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
inout(RBNode)* cur = _end.left;
inout(RBNode)* result = null;
- while(cur)
+ while (cur)
{
- if(_less(cur.value, e))
+ if (_less(cur.value, e))
cur = cur.right;
- else if(_less(e, cur.value))
+ else if (_less(e, cur.value))
cur = cur.left;
else
{
@@ -866,11 +866,11 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
else
{
inout(RBNode)* cur = _end.left;
- while(cur)
+ while (cur)
{
- if(_less(cur.value, e))
+ if (_less(cur.value, e))
cur = cur.right;
- else if(_less(e, cur.value))
+ else if (_less(e, cur.value))
cur = cur.left;
else
return cur;
@@ -884,10 +884,10 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
private auto _add(Elem n)
{
Node result;
- static if(!allowDuplicates)
+ static if (!allowDuplicates)
bool added = true;
- if(!_end.left)
+ if (!_end.left)
{
_end.left = _begin = result = allocate(n);
}
@@ -895,12 +895,12 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
{
Node newParent = _end.left;
Node nxt = void;
- while(true)
+ while (true)
{
- if(_less(n, newParent.value))
+ if (_less(n, newParent.value))
{
nxt = newParent.left;
- if(nxt is null)
+ if (nxt is null)
{
//
// add to right of new parent
@@ -911,9 +911,9 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
}
else
{
- static if(!allowDuplicates)
+ static if (!allowDuplicates)
{
- if(!_less(newParent.value, n))
+ if (!_less(newParent.value, n))
{
result = newParent;
added = false;
@@ -921,7 +921,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
}
}
nxt = newParent.right;
- if(nxt is null)
+ if (nxt is null)
{
//
// add to right of new parent
@@ -932,11 +932,11 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
}
newParent = nxt;
}
- if(_begin.left)
+ if (_begin.left)
_begin = _begin.left;
}
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
result.setColor(_end);
debug(RBDoChecks)
@@ -948,7 +948,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
{
import std.typecons : Tuple;
- if(added)
+ if (added)
{
++_length;
result.setColor(_end);
@@ -990,7 +990,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
return new RedBlackTree(_end.dup(), _length);
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
auto ts = new RedBlackTree(1, 2, 3, 4, 5);
@@ -1056,7 +1056,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
return _find(e) !is null;
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto ts = new RedBlackTree(1, 2, 3, 4, 5);
assert(cast(Elem)3 in ts);
@@ -1084,7 +1084,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
(thisRange, thatRange);
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto t1 = new RedBlackTree(1,2,3,4);
auto t2 = new RedBlackTree(1,2,3,4);
@@ -1111,7 +1111,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
_length = 0;
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto ts = new RedBlackTree(1,2,3,4,5);
assert(ts.length == 5);
@@ -1129,7 +1129,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
*/
size_t stableInsert(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, Elem))
{
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
_add(stuff);
return 1;
@@ -1148,12 +1148,12 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
*
* Complexity: $(BIGOH m * log(n))
*/
- size_t stableInsert(Stuff)(Stuff stuff) if(isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem))
+ size_t stableInsert(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem))
{
size_t result = 0;
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
- foreach(e; stuff)
+ foreach (e; stuff)
{
++result;
_add(e);
@@ -1161,9 +1161,9 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
}
else
{
- foreach(e; stuff)
+ foreach (e; stuff)
{
- if(_add(e).added)
+ if (_add(e).added)
++result;
}
}
@@ -1173,10 +1173,10 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
/// ditto
alias insert = stableInsert;
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto ts = new RedBlackTree(2,1,3,4,5,2,5);
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
assert(ts.length == 7);
assert(ts.stableInsert(cast(Elem[])[7, 8, 6, 9, 10, 8]) == 6);
@@ -1184,7 +1184,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
assert(ts.stableInsert(cast(Elem)11) == 1 && ts.length == 14);
assert(ts.stableInsert(cast(Elem)7) == 1 && ts.length == 15);
- static if(less == "a < b")
+ static if (less == "a < b")
assert(ts.arrayEqual([1,2,2,3,4,5,5,6,7,7,8,8,9,10,11]));
else
assert(ts.arrayEqual([11,10,9,8,8,7,7,6,5,5,4,3,2,2,1]));
@@ -1197,7 +1197,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
assert(ts.stableInsert(cast(Elem)11) == 1 && ts.length == 11);
assert(ts.stableInsert(cast(Elem)7) == 0 && ts.length == 11);
- static if(less == "a < b")
+ static if (less == "a < b")
assert(ts.arrayEqual([1,2,3,4,5,6,7,8,9,10,11]));
else
assert(ts.arrayEqual([11,10,9,8,7,6,5,4,3,2,1]));
@@ -1221,15 +1221,15 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
return result;
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto ts = new RedBlackTree(1,2,3,4,5);
assert(ts.length == 5);
auto x = ts.removeAny();
assert(ts.length == 4);
Elem[] arr;
- foreach(Elem i; 1..6)
- if(i != x) arr ~= i;
+ foreach (Elem i; 1..6)
+ if (i != x) arr ~= i;
assert(ts.arrayEqual(arr));
}
@@ -1257,7 +1257,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
scope(success)
--_length;
auto lastnode = _end.prev;
- if(lastnode is _begin)
+ if (lastnode is _begin)
_begin = _begin.remove(_end);
else
lastnode.remove(_end);
@@ -1265,14 +1265,14 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
check();
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
auto ts = new RedBlackTree(1,2,3,4,5);
assert(ts.length == 5);
ts.removeBack();
assert(ts.length == 4);
- static if(less == "a < b")
+ static if (less == "a < b")
assert(ts.arrayEqual([1,2,3,4]));
else
assert(ts.arrayEqual([2,3,4,5]));
@@ -1294,9 +1294,9 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
{
auto b = r._begin;
auto e = r._end;
- if(_begin is b)
+ if (_begin is b)
_begin = e;
- while(b !is e)
+ while (b !is e)
{
b = b.remove(_end);
--_length;
@@ -1306,7 +1306,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
return Range(e, _end);
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
auto ts = new RedBlackTree(1,2,3,4,5);
@@ -1319,7 +1319,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
assert(ts.length == 2);
assert(ts.arrayEqual([1,5]));
- static if(less == "a < b")
+ static if (less == "a < b")
assert(equal(r2, [5]));
else
assert(equal(r2, [1]));
@@ -1339,20 +1339,20 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
immutable isBegin = (r.source._begin is _begin);
auto b = r.source._begin;
- while(!r.empty)
+ while (!r.empty)
{
r.popFront();
b = b.remove(_end);
--_length;
}
- if(isBegin)
+ if (isBegin)
_begin = b;
return Range(b, _end);
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
import std.range : take;
@@ -1362,7 +1362,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
assert(ts.length == 5);
auto r2 = ts.remove(take(r, 0));
- static if(less == "a < b")
+ static if (less == "a < b")
{
assert(equal(r2, [2,3,4,5]));
auto r3 = ts.remove(take(r, 2));
@@ -1398,11 +1398,11 @@ assert(equal(rbt[], [5]));
--------------------
+/
size_t removeKey(U...)(U elems)
- if(allSatisfy!(isImplicitlyConvertibleToElem, U))
+ if (allSatisfy!(isImplicitlyConvertibleToElem, U))
{
Elem[U.length] toRemove;
- foreach(i, e; elems)
+ foreach (i, e; elems)
toRemove[i] = e;
return removeKey(toRemove[]);
@@ -1410,19 +1410,19 @@ assert(equal(rbt[], [5]));
/++ Ditto +/
size_t removeKey(U)(U[] elems)
- if(isImplicitlyConvertible!(U, Elem))
+ if (isImplicitlyConvertible!(U, Elem))
{
immutable lenBefore = length;
- foreach(e; elems)
+ foreach (e; elems)
{
auto beg = _firstGreaterEqual(e);
- if(beg is _end || _less(e, beg.value))
+ if (beg is _end || _less(e, beg.value))
// no values are equal
continue;
immutable isBegin = (beg is _begin);
beg = beg.remove(_end);
- if(isBegin)
+ if (isBegin)
_begin = beg;
--_length;
}
@@ -1432,7 +1432,7 @@ assert(equal(rbt[], [5]));
/++ Ditto +/
size_t removeKey(Stuff)(Stuff stuff)
- if(isInputRange!Stuff &&
+ if (isInputRange!Stuff &&
isImplicitlyConvertible!(ElementType!Stuff, Elem) &&
!isDynamicArray!Stuff)
{
@@ -1448,7 +1448,7 @@ assert(equal(rbt[], [5]));
enum isImplicitlyConvertibleToElem = isImplicitlyConvertible!(U, Elem);
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
import std.range : take;
@@ -1457,7 +1457,7 @@ assert(equal(rbt[], [5]));
//The cast(Elem) is because these tests are instantiated with a variety
//of numeric types, and the literals are all int, which is not always
//implicitly convertible to Elem (e.g. short).
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
assert(rbt.length == 11);
assert(rbt.removeKey(cast(Elem)4) == 1 && rbt.length == 10);
@@ -1469,7 +1469,7 @@ assert(equal(rbt[], [5]));
assert(rbt.removeKey(cast(Elem)(42)) == 0 && rbt.length == 7);
assert(rbt.removeKey(take(rbt[], 3)) == 3 && rbt.length == 4);
- static if(less == "a < b")
+ static if (less == "a < b")
assert(equal(rbt[], [7,7,19,45]));
else
assert(equal(rbt[], [7,5,3,2]));
@@ -1486,7 +1486,7 @@ assert(equal(rbt[], [5]));
assert(rbt.removeKey(cast(Elem)(42)) == 0 && rbt.length == 5);
assert(rbt.removeKey(take(rbt[], 3)) == 3 && rbt.length == 2);
- static if(less == "a < b")
+ static if (less == "a < b")
assert(equal(rbt[], [19,45]));
else
assert(equal(rbt[], [5,3]));
@@ -1499,9 +1499,9 @@ assert(equal(rbt[], [5]));
// can't use _find, because we cannot return null
auto cur = _end.left;
inout(RBNode)* result = _end;
- while(cur)
+ while (cur)
{
- if(_less(e, cur.value))
+ if (_less(e, cur.value))
{
result = cur;
cur = cur.left;
@@ -1518,9 +1518,9 @@ assert(equal(rbt[], [5]));
// can't use _find, because we cannot return null.
auto cur = _end.left;
inout(RBNode)* result = _end;
- while(cur)
+ while (cur)
{
- if(_less(cur.value, e))
+ if (_less(cur.value, e))
cur = cur.right;
else
{
@@ -1588,10 +1588,10 @@ assert(equal(rbt[], [5]));
{
auto beg = _firstGreaterEqual(e);
alias RangeType = RBRange!(typeof(beg));
- if(beg is _end || _less(e, beg.value))
+ if (beg is _end || _less(e, beg.value))
// no values are equal
return RangeType(beg, beg);
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
return RangeType(beg, _firstGreater(e));
}
@@ -1603,7 +1603,7 @@ assert(equal(rbt[], [5]));
}
}
- static if(doUnittest) unittest
+ static if (doUnittest) unittest
{
import std.algorithm : equal;
auto ts = new RedBlackTree(1, 2, 3, 4, 5);
@@ -1611,7 +1611,7 @@ assert(equal(rbt[], [5]));
auto ru = ts.upperBound(3);
auto re = ts.equalRange(3);
- static if(less == "a < b")
+ static if (less == "a < b")
{
assert(equal(rl, [1,2]));
assert(equal(ru, [4,5]));
@@ -1635,7 +1635,7 @@ assert(equal(rbt[], [5]));
void printTree(Node n, int indent = 0)
{
import std.stdio;
- if(n !is null)
+ if (n !is null)
{
printTree(n.right, indent + 2);
for(int i = 0; i < indent; i++)
@@ -1649,7 +1649,7 @@ assert(equal(rbt[], [5]));
write(".");
writeln("N");
}
- if(indent is 0)
+ if (indent is 0)
writeln();
}
@@ -1665,31 +1665,31 @@ assert(equal(rbt[], [5]));
int recurse(Node n, string path)
{
import std.stdio;
- if(n is null)
+ if (n is null)
return 1;
- if(n.parent.left !is n && n.parent.right !is n)
+ if (n.parent.left !is n && n.parent.right !is n)
throw new Exception("Node at path " ~ path ~ " has inconsistent pointers");
Node next = n.next;
- static if(allowDuplicates)
+ static if (allowDuplicates)
{
- if(next !is _end && _less(next.value, n.value))
+ if (next !is _end && _less(next.value, n.value))
throw new Exception("ordering invalid at path " ~ path);
}
else
{
- if(next !is _end && !_less(n.value, next.value))
+ if (next !is _end && !_less(n.value, next.value))
throw new Exception("ordering invalid at path " ~ path);
}
- if(n.color == n.color.Red)
+ if (n.color == n.color.Red)
{
- if((n.left !is null && n.left.color == n.color.Red) ||
+ if ((n.left !is null && n.left.color == n.color.Red) ||
(n.right !is null && n.right.color == n.color.Red))
throw new Exception("Node at path " ~ path ~ " is red with a red child");
}
int l = recurse(n.left, path ~ "L");
int r = recurse(n.right, path ~ "R");
- if(l != r)
+ if (l != r)
{
writeln("bad tree at:");
debug printTree(n);
@@ -1838,14 +1838,14 @@ auto redBlackTree(bool allowDuplicates, E)(E[] elems...)
/++ Ditto +/
auto redBlackTree(alias less, E)(E[] elems...)
- if(is(typeof(binaryFun!less(E.init, E.init))))
+ if (is(typeof(binaryFun!less(E.init, E.init))))
{
return new RedBlackTree!(E, less)(elems);
}
/++ Ditto +/
auto redBlackTree(alias less, bool allowDuplicates, E)(E[] elems...)
- if(is(typeof(binaryFun!less(E.init, E.init))))
+ if (is(typeof(binaryFun!less(E.init, E.init))))
{
//We shouldn't need to instantiate less here, but for some reason,
//dmd can't handle it if we don't (even though the template which
@@ -1873,7 +1873,7 @@ if (isInputRange!Stuff && !isArray!(Stuff))
/++ Ditto +/
auto redBlackTree(alias less, Stuff)(Stuff range)
-if( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init)))
+if ( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init)))
&& isInputRange!Stuff && !isArray!(Stuff))
{
return new RedBlackTree!(ElementType!Stuff, less)(range);
@@ -1881,7 +1881,7 @@ if( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init)
/++ Ditto +/
auto redBlackTree(alias less, bool allowDuplicates, Stuff)(Stuff range)
- if( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init)))
+ if ( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init)))
&& isInputRange!Stuff && !isArray!(Stuff))
{
//We shouldn't need to instantiate less here, but for some reason,
diff --git a/std/container/util.d b/std/container/util.d
index 6e6d4a0fe..89191059d 100644
--- a/std/container/util.d
+++ b/std/container/util.d
@@ -35,7 +35,7 @@ if (is(T == struct) || is(T == class))
// to a null reference. We therefore construct an empty container
// by passing an empty array to its constructor.
// Issue #13872.
- static if(arguments.length == 0)
+ static if (arguments.length == 0)
{
import std.range;
alias ET = ElementType!(T.Range);
@@ -106,13 +106,13 @@ unittest
* Convenience function for constructing a generic container.
*/
template make(alias Container, Args...)
- if(!is(Container))
+ if (!is(Container))
{
import std.range : isInputRange;
import std.traits : isDynamicArray;
auto make(Range)(Range range)
- if(!isDynamicArray!Range && isInputRange!Range)
+ if (!isDynamicArray!Range && isInputRange!Range)
{
import std.range : ElementType;
return .make!(Container!(ElementType!Range, Args))(range);
diff --git a/std/conv.d b/std/conv.d
index 0a98bbd76..291f7d1b1 100644
--- a/std/conv.d
+++ b/std/conv.d
@@ -885,7 +885,7 @@ T toImpl(T, S)(S value)
{
static if (isSwitchable!(OriginalType!S) && EnumMembers!S.length <= 50)
{
- switch(value)
+ switch (value)
{
foreach (member; NoDuplicates!(EnumMembers!S))
{
@@ -1252,7 +1252,7 @@ body
}
import std.array;
- switch(radix)
+ switch (radix)
{
case 10:
// The (value+0) is so integral promotions happen to the type
@@ -2454,10 +2454,10 @@ Target parse(Target, Source)(ref Source p)
bool isHex = false;
bool startsWithZero = p.front == '0';
- if(startsWithZero)
+ if (startsWithZero)
{
p.popFront();
- if(p.empty)
+ if (p.empty)
{
return (sign) ? -0.0 : 0.0;
}
@@ -2621,19 +2621,19 @@ Target parse(Target, Source)(ref Source p)
//Have to shift one more time
//and do rounding
- if((msdec & 0xFFE0_0000_0000_0000) != 0)
+ if ((msdec & 0xFFE0_0000_0000_0000) != 0)
{
auto roundUp = (msdec & 0x1);
msdec = ((cast(ulong)msdec) >> 1);
e2++;
- if(roundUp)
+ if (roundUp)
{
msdec += 1;
//If mantissa was 0b1111... and we added +1
//the mantissa should be 0b10000 (think of implicit bit)
//and the exponent increased
- if((msdec & 0x0020_0000_0000_0000) != 0)
+ if ((msdec & 0x0020_0000_0000_0000) != 0)
{
msdec = 0x0010_0000_0000_0000;
e2++;
@@ -2884,7 +2884,7 @@ unittest
//Tests for the double implementation
unittest
{
- static if(real.mant_dig == 53)
+ static if (real.mant_dig == 53)
{
import core.stdc.stdlib, std.exception, std.math;
@@ -2962,11 +2962,11 @@ unittest
errno = 0; // In case it was set by another unittest in a different module.
struct longdouble
{
- static if(real.mant_dig == 64)
+ static if (real.mant_dig == 64)
{
ushort[5] value;
}
- else static if(real.mant_dig == 53)
+ else static if (real.mant_dig == 53)
{
ushort[4] value;
}
@@ -2980,9 +2980,9 @@ unittest
longdouble x1;
int i;
- static if(real.mant_dig == 64)
+ static if (real.mant_dig == 64)
enum s = "0x1.FFFFFFFFFFFFFFFEp-16382";
- else static if(real.mant_dig == 53)
+ else static if (real.mant_dig == 53)
enum s = "0x1.FFFFFFFFFFFFFFFEp-1000";
else
static assert(false, "Floating point format for real not supported");
@@ -2992,7 +2992,7 @@ unittest
assert(s2.empty);
x = *cast(longdouble *)&ld;
- static if(real.mant_dig == 64)
+ static if (real.mant_dig == 64)
{
version (CRuntime_Microsoft)
ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod
@@ -3704,15 +3704,15 @@ See_Also:
$(LREF parse) for parsing octal strings at runtime.
*/
template octal(string num)
- if(isOctalLiteral(num))
+ if (isOctalLiteral(num))
{
- static if((octalFitsInInt!num && !literalIsLong!num) && !literalIsUnsigned!num)
+ static if ((octalFitsInInt!num && !literalIsLong!num) && !literalIsUnsigned!num)
enum octal = octal!int(num);
- else static if((!octalFitsInInt!num || literalIsLong!num) && !literalIsUnsigned!num)
+ else static if ((!octalFitsInInt!num || literalIsLong!num) && !literalIsUnsigned!num)
enum octal = octal!long(num);
- else static if((octalFitsInInt!num && !literalIsLong!num) && literalIsUnsigned!num)
+ else static if ((octalFitsInInt!num && !literalIsLong!num) && literalIsUnsigned!num)
enum octal = octal!uint(num);
- else static if((!octalFitsInInt!(num) || literalIsLong!(num)) && literalIsUnsigned!(num))
+ else static if ((!octalFitsInInt!(num) || literalIsLong!(num)) && literalIsUnsigned!(num))
enum octal = octal!ulong(num);
else
static assert(false);
@@ -4884,7 +4884,7 @@ unittest //http://forum.dlang.org/post/nxbdgtdlmwscocbiypjs@forum.dlang.org
{
invariant()
{
- if(j == 0)
+ if (j == 0)
assert(a.i.isNaN(), "why is 'j' zero?? and i is not NaN?");
else
assert(!a.i.isNaN());
@@ -5199,28 +5199,28 @@ unittest
unittest
{
- foreach(T; AliasSeq!(byte, ubyte))
+ foreach (T; AliasSeq!(byte, ubyte))
{
static assert(is(typeof(unsigned(cast(T)1)) == ubyte));
static assert(is(typeof(unsigned(cast(const T)1)) == ubyte));
static assert(is(typeof(unsigned(cast(immutable T)1)) == ubyte));
}
- foreach(T; AliasSeq!(short, ushort))
+ foreach (T; AliasSeq!(short, ushort))
{
static assert(is(typeof(unsigned(cast(T)1)) == ushort));
static assert(is(typeof(unsigned(cast(const T)1)) == ushort));
static assert(is(typeof(unsigned(cast(immutable T)1)) == ushort));
}
- foreach(T; AliasSeq!(int, uint))
+ foreach (T; AliasSeq!(int, uint))
{
static assert(is(typeof(unsigned(cast(T)1)) == uint));
static assert(is(typeof(unsigned(cast(const T)1)) == uint));
static assert(is(typeof(unsigned(cast(immutable T)1)) == uint));
}
- foreach(T; AliasSeq!(long, ulong))
+ foreach (T; AliasSeq!(long, ulong))
{
static assert(is(typeof(unsigned(cast(T)1)) == ulong));
static assert(is(typeof(unsigned(cast(const T)1)) == ulong));
@@ -5237,7 +5237,7 @@ auto unsigned(T)(T x) if (isSomeChar!T)
unittest
{
- foreach(T; AliasSeq!(char, wchar, dchar))
+ foreach (T; AliasSeq!(char, wchar, dchar))
{
static assert(is(typeof(unsigned(cast(T)'A')) == T));
static assert(is(typeof(unsigned(cast(const T)'A')) == T));
@@ -5273,28 +5273,28 @@ unittest
unittest
{
- foreach(T; AliasSeq!(byte, ubyte))
+ foreach (T; AliasSeq!(byte, ubyte))
{
static assert(is(typeof(signed(cast(T)1)) == byte));
static assert(is(typeof(signed(cast(const T)1)) == byte));
static assert(is(typeof(signed(cast(immutable T)1)) == byte));
}
- foreach(T; AliasSeq!(short, ushort))
+ foreach (T; AliasSeq!(short, ushort))
{
static assert(is(typeof(signed(cast(T)1)) == short));
static assert(is(typeof(signed(cast(const T)1)) == short));
static assert(is(typeof(signed(cast(immutable T)1)) == short));
}
- foreach(T; AliasSeq!(int, uint))
+ foreach (T; AliasSeq!(int, uint))
{
static assert(is(typeof(signed(cast(T)1)) == int));
static assert(is(typeof(signed(cast(const T)1)) == int));
static assert(is(typeof(signed(cast(immutable T)1)) == int));
}
- foreach(T; AliasSeq!(long, ulong))
+ foreach (T; AliasSeq!(long, ulong))
{
static assert(is(typeof(signed(cast(T)1)) == long));
static assert(is(typeof(signed(cast(const T)1)) == long));
@@ -5395,7 +5395,7 @@ private bool isHexLiteral(String)(in String hexData)
import std.ascii : isHexDigit;
import std.uni : lineSep, paraSep, nelSep;
size_t i;
- foreach(const dchar c; hexData)
+ foreach (const dchar c; hexData)
{
switch (c)
{
@@ -5543,7 +5543,7 @@ private auto hexStrImpl(String)(String hexData)
result.length = hexData.length / 2;
size_t cnt;
ubyte v;
- foreach(c; hexData)
+ foreach (c; hexData)
{
if (c.isHexDigit)
{
diff --git a/std/cstream.d b/std/cstream.d
index 2bd161bdf..cf0e61d6a 100644
--- a/std/cstream.d
+++ b/std/cstream.d
@@ -204,7 +204,7 @@ class CFile : Stream {
file.writeLine("That was blank");
file.position = 0;
char[][] lines;
- foreach(char[] line; file) {
+ foreach (char[] line; file) {
lines ~= line.dup;
}
assert( lines.length == 5 );
@@ -214,7 +214,7 @@ class CFile : Stream {
assert( lines[3] == "That was blank");
file.position = 0;
lines = new char[][5];
- foreach(ulong n, char[] line; file) {
+ foreach (ulong n, char[] line; file) {
lines[cast(size_t)(n-1)] = line.dup;
}
assert( lines[0] == "Testing stream.d:");
diff --git a/std/csv.d b/std/csv.d
index 5bfe59974..d280b89fb 100644
--- a/std/csv.d
+++ b/std/csv.d
@@ -34,7 +34,7 @@
* {
* auto text = "Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n";
*
- * foreach(record; csvReader!(Tuple!(string, string, int))(text))
+ * foreach (record; csvReader!(Tuple!(string, string, int))(text))
* {
* writefln("%s works as a %s and earns $%d per year",
* record[0], record[1], record[2]);
@@ -43,7 +43,7 @@
* // To read the same string from the file "filename.csv":
*
* auto file = File("filename.csv", "r");
- * foreach(record;
+ * foreach (record;
* file.byLine.joiner("\n").csvReader!(Tuple!(string, string, int)))
* {
* writefln("%s works as a %s and earns $%d per year",
@@ -60,7 +60,7 @@
* auto text = "Name,Occupation,Salary\r"
* "Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n";
*
- * foreach(record; csvReader!(string[string])
+ * foreach (record; csvReader!(string[string])
* (text, null))
* {
* writefln("%s works as a %s and earns $%s per year.",
@@ -252,7 +252,7 @@ enum Malformed
* int[] ans = [76,26,22];
* auto records = csvReader!int(str);
*
- * foreach(record; records)
+ * foreach (record; records)
* {
* assert(equal(record, ans));
* }
@@ -271,7 +271,7 @@ enum Malformed
*
* auto records = csvReader!Layout(str,';');
*
- * foreach(record; records)
+ * foreach (record; records)
* {
* writeln(record.name);
* writeln(record.value);
@@ -334,7 +334,7 @@ auto csvReader(Contents = string,Malformed ErrorLevel = Malformed.throwException
* auto records = csvReader!int(str, ["b"]);
*
* auto ans = [[65],[123]];
- * foreach(record; records)
+ * foreach (record; records)
* {
* assert(equal(record, ans.front));
* ans.popFront();
@@ -431,9 +431,9 @@ auto csvReader(Contents = string,
auto records = csvReader(str);
int count;
- foreach(record; records)
+ foreach (record; records)
{
- foreach(cell; record)
+ foreach (cell; record)
{
count++;
}
@@ -472,7 +472,7 @@ auto csvReader(Contents = string,
auto records = csvReader!(Layout,Malformed.ignore)(str);
int count;
- foreach(record; records)
+ foreach (record; records)
{
assert(ans[count].name == record.name);
assert(ans[count].value == record.value);
@@ -495,10 +495,10 @@ auto csvReader(Contents = string,
"one\ntwo,2\nthree,3",
"one,1\ntwo\nthree,3"];
- foreach(str; strs)
+ foreach (str; strs)
{
auto records = csvReader!A(str);
- assertThrown!CSVException((){foreach(record; records) { }}());
+ assertThrown!CSVException((){foreach (record; records) { }}());
}
}
@@ -527,7 +527,7 @@ auto csvReader(Contents = string,
auto records = csvReader!Layout(str);
int count;
- foreach(record; records)
+ foreach (record; records)
{
assert(ans[count].name == record.name);
assert(ans[count].value == record.value);
@@ -545,7 +545,7 @@ auto csvReader(Contents = string,
int[] ans = [76,26,22];
auto records = csvReader!int(str);
- foreach(record; records)
+ foreach (record; records)
{
assert(equal(record, ans));
}
@@ -595,7 +595,7 @@ unittest
auto records = csvReader!int(str, ["b"]);
auto ans = [[65],[123]];
- foreach(record; records)
+ foreach (record; records)
{
assert(equal(record, ans.front));
ans.popFront();
@@ -614,7 +614,7 @@ unittest
(str, ["b","a"], ',', '"');
auto ans2 = [["Hello","65"],["World","123"]];
- foreach(record; records2) {
+ foreach (record; records2) {
assert(equal(record, ans2.front));
ans2.popFront();
}
@@ -624,7 +624,7 @@ unittest
(str, ["a","b","c","d"], ',', '"');
ans2 = [["Joe","Carpenter"],["Fred","Fly"]];
- foreach(record; records2) {
+ foreach (record; records2) {
assert(equal(record, ans2.front));
ans2.popFront();
}
@@ -643,9 +643,9 @@ unittest
@safe pure unittest
{
string str = "one \"quoted\"";
- foreach(record; csvReader!(string,Malformed.ignore)(str))
+ foreach (record; csvReader!(string,Malformed.ignore)(str))
{
- foreach(cell; record)
+ foreach (cell; record)
{
assert(cell == "one \"quoted\"");
}
@@ -656,7 +656,7 @@ unittest
{
string a,b;
}
- foreach(record; csvReader!(Ans,Malformed.ignore)(str))
+ foreach (record; csvReader!(Ans,Malformed.ignore)(str))
{
assert(record.a == "one \"quoted\"");
assert(record.b == "two \"quoted\" end");
@@ -670,7 +670,7 @@ unittest
try
{
- foreach(record; csvReader(str))
+ foreach (record; csvReader(str))
{}
assert(0);
}
@@ -703,7 +703,7 @@ unittest
auto records = csvReader!(string[string])(str,["3","1"],'❁');
int count;
- foreach(record; records)
+ foreach (record; records)
{
count++;
assert(record["1"] == "34");
@@ -743,11 +743,11 @@ unittest
auto ir = InputRange("Name,Occupation,Salary\r"d~
"Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n"d);
- foreach(record; csvReader(ir, cast(string[])null))
- foreach(cell; record) {}
- foreach(record; csvReader!(Tuple!(string, string, int))
+ foreach (record; csvReader(ir, cast(string[])null))
+ foreach (cell; record) {}
+ foreach (record; csvReader!(Tuple!(string, string, int))
(ir,cast(string[])null)) {}
- foreach(record; csvReader!(string[string])
+ foreach (record; csvReader!(string[string])
(ir,cast(string[])null)) {}
}
@@ -826,7 +826,7 @@ public:
* auto records = CsvReader!(int,Malformed.ignore,string,char,string[])
* (str, ';', '^');
*
- * foreach(record; records) {
+ * foreach (record; records) {
* assert(equal(record, ans));
* }
* -------
@@ -850,7 +850,7 @@ public:
* (str, ["high","low"], ';', '^');
*
* int[] ans = [76,22];
- * foreach(record; records) {
+ * foreach (record; records) {
* assert(equal(record, ans));
* }
* -------
@@ -867,7 +867,7 @@ public:
_quote = quote;
size_t[string] colToIndex;
- foreach(h; colHeaders)
+ foreach (h; colHeaders)
{
colToIndex[h] = size_t.max;
}
@@ -876,7 +876,7 @@ public:
(_input, _separator, _quote, indices);
size_t colIndex;
- foreach(col; r)
+ foreach (col; r)
{
header ~= col;
auto ptr = col in colToIndex;
@@ -889,7 +889,7 @@ public:
indices.length = colToIndex.length;
int i;
- foreach(h; colHeaders)
+ foreach (h; colHeaders)
{
immutable index = colToIndex[h];
static if (ErrorLevel != Malformed.ignore)
@@ -983,7 +983,7 @@ public:
*/
void popFront()
{
- while(!recordRange.empty)
+ while (!recordRange.empty)
{
recordRange.popFront();
}
@@ -1063,7 +1063,7 @@ public:
scope(exit) colIndex++;
if (indices.length > 0)
{
- foreach(ti, ToType; Fields!(Contents))
+ foreach (ti, ToType; Fields!(Contents))
{
if (indices[ti] == colIndex)
{
@@ -1074,7 +1074,7 @@ public:
}
else
{
- foreach(ti, ToType; Fields!(Contents))
+ foreach (ti, ToType; Fields!(Contents))
{
if (ti == colIndex)
{
@@ -1104,7 +1104,7 @@ public:
auto records = CsvReader!(int,Malformed.ignore,string,char,string[])
(str, ';', '^');
- foreach(record; records)
+ foreach (record; records)
{
assert(equal(record, ans));
}
@@ -1118,7 +1118,7 @@ pure unittest
Joe, Joker, 99\r";
bool pass = true;
auto r = csvReader(failData);
- try foreach(entry; r){}
+ try foreach (entry; r){}
catch pass = false;
assert(pass);
}
@@ -1161,7 +1161,7 @@ public:
// to eliminate so many tokens. This calculates
// how many will be skipped to get to the next header column
size_t normalizer;
- foreach(ref c; _popCount) {
+ foreach (ref c; _popCount) {
static if (ErrorLevel == Malformed.ignore)
{
// If we are not throwing exceptions
@@ -1228,7 +1228,7 @@ public:
import std.format : format;
// Skip last of record when header is depleted.
if (_popCount.ptr && _popCount.empty)
- while(!recordEnd())
+ while (!recordEnd())
{
prime(1);
}
@@ -1270,7 +1270,7 @@ public:
*/
private void prime(size_t skipNum)
{
- foreach(i; 0..skipNum)
+ foreach (i; 0..skipNum)
{
_input.col++;
_front.shrinkTo(0);
@@ -1315,7 +1315,7 @@ public:
_popCount.popFront();
if (skipNum == size_t.max) {
- while(!recordEnd())
+ while (!recordEnd())
prime(1);
_empty = true;
return;
@@ -1379,7 +1379,7 @@ void csvNextToken(Range, Malformed ErrorLevel = Malformed.throwException,
input.popFront();
}
- while(!input.empty)
+ while (!input.empty)
{
assert(!(quoted && escQuote));
if (!quoted)
diff --git a/std/datetime.d b/std/datetime.d
index 57b1b352e..fbbbd5d65 100644
--- a/std/datetime.d
+++ b/std/datetime.d
@@ -350,7 +350,7 @@ public:
assert(abs(norm1 - norm2) <= seconds(2));
import std.meta : AliasSeq;
- foreach(ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
+ foreach (ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
{
scope(failure) writefln("ClockType.%s", ct);
auto value1 = Clock.currTime!ct;
@@ -375,7 +375,7 @@ public:
+/
static @property long currStdTime(ClockType clockType = ClockType.normal)() @trusted
{
- static if(clockType != ClockType.coarse &&
+ static if (clockType != ClockType.coarse &&
clockType != ClockType.normal &&
clockType != ClockType.precise &&
clockType != ClockType.second)
@@ -389,7 +389,7 @@ public:
FILETIME fileTime;
GetSystemTimeAsFileTime(&fileTime);
immutable result = FILETIMEToStdTime(&fileTime);
- static if(clockType == ClockType.second)
+ static if (clockType == ClockType.second)
{
// Ideally, this would use core.std.time.time, but the C runtime
// has to be using unix time for that to work, and that's not
@@ -407,12 +407,12 @@ public:
version(OSX)
{
- static if(clockType == ClockType.second)
+ static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
timeval tv;
- if(gettimeofday(&tv, null) != 0)
+ if (gettimeofday(&tv, null) != 0)
throw new TimeException("Call to gettimeofday() failed");
return convert!("seconds", "hnsecs")(tv.tv_sec) +
convert!("usecs", "hnsecs")(tv.tv_usec) +
@@ -421,17 +421,17 @@ public:
}
else version(linux)
{
- static if(clockType == ClockType.second)
+ static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.linux.time;
- static if(clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_COARSE;
- else static if(clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
- else static if(clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
+ static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_COARSE;
+ else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
+ else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
else static assert(0, "Previous static if is wrong.");
timespec ts;
- if(clock_gettime(clockArg, &ts) != 0)
+ if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
@@ -441,13 +441,13 @@ public:
else version(FreeBSD)
{
import core.sys.freebsd.time;
- static if(clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_FAST;
- else static if(clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
- else static if(clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME_PRECISE;
- else static if(clockType == ClockType.second) alias clockArg = CLOCK_SECOND;
+ static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_FAST;
+ else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
+ else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME_PRECISE;
+ else static if (clockType == ClockType.second) alias clockArg = CLOCK_SECOND;
else static assert(0, "Previous static if is wrong.");
timespec ts;
- if(clock_gettime(clockArg, &ts) != 0)
+ if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
@@ -455,12 +455,12 @@ public:
}
else version(NetBSD)
{
- static if(clockType == ClockType.second)
+ static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
timeval tv;
- if(gettimeofday(&tv, null) != 0)
+ if (gettimeofday(&tv, null) != 0)
throw new TimeException("Call to gettimeofday() failed");
return convert!("seconds", "hnsecs")(tv.tv_sec) +
convert!("usecs", "hnsecs")(tv.tv_usec) +
@@ -469,17 +469,17 @@ public:
}
else version(Solaris)
{
- static if(clockType == ClockType.second)
+ static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.solaris.time;
- static if(clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME;
- else static if(clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
- else static if(clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
+ static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME;
+ else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
+ else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
else static assert(0, "Previous static if is wrong.");
timespec ts;
- if(clock_gettime(clockArg, &ts) != 0)
+ if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
@@ -503,7 +503,7 @@ public:
assert(abs(norm1 - norm2) <= limit);
import std.meta : AliasSeq;
- foreach(ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
+ foreach (ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
{
scope(failure) writefln("ClockType.%s", ct);
auto value1 = Clock.currStdTime!ct;
@@ -889,9 +889,9 @@ public:
format("Given stdTime: %s", stdTime));
}
- foreach(stdTime; [-1234567890L, -250, 0, 250, 1235657390L])
+ foreach (stdTime; [-1234567890L, -250, 0, 250, 1235657390L])
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
test(stdTime, tz);
}
}
@@ -959,11 +959,11 @@ public:
assert(st1 == st2);
}
- foreach(tz1; testTZs)
+ foreach (tz1; testTZs)
{
- foreach(tz2; testTZs)
+ foreach (tz2; testTZs)
{
- foreach(dt; chain(testDateTimesBC, testDateTimesAD))
+ foreach (dt; chain(testDateTimesBC, testDateTimesAD))
test(dt, tz1, tz2);
}
}
@@ -996,9 +996,9 @@ public:
+/
int opCmp(in SysTime rhs) @safe const pure nothrow
{
- if(_stdTime < rhs._stdTime)
+ if (_stdTime < rhs._stdTime)
return -1;
- if(_stdTime > rhs._stdTime)
+ if (_stdTime > rhs._stdTime)
return 1;
return 0;
@@ -1027,9 +1027,9 @@ public:
auto sts = array(map!SysTime(chain(testDateTimesBC, testDateTimesAD)));
- foreach(st; sts)
- foreach(tz1; testTZs)
- foreach(tz2; testTZs)
+ foreach (st; sts)
+ foreach (tz1; testTZs)
+ foreach (tz2; testTZs)
testEqual(st, tz1, tz2);
static void testCmp(SysTime st1,
@@ -1043,10 +1043,10 @@ public:
assert(st2.opCmp(st1) > 0);
}
- foreach(si, st1; sts)
- foreach(st2; sts[si+1 .. $])
- foreach(tz1; testTZs)
- foreach(tz2; testTZs)
+ foreach (si, st1; sts)
+ foreach (st2; sts[si+1 .. $])
+ foreach (tz1; testTZs)
+ foreach (tz2; testTZs)
testCmp(st1, tz1, st2, tz2);
auto st = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
@@ -1086,17 +1086,17 @@ public:
test(SysTime(1, UTC()), 1);
test(SysTime(-1, UTC()), 0);
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), year);
}
}
@@ -1125,7 +1125,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1155,11 +1155,11 @@ public:
assert(st == expected);
}
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
auto e = SysTime(DateTime(year, dt.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
@@ -1168,11 +1168,11 @@ public:
}
}
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
test(SysTime(DateTime(Date(1999, 2, 28), tod), fs, tz), 2000,
SysTime(DateTime(Date(2000, 2, 28), tod), fs, tz));
@@ -1180,7 +1180,7 @@ public:
SysTime(DateTime(Date(1999, 2, 28), tod), fs, tz));
}
- foreach(tod; testTODsThrown)
+ foreach (tod; testTODsThrown)
{
auto st = SysTime(DateTime(Date(2000, 2, 29), tod), fs, tz);
assertThrown!DateTimeException(st.year = 1999);
@@ -1216,14 +1216,14 @@ public:
unittest
{
import std.format : format;
- foreach(st; testSysTimesBC)
+ foreach (st; testSysTimesBC)
{
auto msg = format("SysTime: %s", st);
assertNotThrown!DateTimeException(st.yearBC, msg);
assert(st.yearBC == (st.year * -1) + 1, msg);
}
- foreach(st; [testSysTimesAD[0], testSysTimesAD[$/2], testSysTimesAD[$-1]])
+ foreach (st; [testSysTimesAD[0], testSysTimesAD[$/2], testSysTimesAD[$-1]])
assertThrown!DateTimeException(st.yearBC, format("SysTime: %s", st));
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
@@ -1250,7 +1250,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1283,11 +1283,11 @@ public:
assert(st == expected, format("SysTime: %s", st));
}
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
- foreach(year; testYearsBC)
+ foreach (year; testYearsBC)
{
auto e = SysTime(DateTime(year, dt.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
@@ -1296,18 +1296,18 @@ public:
}
}
- foreach(st; [testSysTimesBC[0], testSysTimesBC[$ - 1],
+ foreach (st; [testSysTimesBC[0], testSysTimesBC[$ - 1],
testSysTimesAD[0], testSysTimesAD[$ - 1]])
{
- foreach(year; testYearsBC)
+ foreach (year; testYearsBC)
assertThrown!DateTimeException(st.yearBC = year);
}
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
test(SysTime(DateTime(Date(-1999, 2, 28), tod), fs, tz), 2001,
SysTime(DateTime(Date(-2000, 2, 28), tod), fs, tz));
@@ -1315,7 +1315,7 @@ public:
SysTime(DateTime(Date(-1999, 2, 28), tod), fs, tz));
}
- foreach(tod; testTODsThrown)
+ foreach (tod; testTODsThrown)
{
auto st = SysTime(DateTime(Date(-2000, 2, 29), tod), fs, tz);
assertThrown!DateTimeException(st.year = -1999);
@@ -1362,17 +1362,17 @@ public:
test(SysTime(1, UTC()), Month.jan);
test(SysTime(-1, UTC()), Month.dec);
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
test(SysTime(dt, fs, tz), md.month);
}
}
@@ -1400,7 +1400,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1423,13 +1423,13 @@ public:
assert(st == expected);
}
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- if(st.day > maxDay(dt.year, md.month))
+ if (st.day > maxDay(dt.year, md.month))
continue;
auto e = SysTime(DateTime(dt.year, md.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
@@ -1438,13 +1438,13 @@ public:
}
}
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
- foreach(year; filter!((a){return yearIsLeapYear(a);})
+ foreach (year; filter!((a){return yearIsLeapYear(a);})
(chain(testYearsBC, testYearsAD)))
{
test(SysTime(DateTime(Date(year, 1, 29), tod), fs, tz),
@@ -1452,7 +1452,7 @@ public:
SysTime(DateTime(Date(year, 2, 29), tod), fs, tz));
}
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
test(SysTime(DateTime(Date(year, 1, 28), tod), fs, tz),
Month.feb,
@@ -1465,13 +1465,13 @@ public:
}
}
- foreach(fs; [testFracSecs[0], testFracSecs[$-1]])
+ foreach (fs; [testFracSecs[0], testFracSecs[$-1]])
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODsThrown)
+ foreach (tod; testTODsThrown)
{
- foreach(year; [testYearsBC[$-3], testYearsBC[$-2],
+ foreach (year; [testYearsBC[$-3], testYearsBC[$-2],
testYearsBC[$-2], testYearsAD[0],
testYearsAD[$-2], testYearsAD[$-1]])
{
@@ -1523,17 +1523,17 @@ public:
test(SysTime(1, UTC()), 1);
test(SysTime(-1, UTC()), 31);
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), md.day);
}
}
@@ -1562,7 +1562,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1580,13 +1580,13 @@ public:
import std.format : format;
import std.range;
- foreach(day; chain(testDays))
+ foreach (day; chain(testDays))
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
- if(day > maxDay(dt.year, dt.month))
+ if (day > maxDay(dt.year, dt.month))
continue;
auto expected = SysTime(DateTime(dt.year, dt.month, day, dt.hour, dt.minute, dt.second),
st.fracSecs,
@@ -1596,15 +1596,15 @@ public:
}
}
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
{
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(month; EnumMembers!Month)
+ foreach (month; EnumMembers!Month)
{
auto st = SysTime(DateTime(Date(year, month, 1), tod), fs, tz);
immutable max = maxDay(year, month);
@@ -1618,17 +1618,17 @@ public:
}
}
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(tod; testTODsThrown)
+ foreach (tod; testTODsThrown)
{
- foreach(fs; [testFracSecs[0], testFracSecs[$-1]])
+ foreach (fs; [testFracSecs[0], testFracSecs[$-1]])
{
- foreach(year; [testYearsBC[$-3], testYearsBC[$-2],
+ foreach (year; [testYearsBC[$-3], testYearsBC[$-2],
testYearsBC[$-2], testYearsAD[0],
testYearsAD[$-2], testYearsAD[$-1]])
{
- foreach(month; EnumMembers!Month)
+ foreach (month; EnumMembers!Month)
{
auto st = SysTime(DateTime(Date(year, month, 1), tod), fs, tz);
immutable max = maxDay(year, month);
@@ -1655,7 +1655,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1679,22 +1679,22 @@ public:
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 23);
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(hour; testHours)
+ foreach (hour; testHours)
{
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day),
TimeOfDay(hour, minute, second));
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), hour);
}
}
@@ -1729,13 +1729,13 @@ public:
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
- if(negative)
+ if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
hnsecs = removeUnitsFromHNSecs!"hours"(hnsecs);
hnsecs += convert!("hours", "hnsecs")(hour);
- if(negative)
+ if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
@@ -1746,9 +1746,9 @@ public:
import std.range;
import std.format : format;
- foreach(hour; chain(testHours))
+ foreach (hour; chain(testHours))
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, hour, dt.minute, dt.second),
@@ -1778,7 +1778,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1804,22 +1804,22 @@ public:
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 59);
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(hour; testHours)
+ foreach (hour; testHours)
{
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day),
TimeOfDay(hour, minute, second));
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), minute);
}
}
@@ -1854,7 +1854,7 @@ public:
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
- if(negative)
+ if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
@@ -1863,7 +1863,7 @@ public:
hnsecs += convert!("hours", "hnsecs")(hour);
hnsecs += convert!("minutes", "hnsecs")(minute);
- if(negative)
+ if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
@@ -1874,9 +1874,9 @@ public:
import std.range;
import std.format : format;
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, dt.hour, minute, dt.second),
@@ -1906,7 +1906,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -1933,22 +1933,22 @@ public:
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 59);
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(hour; testHours)
+ foreach (hour; testHours)
{
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day),
TimeOfDay(hour, minute, second));
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), second);
}
}
@@ -1983,7 +1983,7 @@ public:
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
- if(negative)
+ if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
@@ -1994,7 +1994,7 @@ public:
hnsecs += convert!("minutes", "hnsecs")(minute);
hnsecs += convert!("seconds", "hnsecs")(second);
- if(negative)
+ if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
@@ -2005,9 +2005,9 @@ public:
import std.range;
import std.format : format;
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, dt.hour, dt.minute, second),
@@ -2037,7 +2037,7 @@ public:
{
auto hnsecs = removeUnitsFromHNSecs!"days"(adjTime);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
return dur!"hnsecs"(removeUnitsFromHNSecs!"seconds"(hnsecs));
@@ -2064,20 +2064,20 @@ public:
assert(SysTime(1, UTC()).fracSecs == hnsecs(1));
assert(SysTime(-1, UTC()).fracSecs == hnsecs(9_999_999));
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(hour; testHours)
+ foreach (hour; testHours)
{
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day), TimeOfDay(hour, minute, second));
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
assert(SysTime(dt, fs, tz).fracSecs == fs);
}
}
@@ -2115,14 +2115,14 @@ public:
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = oldHNSecs < 0;
- if(negative)
+ if (negative)
oldHNSecs += convert!("hours", "hnsecs")(24);
immutable seconds = splitUnitsFromHNSecs!"seconds"(oldHNSecs);
immutable secondsHNSecs = convert!("seconds", "hnsecs")(seconds);
auto newHNSecs = fracSecs.total!"hnsecs" + secondsHNSecs;
- if(negative)
+ if (negative)
newHNSecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + newHNSecs;
@@ -2151,9 +2151,9 @@ public:
import std.range;
import std.format : format;
- foreach(fracSec; testFracSecs)
+ foreach (fracSec; testFracSecs)
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(dt, fracSec, st.timezone);
@@ -2189,7 +2189,7 @@ public:
{
auto hnsecs = removeUnitsFromHNSecs!"days"(adjTime);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
hnsecs = removeUnitsFromHNSecs!"seconds"(hnsecs);
@@ -2207,7 +2207,7 @@ public:
static void test(SysTime sysTime, FracSec expected, size_t line = __LINE__)
{
- if(sysTime.fracSec != expected)
+ if (sysTime.fracSec != expected)
throw new AssertError(format("Value given: %s", sysTime.fracSec), __FILE__, line);
}
@@ -2215,22 +2215,22 @@ public:
test(SysTime(1, UTC()), FracSec.from!"hnsecs"(1));
test(SysTime(-1, UTC()), FracSec.from!"hnsecs"(9_999_999));
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(hour; testHours)
+ foreach (hour; testHours)
{
- foreach(minute; testMinSecs)
+ foreach (minute; testMinSecs)
{
- foreach(second; testMinSecs)
+ foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day),
TimeOfDay(hour, minute, second));
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), FracSec.from!"hnsecs"(fs.total!"hnsecs"));
}
}
@@ -2273,7 +2273,7 @@ public:
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
- if(negative)
+ if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
@@ -2285,7 +2285,7 @@ public:
hnsecs += convert!("minutes", "hnsecs")(minute);
hnsecs += convert!("seconds", "hnsecs")(second);
- if(negative)
+ if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
@@ -2296,9 +2296,9 @@ public:
import std.range;
import std.format : format;
- foreach(fracSec; testFracSecs)
+ foreach (fracSec; testFracSecs)
{
- foreach(st; chain(testSysTimesBC, testSysTimesAD))
+ foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(dt, fracSec, st.timezone);
@@ -2398,7 +2398,7 @@ public:
+/
@property void timezone(immutable TimeZone timezone) @safe pure nothrow
{
- if(timezone is null)
+ if (timezone is null)
_timezone = LocalTime();
else
_timezone = timezone;
@@ -2483,7 +2483,7 @@ public:
+/
SysTime toOtherTZ(immutable TimeZone tz) @safe const pure nothrow
{
- if(tz is null)
+ if (tz is null)
return SysTime(_stdTime, LocalTime());
else
return SysTime(_stdTime, tz);
@@ -2531,7 +2531,7 @@ public:
this SysTime.
+/
T toUnixTime(T = time_t)() @safe const pure nothrow
- if(is(T == int) || is(T == long))
+ if (is(T == int) || is(T == long))
{
return stdTimeToUnixTime!T(_stdTime);
}
@@ -2555,7 +2555,7 @@ public:
{
assert(SysTime(DateTime(1970, 1, 1), UTC()).toUnixTime() == 0);
import std.meta : AliasSeq;
- foreach(units; AliasSeq!("hnsecs", "usecs", "msecs"))
+ foreach (units; AliasSeq!("hnsecs", "usecs", "msecs"))
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), dur!units(1), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), UTC()).toUnixTime() == 1);
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toUnixTime() == 0);
@@ -2815,13 +2815,13 @@ public:
causing the month to increment.
+/
ref SysTime add(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
- if(units == "years" ||
+ if (units == "years" ||
units == "months")
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -2831,7 +2831,7 @@ public:
date.add!units(value, allowOverflow);
days = date.dayOfGregorianCal - 1;
- if(days < 0)
+ if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
@@ -3978,7 +3978,7 @@ public:
causing the month to increment.
+/
ref SysTime roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
- if(units == "years")
+ if (units == "years")
{
return add!"years"(value, allowOverflow);
}
@@ -4024,12 +4024,12 @@ public:
//Shares documentation with "years" overload.
ref SysTime roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
- if(units == "months")
+ if (units == "months")
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -4039,7 +4039,7 @@ public:
date.roll!"months"(value, allowOverflow);
days = date.dayOfGregorianCal - 1;
- if(days < 0)
+ if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
@@ -4823,12 +4823,12 @@ public:
value = The number of $(D_PARAM units) to add to this $(LREF SysTime).
+/
ref SysTime roll(string units)(long value) @safe nothrow
- if(units == "days")
+ if (units == "days")
{
auto hnsecs = adjTime;
auto gdays = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--gdays;
@@ -4838,7 +4838,7 @@ public:
date.roll!"days"(value);
gdays = date.dayOfGregorianCal - 1;
- if(gdays < 0)
+ if (gdays < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++gdays;
@@ -5179,7 +5179,7 @@ public:
//Shares documentation with "days" version.
ref SysTime roll(string units)(long value) @safe nothrow
- if(units == "hours" ||
+ if (units == "hours" ||
units == "minutes" ||
units == "seconds")
{
@@ -5188,7 +5188,7 @@ public:
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -5206,7 +5206,7 @@ public:
hnsecs += convert!("minutes", "hnsecs")(dateTime.minute);
hnsecs += convert!("seconds", "hnsecs")(dateTime.second);
- if(days < 0)
+ if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
@@ -5227,7 +5227,7 @@ public:
{
import std.format : format;
orig.roll!"hours"(hours);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -5445,7 +5445,7 @@ public:
{
import std.format : format;
orig.roll!"minutes"(minutes);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -5656,7 +5656,7 @@ public:
{
import std.format : format;
orig.roll!"seconds"(seconds);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -5841,7 +5841,7 @@ public:
//Shares documentation with "days" version.
ref SysTime roll(string units)(long value) @safe nothrow
- if(units == "msecs" ||
+ if (units == "msecs" ||
units == "usecs" ||
units == "hnsecs")
{
@@ -5849,18 +5849,18 @@ public:
immutable days = splitUnitsFromHNSecs!"days"(hnsecs);
immutable negative = hnsecs < 0;
- if(negative)
+ if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable seconds = splitUnitsFromHNSecs!"seconds"(hnsecs);
hnsecs += convert!(units, "hnsecs")(value);
hnsecs %= convert!("seconds", "hnsecs")(1);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("seconds", "hnsecs")(1);
hnsecs += convert!("seconds", "hnsecs")(seconds);
- if(negative)
+ if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
@@ -5876,7 +5876,7 @@ public:
{
import std.format : format;
orig.roll!"msecs"(milliseconds);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -5982,7 +5982,7 @@ public:
{
import std.format : format;
orig.roll!"usecs"(microseconds);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -6112,7 +6112,7 @@ public:
{
import std.format : format;
orig.roll!"hnsecs"(hnsecs);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -6265,7 +6265,7 @@ public:
this $(LREF SysTime).
+/
SysTime opBinary(string op)(Duration duration) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
SysTime retval = SysTime(this._stdTime, this._timezone);
immutable hnsecs = duration.total!"hnsecs";
@@ -6331,7 +6331,7 @@ public:
{
import std.format : format;
auto result = orig + dur!"hnsecs"(hnsecs);
- if(result != expected)
+ if (result != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", result, expected), __FILE__, line);
}
@@ -6470,7 +6470,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
SysTime opBinary(string op)(TickDuration td) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
SysTime retval = SysTime(this._stdTime, this._timezone);
immutable hnsecs = td.hnsecs;
@@ -6482,7 +6482,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_678));
@@ -6512,7 +6512,7 @@ public:
this $(LREF SysTime).
+/
ref SysTime opOpAssign(string op)(Duration duration) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable hnsecs = duration.total!"hnsecs";
mixin("_stdTime " ~ op ~ "= hnsecs;");
@@ -6563,9 +6563,9 @@ public:
import std.format : format;
auto r = orig += dur!"hnsecs"(hnsecs);
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed 1. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
- if(r != expected)
+ if (r != expected)
throw new AssertError(format("Failed 2. actual [%s] != expected [%s]", r, expected), __FILE__, line);
}
@@ -6710,7 +6710,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
ref SysTime opOpAssign(string op)(TickDuration td) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable hnsecs = td.hnsecs;
mixin("_stdTime " ~ op ~ "= hnsecs;");
@@ -6721,7 +6721,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
{
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_678));
@@ -6758,7 +6758,7 @@ public:
)
+/
Duration opBinary(string op)(in SysTime rhs) @safe const pure nothrow
- if(op == "-")
+ if (op == "-")
{
return dur!"hnsecs"(_stdTime - rhs._stdTime);
}
@@ -7013,7 +7013,7 @@ public:
//We have to add one because 0 would be midnight, January 1st, 1 A.D.,
//which would be the 1st day of the Gregorian Calendar, not the 0th. So,
//simply casting to days is one day off.
- if(adjustedTime > 0)
+ if (adjustedTime > 0)
return cast(int)getUnitsFromHNSecs!"days"(adjustedTime) + 1;
long hnsecs = adjustedTime;
@@ -7214,7 +7214,7 @@ public:
{
import std.format : format;
- if(date.dayOfGregorianCal != st.dayOfGregorianCal)
+ if (date.dayOfGregorianCal != st.dayOfGregorianCal)
{
throw new AssertError(format("Date [%s] SysTime [%s]", date.dayOfGregorianCal, st.dayOfGregorianCal),
__FILE__, line);
@@ -7382,10 +7382,10 @@ public:
auto hnsecs = adjTime;
hnsecs = removeUnitsFromHNSecs!"days"(hnsecs);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
- if(--days < 0)
+ if (--days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
@@ -7432,7 +7432,7 @@ public:
import std.format : format;
orig.dayOfGregorianCal = day;
- if(orig != expected)
+ if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
@@ -7471,7 +7471,7 @@ public:
import std.format : format;
st.dayOfGregorianCal = day;
- if(st != expected)
+ if (st != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", st, expected), __FILE__, line);
}
@@ -7664,7 +7664,7 @@ public:
auto newDays = date.dayOfGregorianCal - 1;
long theTimeHNSecs;
- if(newDays < 0)
+ if (newDays < 0)
{
theTimeHNSecs = -1;
++newDays;
@@ -7909,7 +7909,7 @@ public:
Returns a $(LREF Date) equivalent to this $(LREF SysTime).
+/
Date opCast(T)() @safe const nothrow
- if(is(Unqual!T == Date))
+ if (is(Unqual!T == Date))
{
return Date(dayOfGregorianCal);
}
@@ -7943,14 +7943,14 @@ public:
Returns a $(LREF DateTime) equivalent to this $(LREF SysTime).
+/
DateTime opCast(T)() @safe const nothrow
- if(is(Unqual!T == DateTime))
+ if (is(Unqual!T == DateTime))
{
try
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -8002,14 +8002,14 @@ public:
Returns a $(LREF TimeOfDay) equivalent to this $(LREF SysTime).
+/
TimeOfDay opCast(T)() @safe const nothrow
- if(is(Unqual!T == TimeOfDay))
+ if (is(Unqual!T == TimeOfDay))
{
try
{
auto hnsecs = adjTime;
hnsecs = removeUnitsFromHNSecs!"days"(hnsecs);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
@@ -8053,7 +8053,7 @@ public:
//should be allowed, and it doesn't work without this opCast() since opCast()
//has already been defined for other types.
SysTime opCast(T)() @safe const pure nothrow
- if(is(Unqual!T == SysTime))
+ if (is(Unqual!T == SysTime))
{
return SysTime(_stdTime, _timezone);
}
@@ -8097,7 +8097,7 @@ public:
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -8110,10 +8110,10 @@ public:
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is LocalTime())
+ if (_timezone is LocalTime())
return dateTime.toISOString() ~ fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is UTC())
+ if (_timezone is UTC())
return dateTime.toISOString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
@@ -8227,7 +8227,7 @@ public:
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -8240,10 +8240,10 @@ public:
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is LocalTime())
+ if (_timezone is LocalTime())
return dateTime.toISOExtString() ~ fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is UTC())
+ if (_timezone is UTC())
return dateTime.toISOExtString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
@@ -8361,7 +8361,7 @@ public:
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
@@ -8374,10 +8374,10 @@ public:
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is LocalTime())
+ if (_timezone is LocalTime())
return dateTime.toSimpleString() ~ fracSecsToISOString(cast(int)hnsecs);
- if(_timezone is UTC())
+ if (_timezone is UTC())
return dateTime.toSimpleString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
@@ -8529,7 +8529,7 @@ public:
format or if the resulting $(LREF SysTime) would not be valid.
+/
static SysTime fromISOString(S)(in S isoString, immutable TimeZone tz = null) @safe
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.string : strip;
import std.conv : to;
@@ -8545,13 +8545,13 @@ public:
dstring fracSecStr;
dstring zoneStr;
- if(found[1] != 0)
+ if (found[1] != 0)
{
- if(found[1] == 1)
+ if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
- if(foundTZ[1] != 0)
+ if (foundTZ[1] != 0)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
@@ -8569,9 +8569,9 @@ public:
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
- if(zoneStr.empty)
+ if (zoneStr.empty)
parsedZone = LocalTime();
- else if(zoneStr == "Z")
+ else if (zoneStr == "Z")
parsedZone = UTC();
else
{
@@ -8583,7 +8583,7 @@ public:
auto retval = SysTime(dateTime, fracSec, parsedZone);
- if(tz !is null)
+ if (tz !is null)
retval.timezone = tz;
return retval;
@@ -8626,7 +8626,7 @@ public:
{
import std.format: format;
- foreach(str; ["", "20100704000000", "20100704 000000", "20100704t000000",
+ foreach (str; ["", "20100704000000", "20100704 000000", "20100704t000000",
"20100704T000000.", "20100704T000000.A", "20100704T000000.Z",
"20100704T000000.00000000", "20100704T000000.00000000",
"20100704T000000+", "20100704T000000-", "20100704T000000:",
@@ -8662,7 +8662,7 @@ public:
static void test(string str, SysTime st, size_t line = __LINE__)
{
- if(SysTime.fromISOString(str) != st)
+ if (SysTime.fromISOString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
@@ -8768,7 +8768,7 @@ public:
format or if the resulting $(LREF SysTime) would not be valid.
+/
static SysTime fromISOExtString(S)(in S isoExtString, immutable TimeZone tz = null) @safe
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
@@ -8786,13 +8786,13 @@ public:
dstring fracSecStr;
dstring zoneStr;
- if(found[1] != 0)
+ if (found[1] != 0)
{
- if(found[1] == 1)
+ if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
- if(foundTZ[1] != 0)
+ if (foundTZ[1] != 0)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
@@ -8810,16 +8810,16 @@ public:
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
- if(zoneStr.empty)
+ if (zoneStr.empty)
parsedZone = LocalTime();
- else if(zoneStr == "Z")
+ else if (zoneStr == "Z")
parsedZone = UTC();
else
parsedZone = SimpleTimeZone.fromISOExtString(zoneStr);
auto retval = SysTime(dateTime, fracSec, parsedZone);
- if(tz !is null)
+ if (tz !is null)
retval.timezone = tz;
return retval;
@@ -8861,7 +8861,7 @@ public:
{
import std.format : format;
- foreach(str; ["", "20100704000000", "20100704 000000",
+ foreach (str; ["", "20100704000000", "20100704 000000",
"20100704t000000", "20100704T000000.", "20100704T000000.0",
"2010-07:0400:00:00", "2010-07-04 00:00:00",
"2010-07-04 00:00:00", "2010-07-04t00:00:00",
@@ -8897,7 +8897,7 @@ public:
static void test(string str, SysTime st, size_t line = __LINE__)
{
- if(SysTime.fromISOExtString(str) != st)
+ if (SysTime.fromISOExtString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
@@ -8981,7 +8981,7 @@ public:
or if the resulting $(LREF SysTime) would not be valid.
+/
static SysTime fromSimpleString(S)(in S simpleString, immutable TimeZone tz = null) @safe
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
@@ -8999,13 +8999,13 @@ public:
dstring fracSecStr;
dstring zoneStr;
- if(found[1] != 0)
+ if (found[1] != 0)
{
- if(found[1] == 1)
+ if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
- if(foundTZ[1] != 0)
+ if (foundTZ[1] != 0)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
@@ -9023,16 +9023,16 @@ public:
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
- if(zoneStr.empty)
+ if (zoneStr.empty)
parsedZone = LocalTime();
- else if(zoneStr == "Z")
+ else if (zoneStr == "Z")
parsedZone = UTC();
else
parsedZone = SimpleTimeZone.fromISOExtString(zoneStr);
auto retval = SysTime(dateTime, fracSec, parsedZone);
- if(tz !is null)
+ if (tz !is null)
retval.timezone = tz;
return retval;
@@ -9075,7 +9075,7 @@ public:
{
import std.format : format;
- foreach(str; ["", "20100704000000", "20100704 000000",
+ foreach (str; ["", "20100704000000", "20100704 000000",
"20100704t000000", "20100704T000000.", "20100704T000000.0",
"2010-07-0400:00:00", "2010-07-04 00:00:00", "2010-07-04t00:00:00",
"2010-07-04T00:00:00.", "2010-07-04T00:00:00.0",
@@ -9113,7 +9113,7 @@ public:
static void test(string str, SysTime st, size_t line = __LINE__)
{
- if(SysTime.fromSimpleString(str) != st)
+ if (SysTime.fromSimpleString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
@@ -9345,7 +9345,7 @@ public:
+/
this(int day) @safe pure nothrow
{
- if(day > 0)
+ if (day > 0)
{
int years = (day / daysIn400Years) * 400 + 1;
day %= daysIn400Years;
@@ -9353,7 +9353,7 @@ public:
{
immutable tempYears = day / daysIn100Years;
- if(tempYears == 4)
+ if (tempYears == 4)
{
years += 300;
day -= daysIn100Years * 3;
@@ -9371,7 +9371,7 @@ public:
{
immutable tempYears = day / daysInYear;
- if(tempYears == 4)
+ if (tempYears == 4)
{
years += 3;
day -= daysInYear * 3;
@@ -9383,7 +9383,7 @@ public:
}
}
- if(day == 0)
+ if (day == 0)
{
_year = cast(short)(years - 1);
_month = Month.dec;
@@ -9399,7 +9399,7 @@ public:
assert(0, "dayOfYear assignment threw.");
}
}
- else if(day <= 0 && -day < daysInLeapYear)
+ else if (day <= 0 && -day < daysInLeapYear)
{
_year = 0;
@@ -9417,7 +9417,7 @@ public:
{
immutable tempYears = day / daysIn100Years;
- if(tempYears == -4)
+ if (tempYears == -4)
{
years -= 300;
day += daysIn100Years * 3;
@@ -9435,7 +9435,7 @@ public:
{
immutable tempYears = day / daysInYear;
- if(tempYears == -4)
+ if (tempYears == -4)
{
years -= 3;
day += daysInYear * 3;
@@ -9447,7 +9447,7 @@ public:
}
}
- if(day == 0)
+ if (day == 0)
{
_year = cast(short)(years + 1);
_month = Month.jan;
@@ -9471,7 +9471,7 @@ public:
import std.range;
//Test A.D.
- foreach(gd; chain(testGregDaysBC, testGregDaysAD))
+ foreach (gd; chain(testGregDaysBC, testGregDaysAD))
assert(Date(gd.day) == gd.date);
}
@@ -9488,19 +9488,19 @@ public:
+/
int opCmp(in Date rhs) @safe const pure nothrow
{
- if(_year < rhs._year)
+ if (_year < rhs._year)
return -1;
- if(_year > rhs._year)
+ if (_year > rhs._year)
return 1;
- if(_month < rhs._month)
+ if (_month < rhs._month)
return -1;
- if(_month > rhs._month)
+ if (_month > rhs._month)
return 1;
- if(_day < rhs._day)
+ if (_day < rhs._day)
return -1;
- if(_day > rhs._day)
+ if (_day > rhs._day)
return 1;
return 0;
@@ -9680,7 +9680,7 @@ public:
{
import std.format : format;
- if(isAD)
+ if (isAD)
throw new DateTimeException(format("Year %s is A.D.", _year));
return cast(ushort)((_year * -1) + 1);
}
@@ -9717,7 +9717,7 @@ public:
+/
@property void yearBC(int year) @safe pure
{
- if(year <= 0)
+ if (year <= 0)
throw new DateTimeException("The given year is not a year B.C.");
_year = cast(short)((year - 1) * -1);
@@ -9844,9 +9844,9 @@ public:
format("Value given: %s", date));
}
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
test(Date(year, md.month, md.day), md.day);
}
@@ -9978,15 +9978,15 @@ public:
causing the month to increment.
+/
ref Date add(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "years")
+ if (units == "years")
{
immutable newYear = _year + value;
_year += value;
- if(_month == Month.feb && _day == 29 && !yearIsLeapYear(_year))
+ if (_month == Month.feb && _day == 29 && !yearIsLeapYear(_year))
{
- if(allowOverflow == AllowDayOverflow.yes)
+ if (allowOverflow == AllowDayOverflow.yes)
{
_month = Month.mar;
_day = 1;
@@ -10220,21 +10220,21 @@ public:
//Shares documentation with "years" version.
ref Date add(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "months")
+ if (units == "months")
{
auto years = months / 12;
months %= 12;
auto newMonth = _month + months;
- if(months < 0)
+ if (months < 0)
{
- if(newMonth < 1)
+ if (newMonth < 1)
{
newMonth += 12;
--years;
}
}
- else if(newMonth > 12)
+ else if (newMonth > 12)
{
newMonth -= 12;
++years;
@@ -10246,9 +10246,9 @@ public:
immutable currMaxDay = maxDay(_year, _month);
immutable overflow = _day - currMaxDay;
- if(overflow > 0)
+ if (overflow > 0)
{
- if(allowOverflow == AllowDayOverflow.yes)
+ if (allowOverflow == AllowDayOverflow.yes)
{
++_month;
_day = cast(ubyte)overflow;
@@ -10760,7 +10760,7 @@ public:
causing the month to increment.
+/
ref Date roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "years")
+ if (units == "years")
{
return add!"years"(value, allowOverflow);
}
@@ -10804,19 +10804,19 @@ public:
//Shares documentation with "years" version.
ref Date roll(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "months")
+ if (units == "months")
{
months %= 12;
auto newMonth = _month + months;
- if(months < 0)
+ if (months < 0)
{
- if(newMonth < 1)
+ if (newMonth < 1)
newMonth += 12;
}
else
{
- if(newMonth > 12)
+ if (newMonth > 12)
newMonth -= 12;
}
@@ -10825,9 +10825,9 @@ public:
immutable currMaxDay = maxDay(_year, _month);
immutable overflow = _day - currMaxDay;
- if(overflow > 0)
+ if (overflow > 0)
{
- if(allowOverflow == AllowDayOverflow.yes)
+ if (allowOverflow == AllowDayOverflow.yes)
{
++_month;
_day = cast(ubyte)overflow;
@@ -11398,18 +11398,18 @@ public:
days = The number of days to add to this $(LREF Date).
+/
ref Date roll(string units)(long days) @safe pure nothrow
- if(units == "days")
+ if (units == "days")
{
immutable limit = maxDay(_year, _month);
days %= limit;
auto newDay = _day + days;
- if(days < 0)
+ if (days < 0)
{
- if(newDay < 1)
+ if (newDay < 1)
newDay += limit;
}
- else if(newDay > limit)
+ else if (newDay > limit)
newDay -= limit;
_day = cast(ubyte)newDay;
@@ -11636,7 +11636,7 @@ public:
this $(LREF Date).
+/
Date opBinary(string op)(Duration duration) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
Date retval = this;
immutable days = duration.total!"days";
@@ -11716,7 +11716,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
Date opBinary(string op)(TickDuration td) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
Date retval = this;
immutable days = convert!("hnsecs", "days")(td.hnsecs);
@@ -11727,7 +11727,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
auto date = Date(1999, 7, 6);
@@ -11756,7 +11756,7 @@ public:
this $(LREF Date).
+/
ref Date opOpAssign(string op)(Duration duration) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable days = duration.total!"days";
mixin("return _addDays(" ~ op ~ "days);");
@@ -11830,7 +11830,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
ref Date opOpAssign(string op)(TickDuration td) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable days = convert!("seconds", "days")(td.seconds);
mixin("return _addDays(" ~ op ~ "days);");
@@ -11840,7 +11840,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
{
auto date = Date(1999, 7, 6);
@@ -11879,7 +11879,7 @@ public:
)
+/
Duration opBinary(string op)(in Date rhs) @safe const pure nothrow
- if(op == "-")
+ if (op == "-")
{
return dur!"days"(this.dayOfGregorianCal - rhs.dayOfGregorianCal);
}
@@ -12232,20 +12232,20 @@ public:
{
import std.range;
- foreach(year; filter!((a){return !yearIsLeapYear(a);})
+ foreach (year; filter!((a){return !yearIsLeapYear(a);})
(chain(testYearsBC, testYearsAD)))
{
- foreach(doy; testDaysOfYear)
+ foreach (doy; testDaysOfYear)
{
assert(Date(year, doy.md.month, doy.md.day).dayOfYear ==
doy.day);
}
}
- foreach(year; filter!((a){return yearIsLeapYear(a);})
+ foreach (year; filter!((a){return yearIsLeapYear(a);})
(chain(testYearsBC, testYearsAD)))
{
- foreach(doy; testDaysOfLeapYear)
+ foreach (doy; testDaysOfLeapYear)
{
assert(Date(year, doy.md.month, doy.md.day).dayOfYear ==
doy.day);
@@ -12273,7 +12273,7 @@ public:
{
immutable int[] lastDay = isLeapYear ? lastDayLeap : lastDayNonLeap;
- if(day <= 0 || day > (isLeapYear ? daysInLeapYear : daysInYear) )
+ if (day <= 0 || day > (isLeapYear ? daysInLeapYear : daysInYear) )
throw new DateTimeException("Invalid day of the year.");
foreach (i; 1..lastDay.length)
@@ -12297,13 +12297,13 @@ public:
assert(date.day == expected.day);
}
- foreach(doy; testDaysOfYear)
+ foreach (doy; testDaysOfYear)
{
test(Date(1999, 1, 1), doy.day, doy.md);
test(Date(-1, 1, 1), doy.day, doy.md);
}
- foreach(doy; testDaysOfLeapYear)
+ foreach (doy; testDaysOfLeapYear)
{
test(Date(2000, 1, 1), doy.day, doy.md);
test(Date(-4, 1, 1), doy.day, doy.md);
@@ -12321,9 +12321,9 @@ public:
+/
@property int dayOfGregorianCal() @safe const pure nothrow
{
- if(isAD)
+ if (isAD)
{
- if(_year == 1)
+ if (_year == 1)
return dayOfYear;
int years = _year - 1;
@@ -12342,7 +12342,7 @@ public:
return days;
}
- else if(_year == 0)
+ else if (_year == 0)
return dayOfYear - daysInLeapYear;
else
{
@@ -12356,7 +12356,7 @@ public:
days += (years / 4) * daysIn4Years;
years %= 4;
- if(years < 0)
+ if (years < 0)
{
days -= daysInLeapYear;
++years;
@@ -12391,7 +12391,7 @@ public:
{
import std.range;
- foreach(gd; chain(testGregDaysBC, testGregDaysAD))
+ foreach (gd; chain(testGregDaysBC, testGregDaysAD))
assert(gd.date.dayOfGregorianCal == gd.day);
auto date = Date(1999, 7, 6);
@@ -12468,9 +12468,9 @@ public:
try
{
- if(week == 53)
+ if (week == 53)
{
- switch(Date(_year + 1, 1, 1).dayOfWeek)
+ switch (Date(_year + 1, 1, 1).dayOfWeek)
{
case DayOfWeek.mon:
case DayOfWeek.tue:
@@ -12485,7 +12485,7 @@ public:
assert(0, "Invalid ISO Week");
}
}
- else if(week > 0)
+ else if (week > 0)
return cast(ubyte)week;
else
return Date(_year - 1, 12, 31).isoWeek;
@@ -12759,14 +12759,14 @@ public:
import std.format : format;
try
{
- if(_year >= 0)
+ if (_year >= 0)
{
- if(_year < 10_000)
+ if (_year < 10_000)
return format("%04d%02d%02d", _year, _month, _day);
else
return format("+%05d%02d%02d", _year, _month, _day);
}
- else if(_year > -10_000)
+ else if (_year > -10_000)
return format("%05d%02d%02d", _year, _month, _day);
else
return format("%06d%02d%02d", _year, _month, _day);
@@ -12815,14 +12815,14 @@ public:
import std.format : format;
try
{
- if(_year >= 0)
+ if (_year >= 0)
{
- if(_year < 10_000)
+ if (_year < 10_000)
return format("%04d-%02d-%02d", _year, _month, _day);
else
return format("+%05d-%02d-%02d", _year, _month, _day);
}
- else if(_year > -10_000)
+ else if (_year > -10_000)
return format("%05d-%02d-%02d", _year, _month, _day);
else
return format("%06d-%02d-%02d", _year, _month, _day);
@@ -12871,14 +12871,14 @@ public:
import std.format : format;
try
{
- if(_year >= 0)
+ if (_year >= 0)
{
- if(_year < 10_000)
+ if (_year < 10_000)
return format("%04d-%s-%02d", _year, monthToString(_month), _day);
else
return format("+%05d-%s-%02d", _year, monthToString(_month), _day);
}
- else if(_year > -10_000)
+ else if (_year > -10_000)
return format("%05d-%s-%02d", _year, monthToString(_month), _day);
else
return format("%06d-%s-%02d", _year, monthToString(_month), _day);
@@ -12951,7 +12951,7 @@ public:
or if the resulting $(LREF Date) would not be valid.
+/
static Date fromISOString(S)(in S isoString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
@@ -12970,7 +12970,7 @@ public:
enforce(all!isDigit(day), new DateTimeException(format("Invalid ISO String: %s", isoString)));
enforce(all!isDigit(month), new DateTimeException(format("Invalid ISO String: %s", isoString)));
- if(year.length > 4)
+ if (year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid ISO String: %s", isoString)));
@@ -13073,7 +13073,7 @@ public:
Extended format or if the resulting $(LREF Date) would not be valid.
+/
static Date fromISOExtString(S)(in S isoExtString) @safe pure
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.ascii : isDigit;
import std.string : strip;
@@ -13096,7 +13096,7 @@ public:
enforce(all!isDigit(month),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
- if(year.length > 4)
+ if (year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
@@ -13200,7 +13200,7 @@ public:
format or if the resulting $(LREF Date) would not be valid.
+/
static Date fromSimpleString(S)(in S simpleString) @safe pure
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.ascii : isDigit;
import std.string : strip;
@@ -13220,7 +13220,7 @@ public:
enforce(dstr[$-7] == '-', new DateTimeException(format("Invalid string format: %s", simpleString)));
enforce(all!isDigit(day), new DateTimeException(format("Invalid string format: %s", simpleString)));
- if(year.length > 4)
+ if (year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid string format: %s", simpleString)));
@@ -13365,7 +13365,7 @@ private:
+/
static bool _valid(int year, int month, int day) @safe pure nothrow
{
- if(!valid!"months"(month))
+ if (!valid!"months"(month))
return false;
return valid!"days"(year, month, day);
@@ -13641,19 +13641,19 @@ public:
+/
int opCmp(in TimeOfDay rhs) @safe const pure nothrow
{
- if(_hour < rhs._hour)
+ if (_hour < rhs._hour)
return -1;
- if(_hour > rhs._hour)
+ if (_hour > rhs._hour)
return 1;
- if(_minute < rhs._minute)
+ if (_minute < rhs._minute)
return -1;
- if(_minute > rhs._minute)
+ if (_minute > rhs._minute)
return 1;
- if(_second < rhs._second)
+ if (_second < rhs._second)
return -1;
- if(_second > rhs._second)
+ if (_second > rhs._second)
return 1;
return 0;
@@ -13866,7 +13866,7 @@ public:
$(LREF TimeOfDay).
+/
ref TimeOfDay roll(string units)(long value) @safe pure nothrow
- if(units == "hours")
+ if (units == "hours")
{
return this += dur!"hours"(value);
}
@@ -13914,7 +13914,7 @@ public:
//Shares documentation with "hours" version.
ref TimeOfDay roll(string units)(long value) @safe pure nothrow
- if(units == "minutes" ||
+ if (units == "minutes" ||
units == "seconds")
{
import std.format : format;
@@ -13923,12 +13923,12 @@ public:
value %= 60;
mixin(format("auto newVal = cast(ubyte)(_%s) + value;", memberVarStr));
- if(value < 0)
+ if (value < 0)
{
- if(newVal < 0)
+ if (newVal < 0)
newVal += 60;
}
- else if(newVal >= 60)
+ else if (newVal >= 60)
newVal -= 60;
mixin(format("_%s = cast(ubyte)newVal;", memberVarStr));
@@ -14110,7 +14110,7 @@ public:
this $(LREF TimeOfDay).
+/
TimeOfDay opBinary(string op)(Duration duration) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
TimeOfDay retval = this;
immutable seconds = duration.total!"seconds";
@@ -14186,7 +14186,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
TimeOfDay opBinary(string op)(TickDuration td) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
TimeOfDay retval = this;
immutable seconds = td.seconds;
@@ -14197,7 +14197,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
auto tod = TimeOfDay(12, 30, 33);
@@ -14228,7 +14228,7 @@ public:
this $(LREF TimeOfDay).
+/
ref TimeOfDay opOpAssign(string op)(Duration duration) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable seconds = duration.total!"seconds";
mixin("return _addSeconds(" ~ op ~ "seconds);");
@@ -14289,7 +14289,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
ref TimeOfDay opOpAssign(string op)(TickDuration td) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
immutable seconds = td.seconds;
mixin("return _addSeconds(" ~ op ~ "seconds);");
@@ -14299,7 +14299,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
{
auto tod = TimeOfDay(12, 30, 33);
@@ -14341,7 +14341,7 @@ public:
rhs = The $(LREF TimeOfDay) to subtract from this one.
+/
Duration opBinary(string op)(in TimeOfDay rhs) @safe const pure nothrow
- if(op == "-")
+ if (op == "-")
{
immutable lhsSec = _hour * 3600 + _minute * 60 + _second;
immutable rhsSec = rhs._hour * 3600 + rhs._minute * 60 + rhs._second;
@@ -14469,7 +14469,7 @@ public:
or if the resulting $(LREF TimeOfDay) would not be valid.
+/
static TimeOfDay fromISOString(S)(in S isoString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
@@ -14577,7 +14577,7 @@ public:
valid.
+/
static TimeOfDay fromISOExtString(S)(in S isoExtString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
@@ -14738,7 +14738,7 @@ private:
hnsecs %= convert!("days", "hnsecs")(1);
- if(hnsecs < 0)
+ if (hnsecs < 0)
hnsecs += convert!("days", "hnsecs")(1);
immutable newHours = splitUnitsFromHNSecs!"hours"(hnsecs);
@@ -14945,7 +14945,7 @@ public:
{
immutable dateResult = _date.opCmp(rhs._date);
- if(dateResult != 0)
+ if (dateResult != 0)
return dateResult;
return _tod.opCmp(rhs._tod);
@@ -15481,11 +15481,11 @@ public:
assert(dateTime.day == expected, format("Value given: %s", dateTime));
}
- foreach(year; chain(testYearsBC, testYearsAD))
+ foreach (year; chain(testYearsBC, testYearsAD))
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
test(DateTime(Date(year, md.month, md.day), tod), md.day);
}
}
@@ -15767,7 +15767,7 @@ public:
+/
ref DateTime add(string units)
(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "years" ||
+ if (units == "years" ||
units == "months")
{
_date.add!units(value, allowOverflow);
@@ -15830,7 +15830,7 @@ public:
+/
ref DateTime roll(string units)
(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
- if(units == "years" ||
+ if (units == "years" ||
units == "months")
{
_date.roll!units(value, allowOverflow);
@@ -15896,7 +15896,7 @@ public:
value = The number of $(D_PARAM units) to add to this $(LREF DateTime).
+/
ref DateTime roll(string units)(long value) @safe pure nothrow
- if(units == "days")
+ if (units == "days")
{
_date.roll!"days"(value);
return this;
@@ -15937,7 +15937,7 @@ public:
//Shares documentation with "days" version.
ref DateTime roll(string units)(long value) @safe pure nothrow
- if(units == "hours" ||
+ if (units == "hours" ||
units == "minutes" ||
units == "seconds")
{
@@ -16456,7 +16456,7 @@ public:
this $(LREF DateTime).
+/
DateTime opBinary(string op)(Duration duration) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
DateTime retval = this;
immutable seconds = duration.total!"seconds";
@@ -16539,7 +16539,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
DateTime opBinary(string op)(in TickDuration td) @safe const pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
DateTime retval = this;
immutable seconds = td.seconds;
@@ -16550,7 +16550,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
@@ -16579,7 +16579,7 @@ public:
$(LREF DateTime).
+/
ref DateTime opOpAssign(string op, D)(in D duration) @safe pure nothrow
- if((op == "+" || op == "-") &&
+ if ((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
@@ -16587,9 +16587,9 @@ public:
DateTime retval = this;
- static if(is(Unqual!D == Duration))
+ static if (is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
- else static if(is(Unqual!D == TickDuration))
+ else static if (is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format(`return _addSeconds(convert!("hnsecs", "seconds")(%shnsecs));`, op));
@@ -16657,7 +16657,7 @@ public:
+/
deprecated("Use Duration instead of TickDuration.")
ref DateTime opOpAssign(string op)(TickDuration td) @safe pure nothrow
- if(op == "+" || op == "-")
+ if (op == "+" || op == "-")
{
DateTime retval = this;
immutable seconds = td.seconds;
@@ -16668,7 +16668,7 @@ public:
{
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
- if(TickDuration.ticksPerSec == 1_000_000)
+ if (TickDuration.ticksPerSec == 1_000_000)
{
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
@@ -16707,7 +16707,7 @@ public:
)
+/
Duration opBinary(string op)(in DateTime rhs) @safe const pure nothrow
- if(op == "-")
+ if (op == "-")
{
immutable dateResult = _date - rhs.date;
immutable todResult = _tod - rhs._tod;
@@ -17166,7 +17166,7 @@ public:
+/
@property long julianDay() @safe const pure nothrow
{
- if(_tod._hour < 12)
+ if (_tod._hour < 12)
return _date.julianDay - 1;
else
return _date.julianDay;
@@ -17418,7 +17418,7 @@ public:
or if the resulting $(LREF DateTime) would not be valid.
+/
static DateTime fromISOString(S)(in S isoString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.string : strip;
import std.conv : to;
@@ -17506,7 +17506,7 @@ public:
valid.
+/
static DateTime fromISOExtString(S)(in S isoExtString) @safe pure
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
@@ -17592,7 +17592,7 @@ public:
format or if the resulting $(LREF DateTime) would not be valid.
+/
static DateTime fromSimpleString(S)(in S simpleString) @safe pure
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
@@ -17739,7 +17739,7 @@ private:
auto days = splitUnitsFromHNSecs!"days"(hnsecs);
- if(hnsecs < 0)
+ if (hnsecs < 0)
{
hnsecs += convert!("days", "hnsecs")(1);
--days;
@@ -17974,9 +17974,9 @@ Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
--------------------
+/
this(U)(in TP begin, in U end) pure
- if(is(Unqual!TP == Unqual!U))
+ if (is(Unqual!TP == Unqual!U))
{
- if(!_valid(begin, end))
+ if (!_valid(begin, end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_begin = cast(TP)begin;
@@ -18000,12 +18000,12 @@ assert(Interval!Date(Date(1996, 1, 2), dur!"days"(3)) ==
--------------------
+/
this(D)(in TP begin, in D duration) pure
- if(__traits(compiles, begin + duration))
+ if (__traits(compiles, begin + duration))
{
_begin = cast(TP)begin;
_end = begin + duration;
- if(!_valid(_begin, _end))
+ if (!_valid(_begin, _end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
}
@@ -18060,7 +18060,7 @@ assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).begin ==
+/
@property void begin(TP timePoint) pure
{
- if(!_valid(timePoint, _end))
+ if (!_valid(timePoint, _end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_begin = timePoint;
@@ -18093,7 +18093,7 @@ assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).end ==
+/
@property void end(TP timePoint) pure
{
- if(!_valid(_begin, timePoint))
+ if (!_valid(_begin, timePoint))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_end = timePoint;
@@ -18953,14 +18953,14 @@ assert(interval2 == Interval!Date(Date(1995, 11, 13), Date(2012, 2, 15)));
--------------------
+/
void shift(D)(D duration) pure
- if(__traits(compiles, begin + duration))
+ if (__traits(compiles, begin + duration))
{
_enforceNotEmpty();
auto begin = _begin + duration;
auto end = _end + duration;
- if(!_valid(begin, end))
+ if (!_valid(begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
@@ -18968,7 +18968,7 @@ assert(interval2 == Interval!Date(Date(1995, 11, 13), Date(2012, 2, 15)));
}
- static if(__traits(compiles, begin.add!"months"(1)) &&
+ static if (__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
@@ -19003,7 +19003,7 @@ assert(interval2 == Interval!Date(Date(1994, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
- if(isIntegral!T)
+ if (isIntegral!T)
{
_enforceNotEmpty();
@@ -19050,18 +19050,18 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void expand(D)(D duration, Direction dir = Direction.both) pure
- if(__traits(compiles, begin + duration))
+ if (__traits(compiles, begin + duration))
{
_enforceNotEmpty();
- switch(dir)
+ switch (dir)
{
case Direction.both:
{
auto begin = _begin - duration;
auto end = _end + duration;
- if(!_valid(begin, end))
+ if (!_valid(begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
@@ -19073,7 +19073,7 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
{
auto end = _end + duration;
- if(!_valid(_begin, end))
+ if (!_valid(_begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_end = end;
@@ -19083,7 +19083,7 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
{
auto begin = _begin - duration;
- if(!_valid(begin, _end))
+ if (!_valid(begin, _end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
@@ -19094,7 +19094,7 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
}
}
- static if(__traits(compiles, begin.add!"months"(1)) &&
+ static if (__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
@@ -19128,11 +19128,11 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes, Direction dir = Direction.both)
- if(isIntegral!T)
+ if (isIntegral!T)
{
_enforceNotEmpty();
- switch(dir)
+ switch (dir)
{
case Direction.both:
{
@@ -19235,7 +19235,7 @@ assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date) //For iterating over even-numbered days.
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
@@ -19267,7 +19267,7 @@ assert(range.empty);
auto range = IntervalRange!(TP, Direction.fwd)(this, func);
- if(popFirst == PopFirst.yes)
+ if (popFirst == PopFirst.yes)
range.popFront();
return range;
@@ -19328,7 +19328,7 @@ assert(range.empty);
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date) //For iterating over even-numbered days.
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
@@ -19360,7 +19360,7 @@ assert(range.empty);
auto range = IntervalRange!(TP, Direction.bwd)(this, func);
- if(popFirst == PopFirst.yes)
+ if (popFirst == PopFirst.yes)
range.popFront();
return range;
@@ -19413,7 +19413,7 @@ private:
+/
void _enforceNotEmpty(size_t line = __LINE__) const pure
{
- if(empty)
+ if (empty)
throw new DateTimeException("Invalid operation for an empty Interval.", __FILE__, line);
}
@@ -20750,7 +20750,7 @@ unittest
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date)
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
@@ -20816,7 +20816,7 @@ unittest
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date)
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
@@ -21630,13 +21630,13 @@ assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13)));
--------------------
+/
void shift(D)(D duration) pure nothrow
- if(__traits(compiles, begin + duration))
+ if (__traits(compiles, begin + duration))
{
_begin += duration;
}
- static if(__traits(compiles, begin.add!"months"(1)) &&
+ static if (__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
@@ -21671,7 +21671,7 @@ assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
- if(isIntegral!T)
+ if (isIntegral!T)
{
auto begin = _begin;
@@ -21703,13 +21703,13 @@ assert(interval2 == PosInfInterval!Date(Date(1996, 1, 4)));
--------------------
+/
void expand(D)(D duration) pure nothrow
- if(__traits(compiles, begin + duration))
+ if (__traits(compiles, begin + duration))
{
_begin -= duration;
}
- static if(__traits(compiles, begin.add!"months"(1)) &&
+ static if (__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
@@ -21739,7 +21739,7 @@ assert(interval2 == PosInfInterval!Date(Date(1998, 1, 2)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
- if(isIntegral!T)
+ if (isIntegral!T)
{
auto begin = _begin;
@@ -21805,7 +21805,7 @@ assert(interval2 == PosInfInterval!Date(Date(1998, 1, 2)));
auto interval = PosInfInterval!Date(Date(2010, 9, 1));
auto func = delegate (in Date date) //For iterating over even-numbered days.
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
@@ -21835,7 +21835,7 @@ assert(!range.empty);
{
auto range = PosInfIntervalRange!(TP)(this, func);
- if(popFirst == PopFirst.yes)
+ if (popFirst == PopFirst.yes)
range.popFront();
return range;
@@ -23007,7 +23007,7 @@ unittest
auto interval = PosInfInterval!Date(Date(2010, 9, 1));
auto func = delegate (in Date date)
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
@@ -23837,13 +23837,13 @@ assert(interval2 == NegInfInterval!Date( Date(2012, 2, 15)));
--------------------
+/
void shift(D)(D duration) pure nothrow
- if(__traits(compiles, end + duration))
+ if (__traits(compiles, end + duration))
{
_end += duration;
}
- static if(__traits(compiles, end.add!"months"(1)) &&
+ static if (__traits(compiles, end.add!"months"(1)) &&
__traits(compiles, end.add!"years"(1)))
{
/++
@@ -23877,7 +23877,7 @@ assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
- if(isIntegral!T)
+ if (isIntegral!T)
{
auto end = _end;
@@ -23909,13 +23909,13 @@ assert(interval2 == NegInfInterval!Date(Date(2012, 2, 28)));
--------------------
+/
void expand(D)(D duration) pure nothrow
- if(__traits(compiles, end + duration))
+ if (__traits(compiles, end + duration))
{
_end += duration;
}
- static if(__traits(compiles, end.add!"months"(1)) &&
+ static if (__traits(compiles, end.add!"months"(1)) &&
__traits(compiles, end.add!"years"(1)))
{
/++
@@ -23945,7 +23945,7 @@ assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
- if(isIntegral!T)
+ if (isIntegral!T)
{
auto end = _end;
@@ -24011,7 +24011,7 @@ assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
auto interval = NegInfInterval!Date(Date(2010, 9, 9));
auto func = delegate (in Date date) //For iterating over even-numbered days.
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
@@ -24040,7 +24040,7 @@ assert(!range.empty);
{
auto range = NegInfIntervalRange!(TP)(this, func);
- if(popFirst == PopFirst.yes)
+ if (popFirst == PopFirst.yes)
range.popFront();
return range;
@@ -25220,7 +25220,7 @@ unittest
auto interval = NegInfInterval!Date(Date(2010, 9, 9));
auto func = delegate (in Date date)
{
- if((date.day & 1) == 0)
+ if ((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
@@ -25281,7 +25281,7 @@ unittest
dayOfWeek = The week that each time point in the range will be.
+/
static TP delegate(in TP) everyDayOfWeek(TP, Direction dir = Direction.fwd)(DayOfWeek dayOfWeek) nothrow
- if(isTimePoint!TP &&
+ if (isTimePoint!TP &&
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "dayOfWeek") &&
!__traits(isStaticFunction, TP.dayOfWeek) &&
@@ -25292,7 +25292,7 @@ static TP delegate(in TP) everyDayOfWeek(TP, Direction dir = Direction.fwd)(DayO
TP retval = cast(TP)tp;
immutable days = daysToDayOfWeek(retval.dayOfWeek, dayOfWeek);
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
immutable adjustedDays = days == 0 ? 7 : days;
else
immutable adjustedDays = days == 0 ? -7 : days - 7;
@@ -25385,7 +25385,7 @@ unittest
month = The month that each time point in the range will be in.
+/
static TP delegate(in TP) everyMonth(TP, Direction dir = Direction.fwd)(int month)
- if(isTimePoint!TP &&
+ if (isTimePoint!TP &&
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "month") &&
!__traits(isStaticFunction, TP.month) &&
@@ -25398,14 +25398,14 @@ static TP delegate(in TP) everyMonth(TP, Direction dir = Direction.fwd)(int mont
TP retval = cast(TP)tp;
immutable months = monthsToMonth(retval.month, month);
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
immutable adjustedMonths = months == 0 ? 12 : months;
else
immutable adjustedMonths = months == 0 ? -12 : months - 12;
retval.add!"months"(adjustedMonths, AllowDayOverflow.no);
- if(retval.month != month)
+ if (retval.month != month)
{
retval.add!"months"(-1);
assert(retval.month == month);
@@ -25509,13 +25509,13 @@ unittest
+/
static TP delegate(in TP) everyDuration(TP, Direction dir = Direction.fwd, D)
(D duration) nothrow
- if(isTimePoint!TP &&
+ if (isTimePoint!TP &&
__traits(compiles, TP.init + duration) &&
(dir == Direction.fwd || dir == Direction.bwd))
{
TP func(in TP tp)
{
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
return tp + duration;
else
return tp - duration;
@@ -25612,7 +25612,7 @@ static TP delegate(in TP) everyDuration(TP, Direction dir = Direction.fwd, D)
int months = 0,
AllowDayOverflow allowOverflow = AllowDayOverflow.yes,
D duration = dur!"days"(0)) nothrow
- if(isTimePoint!TP &&
+ if (isTimePoint!TP &&
__traits(compiles, TP.init + duration) &&
__traits(compiles, TP.init.add!"years"(years)) &&
__traits(compiles, TP.init.add!"months"(months)) &&
@@ -25620,7 +25620,7 @@ static TP delegate(in TP) everyDuration(TP, Direction dir = Direction.fwd, D)
{
TP func(in TP tp)
{
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
{
TP retval = cast(TP)tp;
@@ -25765,7 +25765,7 @@ unittest
excluded will treat $(D begin) as included and $(D end) as excluded.
+/
struct IntervalRange(TP, Direction dir)
- if(isTimePoint!TP && dir != Direction.both)
+ if (isTimePoint!TP && dir != Direction.both)
{
public:
@@ -25807,7 +25807,7 @@ public:
{
_enforceNotEmpty();
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
return _interval.begin;
else
return _interval.end;
@@ -25834,11 +25834,11 @@ public:
{
_enforceNotEmpty();
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
{
auto begin = _func(_interval.begin);
- if(begin > _interval.end)
+ if (begin > _interval.end)
begin = _interval.end;
_enforceCorrectDirection(begin);
@@ -25849,7 +25849,7 @@ public:
{
auto end = _func(_interval.end);
- if(end < _interval.begin)
+ if (end < _interval.begin)
end = _interval.begin;
_enforceCorrectDirection(end);
@@ -25916,7 +25916,7 @@ private:
+/
void _enforceNotEmpty(size_t line = __LINE__) const pure
{
- if(empty)
+ if (empty)
throw new DateTimeException("Invalid operation for an empty IntervalRange.", __FILE__, line);
}
@@ -25930,7 +25930,7 @@ private:
{
import std.format : format;
- static if(dir == Direction.fwd)
+ static if (dir == Direction.fwd)
{
enforce(newTP > _interval._begin,
new DateTimeException(format("Generated time point is before previous begin: prev [%s] new [%s]",
@@ -26105,7 +26105,7 @@ unittest
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
- foreach(date; range)
+ foreach (date; range)
{
assert(date == expected);
expected += dur!"days"(7);
@@ -26125,7 +26125,7 @@ unittest
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
- foreach(date; range)
+ foreach (date; range)
{
assert(date == expected);
expected += dur!"days"(-7);
@@ -26263,7 +26263,7 @@ unittest
a $(LREF DateTimeException) will be thrown.
+/
struct PosInfIntervalRange(TP)
- if(isTimePoint!TP)
+ if (isTimePoint!TP)
{
public:
@@ -26474,7 +26474,7 @@ unittest
auto range = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
- foreach(date; take(range, 79))
+ foreach (date; take(range, 79))
{
assert(date == expected);
expected += dur!"days"(7);
@@ -26551,7 +26551,7 @@ unittest
whether $(D end) is included or excluded will treat $(D end) as excluded.
+/
struct NegInfIntervalRange(TP)
- if(isTimePoint!TP)
+ if (isTimePoint!TP)
{
public:
@@ -26762,7 +26762,7 @@ unittest
auto range = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
- foreach(date; take(range, 79))
+ foreach (date; take(range, 79))
{
assert(date == expected);
expected += dur!"days"(-7);
@@ -26960,14 +26960,14 @@ public:
{
import std.format : format;
auto windowsTZName = tzDatabaseNameToWindowsTZName(name);
- if(windowsTZName != null)
+ if (windowsTZName != null)
{
try
return WindowsTimeZone.getTimeZone(windowsTZName);
catch(DateTimeException dte)
{
auto oldName = _getOldName(windowsTZName);
- if(oldName != null)
+ if (oldName != null)
return WindowsTimeZone.getTimeZone(oldName);
throw dte;
}
@@ -26991,7 +26991,7 @@ public:
// time has passed.
private static string _getOldName(string windowsTZName) @safe pure nothrow
{
- switch(windowsTZName)
+ switch (windowsTZName)
{
case "Belarus Standard Time": return "Kaliningrad Standard Time"; // Added 2014-10-08
case "Russia Time Zone 10": return "Magadan Standard Time"; // Added 2014-10-08
@@ -27167,7 +27167,7 @@ public:
else
assert(0, "OS not supported.");
- foreach(i; 0 .. tzs.length)
+ foreach (i; 0 .. tzs.length)
{
auto tz = tzs[i];
immutable spring = dstSwitches[i][2];
@@ -27178,7 +27178,7 @@ public:
//Verify that creating a SysTime in the given time zone results
//in a SysTime with the correct std time during and surrounding
//a DST switch.
- foreach(hour; -12 .. 13)
+ foreach (hour; -12 .. 13)
{
auto st = SysTime(dstSwitches[i][0] + dur!"hours"(hour), tz);
immutable targetHour = hour < 0 ? hour + 24 : hour;
@@ -27204,7 +27204,7 @@ public:
enforce((st + dur!"minutes"(1)).utcOffset == offset, msg("3"));
}
- if(hour == spring)
+ if (hour == spring)
{
testHour(st, spring + 1, tz.name);
testHour(st + dur!"minutes"(1), spring + 1, tz.name);
@@ -27215,7 +27215,7 @@ public:
testHour(st + dur!"minutes"(1), targetHour, tz.name);
}
- if(hour < spring)
+ if (hour < spring)
testOffset1(stdOffset, false);
else
testOffset1(dstOffset, true);
@@ -27224,10 +27224,10 @@ public:
testHour(st, targetHour, tz.name);
//Verify that 01:00 is the first 01:00 (or whatever hour before the switch is).
- if(hour == fall - 1)
+ if (hour == fall - 1)
testHour(st + dur!"hours"(1), targetHour, tz.name);
- if(hour < fall)
+ if (hour < fall)
testOffset1(dstOffset, true);
else
testOffset1(stdOffset, false);
@@ -27242,7 +27242,7 @@ public:
//@@@BUG@@@ 3659 makes this necessary.
auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1);
- foreach(hour; -24 .. 25)
+ foreach (hour; -24 .. 25)
{
auto utc = SysTime(dstSwitches[i][0] + dur!"hours"(hour), UTC());
auto local = utc.toOtherTZ(tz);
@@ -27259,7 +27259,7 @@ public:
enforce((utc + offset + dur!"minutes"(1)).hour == local.hour, msg("2"));
}
- if(utc < springSwitch)
+ if (utc < springSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
@@ -27267,9 +27267,9 @@ public:
utc = SysTime(dstSwitches[i][1] + dur!"hours"(hour), UTC());
local = utc.toOtherTZ(tz);
- if(utc == fallSwitch || utc == fallSwitchMinus1)
+ if (utc == fallSwitch || utc == fallSwitchMinus1)
{
- if(first)
+ if (first)
{
testOffset2(dstOffset);
first = false;
@@ -27277,7 +27277,7 @@ public:
else
testOffset2(stdOffset);
}
- else if(utc > fallSwitch)
+ else if (utc > fallSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
@@ -27320,7 +27320,7 @@ public:
auto windowsNames = WindowsTimeZone.getInstalledTZNames();
auto retval = appender!(string[])();
- foreach(winName; windowsNames)
+ foreach (winName; windowsNames)
{
auto tzName = windowsTZNameToTZDatabaseName(winName);
@@ -27330,7 +27330,7 @@ public:
assert(tzName !is null, format("TZName which is missing: %s", winName));
}
- if(tzName !is null && tzName.startsWith(subName))
+ if (tzName !is null && tzName.startsWith(subName))
retval.put(tzName);
}
@@ -27352,7 +27352,7 @@ public:
// leaving it commented out until I can sort it out.
//assert(equal(tzNames, tzNames.uniq()));
- foreach(tzName; tzNames)
+ foreach (tzName; tzNames)
assertNotThrown!DateTimeException(testPZSuccess(tzName));
}
@@ -27458,16 +27458,16 @@ public:
wchar[32] str;
- foreach(i, ref wchar c; str)
+ foreach (i, ref wchar c; str)
c = tzInfo.StandardName[i];
string retval;
try
{
- foreach(dchar c; str)
+ foreach (dchar c; str)
{
- if(c == '\0')
+ if (c == '\0')
break;
retval ~= c;
@@ -27529,16 +27529,16 @@ public:
wchar[32] str;
- foreach(i, ref wchar c; str)
+ foreach (i, ref wchar c; str)
c = tzInfo.DaylightName[i];
string retval;
try
{
- foreach(dchar c; str)
+ foreach (dchar c; str)
{
- if(c == '\0')
+ if (c == '\0')
break;
retval ~= c;
@@ -27590,7 +27590,7 @@ public:
{
version(Posix)
{
- static if(is(typeof(daylight)))
+ static if (is(typeof(daylight)))
return cast(bool)(daylight);
else
{
@@ -27659,11 +27659,11 @@ public:
else version(Windows)
{
//Apparently Windows isn't smart enough to deal with negative time_t.
- if(unixTime >= 0)
+ if (unixTime >= 0)
{
tm* timeInfo = localtime(&unixTime);
- if(timeInfo)
+ if (timeInfo)
return cast(bool)(timeInfo.tm_isdst);
}
@@ -27743,10 +27743,10 @@ public:
timeInfo = localtime(future > unixTime ? &future : &unixTime);
immutable futureOffset = timeInfo.tm_gmtoff;
- if(pastOffset == futureOffset)
+ if (pastOffset == futureOffset)
return adjTime - convert!("seconds", "hnsecs")(pastOffset);
- if(pastOffset < futureOffset)
+ if (pastOffset < futureOffset)
unixTime -= cast(time_t)convert!("hours", "seconds")(1);
unixTime -= pastOffset;
@@ -27785,7 +27785,7 @@ public:
tuple("Europe/Paris", DateTime(2012, 3, 25), DateTime(2012, 10, 28), 2, 3),
tuple("Australia/Adelaide", DateTime(2012, 10, 7), DateTime(2012, 4, 1), 2, 3)];
- foreach(i; 0 .. tzInfos.length)
+ foreach (i; 0 .. tzInfos.length)
{
auto tzName = tzInfos[i][0];
setTZEnvVar(tzName);
@@ -27797,7 +27797,7 @@ public:
//Verify that creating a SysTime in the given time zone results
//in a SysTime with the correct std time during and surrounding
//a DST switch.
- foreach(hour; -12 .. 13)
+ foreach (hour; -12 .. 13)
{
auto st = SysTime(tzInfos[i][1] + dur!"hours"(hour));
immutable targetHour = hour < 0 ? hour + 24 : hour;
@@ -27823,7 +27823,7 @@ public:
enforce((st + dur!"minutes"(1)).utcOffset == offset, msg("3"));
}
- if(hour == spring)
+ if (hour == spring)
{
testHour(st, spring + 1, tzName);
testHour(st + dur!"minutes"(1), spring + 1, tzName);
@@ -27834,7 +27834,7 @@ public:
testHour(st + dur!"minutes"(1), targetHour, tzName);
}
- if(hour < spring)
+ if (hour < spring)
testOffset1(stdOffset, false);
else
testOffset1(dstOffset, true);
@@ -27843,10 +27843,10 @@ public:
testHour(st, targetHour, tzName);
//Verify that 01:00 is the first 01:00 (or whatever hour before the switch is).
- if(hour == fall - 1)
+ if (hour == fall - 1)
testHour(st + dur!"hours"(1), targetHour, tzName);
- if(hour < fall)
+ if (hour < fall)
testOffset1(dstOffset, true);
else
testOffset1(stdOffset, false);
@@ -27861,7 +27861,7 @@ public:
//@@@BUG@@@ 3659 makes this necessary.
auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1);
- foreach(hour; -24 .. 25)
+ foreach (hour; -24 .. 25)
{
auto utc = SysTime(tzInfos[i][1] + dur!"hours"(hour), UTC());
auto local = utc.toLocalTime();
@@ -27878,7 +27878,7 @@ public:
enforce((utc + offset + dur!"minutes"(1)).hour == local.hour, msg("2"));
}
- if(utc < springSwitch)
+ if (utc < springSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
@@ -27886,9 +27886,9 @@ public:
utc = SysTime(tzInfos[i][2] + dur!"hours"(hour), UTC());
local = utc.toLocalTime();
- if(utc == fallSwitch || utc == fallSwitchMinus1)
+ if (utc == fallSwitch || utc == fallSwitchMinus1)
{
- if(first)
+ if (first)
{
testOffset2(dstOffset);
first = false;
@@ -27896,7 +27896,7 @@ public:
else
testOffset2(stdOffset);
}
- else if(utc > fallSwitch)
+ else if (utc > fallSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
@@ -28312,7 +28312,7 @@ private:
isoString = A string which represents a time zone in the ISO format.
+/
static immutable(SimpleTimeZone) fromISOString(S)(S isoString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.conv : to;
@@ -28331,9 +28331,9 @@ private:
int hours;
int minutes;
- if(dstr.length == 2)
+ if (dstr.length == 2)
hours = to!int(dstr);
- else if(dstr.length == 4)
+ else if (dstr.length == 4)
{
hours = to!int(dstr[0 .. 2]);
minutes = to!int(dstr[2 .. 4]);
@@ -28350,7 +28350,7 @@ private:
{
import std.format : format;
- foreach(str; ["", "Z", "-", "+", "-:", "+:", "-1:", "+1:", "+1", "-1",
+ foreach (str; ["", "Z", "-", "+", "-:", "+:", "-1:", "+1:", "+1", "-1",
"-24:00", "+24:00", "-24", "+24", "-2400", "+2400",
"1", "+1", "-1", "+9", "-9",
"+1:0", "+01:0", "+1:00", "+01:000", "+01:60",
@@ -28369,7 +28369,7 @@ private:
static void test(string str, Duration utcOffset, size_t line = __LINE__)
{
- if(SimpleTimeZone.fromISOString(str).utcOffset !=
+ if (SimpleTimeZone.fromISOString(str).utcOffset !=
(new immutable SimpleTimeZone(utcOffset)).utcOffset)
{
throw new AssertError("unittest failure", __FILE__, line);
@@ -28415,11 +28415,11 @@ private:
static void test(in string isoString, int expectedOffset, size_t line = __LINE__)
{
auto stz = SimpleTimeZone.fromISOExtString(isoString);
- if(stz.utcOffset != dur!"minutes"(expectedOffset))
+ if (stz.utcOffset != dur!"minutes"(expectedOffset))
throw new AssertError(format("unittest failure: wrong offset [%s]", stz.utcOffset), __FILE__, line);
auto result = SimpleTimeZone.toISOExtString(stz.utcOffset);
- if(result != isoString)
+ if (result != isoString)
throw new AssertError(format("unittest failure: [%s] != [%s]", result, isoString), __FILE__, line);
}
@@ -28457,7 +28457,7 @@ private:
isoExtString = A string which represents a time zone in the ISO format.
+/
static immutable(SimpleTimeZone) fromISOExtString(S)(S isoExtString) @safe pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.conv : to;
@@ -28478,7 +28478,7 @@ private:
dstring hoursStr;
dstring minutesStr;
- if(colon != -1)
+ if (colon != -1)
{
hoursStr = dstr[0 .. colon];
minutesStr = dstr[colon + 1 .. $];
@@ -28502,7 +28502,7 @@ private:
{
import std.format : format;
- foreach(str; ["", "Z", "-", "+", "-:", "+:", "-1:", "+1:", "+1", "-1",
+ foreach (str; ["", "Z", "-", "+", "-:", "+:", "-1:", "+1:", "+1", "-1",
"-24:00", "+24:00", "-24", "+24", "-2400", "-2400",
"1", "+1", "-1", "+9", "-9",
"+1:0", "+01:0", "+1:00", "+01:000", "+01:60",
@@ -28521,7 +28521,7 @@ private:
static void test(string str, Duration utcOffset, size_t line = __LINE__)
{
- if(SimpleTimeZone.fromISOExtString(str).utcOffset !=
+ if (SimpleTimeZone.fromISOExtString(str).utcOffset !=
(new immutable SimpleTimeZone(utcOffset)).utcOffset)
{
throw new AssertError("unittest failure", __FILE__, line);
@@ -28567,11 +28567,11 @@ private:
static void test(in string isoExtString, int expectedOffset, size_t line = __LINE__)
{
auto stz = SimpleTimeZone.fromISOExtString(isoExtString);
- if(stz.utcOffset != dur!"minutes"(expectedOffset))
+ if (stz.utcOffset != dur!"minutes"(expectedOffset))
throw new AssertError(format("unittest failure: wrong offset [%s]", stz.utcOffset), __FILE__, line);
auto result = SimpleTimeZone.toISOExtString(stz.utcOffset);
- if(result != isoExtString)
+ if (result != isoExtString)
throw new AssertError(format("unittest failure: [%s] != [%s]", result, isoExtString), __FILE__, line);
}
@@ -28668,7 +28668,7 @@ public:
immutable unixTime = stdTimeToUnixTime(stdTime);
immutable found = countUntil!"b < a.timeT"(_transitions, unixTime);
- if(found == -1)
+ if (found == -1)
return _transitions.back.ttInfo.isDST;
immutable transition = found == 0 ? _transitions[0] : _transitions[found - 1];
@@ -28693,7 +28693,7 @@ public:
immutable unixTime = stdTimeToUnixTime(stdTime);
immutable found = countUntil!"b < a.timeT"(_transitions, unixTime);
- if(found == -1)
+ if (found == -1)
return stdTime + convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable transition = found == 0 ? _transitions[0] : _transitions[found - 1];
@@ -28721,25 +28721,25 @@ public:
immutable pastFound = countUntil!"b < a.timeT"(_transitions, past);
- if(pastFound == -1)
+ if (pastFound == -1)
return adjTime - convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable futureFound = countUntil!"b < a.timeT"(_transitions[pastFound .. $], future);
immutable pastTrans = pastFound == 0 ? _transitions[0] : _transitions[pastFound - 1];
- if(futureFound == 0)
+ if (futureFound == 0)
return adjTime - convert!("seconds", "hnsecs")(pastTrans.ttInfo.utcOffset + leapSecs);
immutable futureTrans = futureFound == -1 ? _transitions.back
: _transitions[pastFound + futureFound - 1];
immutable pastOffset = pastTrans.ttInfo.utcOffset;
- if(pastOffset < futureTrans.ttInfo.utcOffset)
+ if (pastOffset < futureTrans.ttInfo.utcOffset)
unixTime -= convert!("hours", "seconds")(1);
immutable found = countUntil!"b < a.timeT"(_transitions[pastFound .. $], unixTime - pastOffset);
- if(found == -1)
+ if (found == -1)
return adjTime - convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable transition = found == 0 ? pastTrans : _transitions[pastFound + found - 1];
@@ -28836,9 +28836,9 @@ public:
auto zeroBlock = readVal!(ubyte[])(tzFile, 15);
bool allZeroes = true;
- foreach(val; zeroBlock)
+ foreach (val; zeroBlock)
{
- if(val != 0)
+ if (val != 0)
{
allZeroes = false;
break;
@@ -28870,25 +28870,25 @@ public:
//time_ts where DST transitions occur.
auto transitionTimeTs = new long[](tzh_timecnt);
- foreach(ref transition; transitionTimeTs)
+ foreach (ref transition; transitionTimeTs)
transition = readVal!int(tzFile);
//Indices into ttinfo structs indicating the changes
//to be made at the corresponding DST transition.
auto ttInfoIndices = new ubyte[](tzh_timecnt);
- foreach(ref ttInfoIndex; ttInfoIndices)
+ foreach (ref ttInfoIndex; ttInfoIndices)
ttInfoIndex = readVal!ubyte(tzFile);
//ttinfos which give info on DST transitions.
auto tempTTInfos = new TempTTInfo[](tzh_typecnt);
- foreach(ref ttInfo; tempTTInfos)
+ foreach (ref ttInfo; tempTTInfos)
ttInfo = readVal!TempTTInfo(tzFile);
//The array of time zone abbreviation characters.
auto tzAbbrevChars = readVal!(char[])(tzFile, tzh_charcnt);
auto leapSeconds = new LeapSecond[](tzh_leapcnt);
- foreach(ref leapSecond; leapSeconds)
+ foreach (ref leapSecond; leapSeconds)
{
//The time_t when the leap second occurs.
auto timeT = readVal!int(tzFile);
@@ -28903,19 +28903,19 @@ public:
//Indicate whether each corresponding DST transition were specified
//in standard time or wall clock time.
auto transitionIsStd = new bool[](tzh_ttisstdcnt);
- foreach(ref isStd; transitionIsStd)
+ foreach (ref isStd; transitionIsStd)
isStd = readVal!bool(tzFile);
//Indicate whether each corresponding DST transition associated with
//local time types are specified in UTC or local time.
auto transitionInUTC = new bool[](tzh_ttisgmtcnt);
- foreach(ref inUTC; transitionInUTC)
+ foreach (ref inUTC; transitionInUTC)
inUTC = readVal!bool(tzFile);
_enforceValidTZFile(!tzFile.eof);
//If version 2 or 3, the information is duplicated in 64-bit.
- if(tzFileVersion == '2' || tzFileVersion == '3')
+ if (tzFileVersion == '2' || tzFileVersion == '3')
{
_enforceValidTZFile(readVal!(char[])(tzFile, 4) == "TZif");
@@ -28926,9 +28926,9 @@ public:
auto zeroBlock = readVal!(ubyte[])(tzFile, 15);
bool allZeroes = true;
- foreach(val; zeroBlock)
+ foreach (val; zeroBlock)
{
- if(val != 0)
+ if (val != 0)
{
allZeroes = false;
break;
@@ -28960,25 +28960,25 @@ public:
//time_ts where DST transitions occur.
transitionTimeTs = new long[](tzh_timecnt);
- foreach(ref transition; transitionTimeTs)
+ foreach (ref transition; transitionTimeTs)
transition = readVal!long(tzFile);
//Indices into ttinfo structs indicating the changes
//to be made at the corresponding DST transition.
ttInfoIndices = new ubyte[](tzh_timecnt);
- foreach(ref ttInfoIndex; ttInfoIndices)
+ foreach (ref ttInfoIndex; ttInfoIndices)
ttInfoIndex = readVal!ubyte(tzFile);
//ttinfos which give info on DST transitions.
tempTTInfos = new TempTTInfo[](tzh_typecnt);
- foreach(ref ttInfo; tempTTInfos)
+ foreach (ref ttInfo; tempTTInfos)
ttInfo = readVal!TempTTInfo(tzFile);
//The array of time zone abbreviation characters.
tzAbbrevChars = readVal!(char[])(tzFile, tzh_charcnt);
leapSeconds = new LeapSecond[](tzh_leapcnt);
- foreach(ref leapSecond; leapSeconds)
+ foreach (ref leapSecond; leapSeconds)
{
//The time_t when the leap second occurs.
auto timeT = readVal!long(tzFile);
@@ -28993,13 +28993,13 @@ public:
//Indicate whether each corresponding DST transition were specified
//in standard time or wall clock time.
transitionIsStd = new bool[](tzh_ttisstdcnt);
- foreach(ref isStd; transitionIsStd)
+ foreach (ref isStd; transitionIsStd)
isStd = readVal!bool(tzFile);
//Indicate whether each corresponding DST transition associated with
//local time types are specified in UTC or local time.
transitionInUTC = new bool[](tzh_ttisgmtcnt);
- foreach(ref inUTC; transitionInUTC)
+ foreach (ref inUTC; transitionInUTC)
inUTC = readVal!bool(tzFile);
}
@@ -29021,27 +29021,27 @@ public:
auto transitionTypes = new TransitionType*[](tempTTInfos.length);
- foreach(i, ref ttype; transitionTypes)
+ foreach (i, ref ttype; transitionTypes)
{
bool isStd = false;
- if(i < transitionIsStd.length && !transitionIsStd.empty)
+ if (i < transitionIsStd.length && !transitionIsStd.empty)
isStd = transitionIsStd[i];
bool inUTC = false;
- if(i < transitionInUTC.length && !transitionInUTC.empty)
+ if (i < transitionInUTC.length && !transitionInUTC.empty)
inUTC = transitionInUTC[i];
ttype = new TransitionType(isStd, inUTC);
}
auto ttInfos = new immutable(TTInfo)*[](tempTTInfos.length);
- foreach(i, ref ttInfo; ttInfos)
+ foreach (i, ref ttInfo; ttInfos)
{
auto tempTTInfo = tempTTInfos[i];
- if(gmtZone)
+ if (gmtZone)
tempTTInfo.tt_gmtoff = -tempTTInfo.tt_gmtoff;
auto abbrevChars = tzAbbrevChars[tempTTInfo.tt_abbrind .. $];
@@ -29051,7 +29051,7 @@ public:
}
auto tempTransitions = new TempTransition[](transitionTimeTs.length);
- foreach(i, ref tempTransition; tempTransitions)
+ foreach (i, ref tempTransition; tempTransitions)
{
immutable ttiIndex = ttInfoIndices[i];
auto transitionTimeT = transitionTimeTs[i];
@@ -29061,7 +29061,7 @@ public:
tempTransition = TempTransition(transitionTimeT, ttInfo, ttype);
}
- if(tempTransitions.empty)
+ if (tempTransitions.empty)
{
_enforceValidTZFile(ttInfos.length == 1 && transitionTypes.length == 1);
tempTransitions ~= TempTransition(0, ttInfos[0], transitionTypes[0]);
@@ -29071,7 +29071,7 @@ public:
sort!"a.timeT < b.timeT"(leapSeconds);
auto transitions = new Transition[](tempTransitions.length);
- foreach(i, ref transition; transitions)
+ foreach (i, ref transition; transitions)
{
auto tempTransition = tempTransitions[i];
auto transitionTimeT = tempTransition.timeT;
@@ -29087,24 +29087,24 @@ public:
string dstName;
bool hasDST = false;
- foreach(transition; retro(transitions))
+ foreach (transition; retro(transitions))
{
auto ttInfo = transition.ttInfo;
- if(ttInfo.isDST)
+ if (ttInfo.isDST)
{
- if(dstName.empty)
+ if (dstName.empty)
dstName = ttInfo.abbrev;
hasDST = true;
}
else
{
- if(stdName.empty)
+ if (stdName.empty)
stdName = ttInfo.abbrev;
}
- if(!stdName.empty && !dstName.empty)
+ if (!stdName.empty && !dstName.empty)
break;
}
@@ -29175,13 +29175,13 @@ public:
}
else
{
- foreach(DirEntry dentry; dirEntries(tzDatabaseDir, SpanMode.depth))
+ foreach (DirEntry dentry; dirEntries(tzDatabaseDir, SpanMode.depth))
{
- if(dentry.isFile)
+ if (dentry.isFile)
{
auto tzName = dentry.name[tzDatabaseDir.length .. $];
- if(!tzName.extension().empty ||
+ if (!tzName.extension().empty ||
!tzName.startsWith(subName) ||
tzName == "leapseconds" ||
tzName == "+VERSION")
@@ -29217,18 +29217,18 @@ public:
auto tzNames = getInstalledTZNames();
- foreach(tzName; tzNames)
+ foreach (tzName; tzNames)
assertNotThrown!DateTimeException(testPTZSuccess(tzName));
// No timezone directories on Android, just a single tzdata file
version(Android) {} else
- foreach(DirEntry dentry; dirEntries(defaultTZDatabaseDir, SpanMode.depth))
+ foreach (DirEntry dentry; dirEntries(defaultTZDatabaseDir, SpanMode.depth))
{
- if(dentry.isFile)
+ if (dentry.isFile)
{
auto tzName = dentry.name[defaultTZDatabaseDir.length .. $];
- if(!canFind(tzNames, tzName))
+ if (!canFind(tzNames, tzName))
assertThrown!DateTimeException(testPTZFailure(tzName));
}
}
@@ -29353,7 +29353,7 @@ private:
Reads an int from a TZ file.
+/
static T readVal(T)(ref File tzFile) @trusted
- if((isIntegral!T || isSomeChar!T) || is(Unqual!T == bool))
+ if ((isIntegral!T || isSomeChar!T) || is(Unqual!T == bool))
{
import std.bitmanip;
T[1] buff;
@@ -29368,7 +29368,7 @@ private:
Reads an array of values from a TZ file.
+/
static T readVal(T)(ref File tzFile, size_t length) @trusted
- if(isArray!T)
+ if (isArray!T)
{
auto buff = new T(length);
@@ -29383,7 +29383,7 @@ private:
Reads a $(D TempTTInfo) from a TZ file.
+/
static T readVal(T)(ref File tzFile) @safe
- if(is(T == TempTTInfo))
+ if (is(T == TempTTInfo))
{
return TempTTInfo(readVal!int(tzFile),
readVal!bool(tzFile),
@@ -29397,24 +29397,24 @@ private:
+/
static void _enforceValidTZFile(bool result, size_t line = __LINE__) @safe pure
{
- if(!result)
+ if (!result)
throw new DateTimeException("Not a valid tzdata file.", __FILE__, line);
}
int calculateLeapSeconds(long stdTime) @safe const pure nothrow
{
- if(_leapSeconds.empty)
+ if (_leapSeconds.empty)
return 0;
immutable unixTime = stdTimeToUnixTime(stdTime);
- if(_leapSeconds.front.timeT >= unixTime)
+ if (_leapSeconds.front.timeT >= unixTime)
return 0;
immutable found = countUntil!"b < a.timeT"(_leapSeconds, unixTime);
- if(found == -1)
+ if (found == -1)
return _leapSeconds.back.total;
immutable leapSecond = found == 0 ? _leapSeconds[0] : _leapSeconds[found - 1];
@@ -29430,20 +29430,20 @@ private:
string dstName,
bool hasDST) @safe immutable pure
{
- if(dstName.empty && !stdName.empty)
+ if (dstName.empty && !stdName.empty)
dstName = stdName;
- else if(stdName.empty && !dstName.empty)
+ else if (stdName.empty && !dstName.empty)
stdName = dstName;
super(name, stdName, dstName);
- if(!transitions.empty)
+ if (!transitions.empty)
{
- foreach(i, transition; transitions[0 .. $-1])
+ foreach (i, transition; transitions[0 .. $-1])
_enforceValidTZFile(transition.timeT < transitions[i + 1].timeT);
}
- foreach(i, leapSecond; leapSeconds)
+ foreach (i, leapSecond; leapSeconds)
_enforceValidTZFile(i == leapSeconds.length - 1 || leapSecond.timeT < leapSeconds[i + 1].timeT);
_transitions = transitions;
@@ -29485,7 +29485,7 @@ private:
// Check for the combined file tzdata, which stores the index
// and the time zone data together.
- if(combinedFile.exists() && combinedFile.isFile)
+ if (combinedFile.exists() && combinedFile.isFile)
{
tzFile = File(combinedFile);
_enforceValidTZFile(readVal!(char[])(tzFile, 6) == "tzdata");
@@ -29499,7 +29499,7 @@ private:
indexEntries = (dataOffset - indexOffset)/indexEntrySize;
separate_index = false;
}
- else if(indexFile.exists() && indexFile.isFile)
+ else if (indexFile.exists() && indexFile.isFile)
{
tzFile = File(indexFile);
indexEntries = to!(uint)(tzFile.size/indexEntrySize);
@@ -29509,7 +29509,7 @@ private:
throw new DateTimeException(format("Both timezone files %s and %s do not exist.",
combinedFile, indexFile));
- foreach(Unused; 0 .. indexEntries) {
+ foreach (Unused; 0 .. indexEntries) {
string tzName = to!string(readVal!(char[])(tzFile, 40).ptr);
uint tzOffset = readVal!uint(tzFile);
readVal!(uint[])(tzFile, 2);
@@ -29773,7 +29773,7 @@ else version(Windows)
auto tzNames = getInstalledTZNames();
- foreach(tzName; tzNames)
+ foreach (tzName; tzNames)
assertNotThrown!DateTimeException(testWTZSuccess(tzName));
}
@@ -29784,22 +29784,22 @@ else version(Windows)
{
try
{
- if(tzInfo.DaylightDate.wMonth == 0)
+ if (tzInfo.DaylightDate.wMonth == 0)
return false;
auto utcDateTime = cast(DateTime)SysTime(stdTime, UTC());
//The limits of what SystemTimeToTzSpecificLocalTime will accept.
- if(utcDateTime.year < 1601)
+ if (utcDateTime.year < 1601)
{
- if(utcDateTime.month == Month.feb && utcDateTime.day == 29)
+ if (utcDateTime.month == Month.feb && utcDateTime.day == 29)
utcDateTime.day = 28;
utcDateTime.year = 1601;
}
- else if(utcDateTime.year > 30_827)
+ else if (utcDateTime.year > 30_827)
{
- if(utcDateTime.month == Month.feb && utcDateTime.day == 29)
+ if (utcDateTime.month == Month.feb && utcDateTime.day == 29)
utcDateTime.day = 28;
utcDateTime.year = 30_827;
@@ -29809,12 +29809,12 @@ else version(Windows)
//beginning or end of the year (bleh). Unless some bizarre time
//zone changes DST on January 1st or December 31st, this should
//fix the problem.
- if(utcDateTime.month == Month.jan)
+ if (utcDateTime.month == Month.jan)
{
- if(utcDateTime.day == 1)
+ if (utcDateTime.day == 1)
utcDateTime.day = 2;
}
- else if(utcDateTime.month == Month.dec && utcDateTime.day == 31)
+ else if (utcDateTime.month == Month.dec && utcDateTime.day == 31)
utcDateTime.day = 30;
SYSTEMTIME utcTime = void;
@@ -29842,7 +29842,7 @@ else version(Windows)
immutable diff = utcDateTime - otherDateTime;
immutable minutes = diff.total!"minutes" - tzInfo.Bias;
- if(minutes == tzInfo.DaylightBias)
+ if (minutes == tzInfo.DaylightBias)
return true;
assert(minutes == tzInfo.StandardBias);
@@ -29858,14 +29858,14 @@ else version(Windows)
TIME_ZONE_INFORMATION tzInfo;
GetTimeZoneInformation(&tzInfo);
- foreach(year; [1600, 1601, 30_827, 30_828])
+ foreach (year; [1600, 1601, 30_827, 30_828])
WindowsTimeZone._dstInEffect(&tzInfo, SysTime(DateTime(year, 1, 1)).stdTime);
}
static long _utcToTZ(const TIME_ZONE_INFORMATION* tzInfo, long stdTime, bool hasDST) @safe nothrow
{
- if(hasDST && WindowsTimeZone._dstInEffect(tzInfo, stdTime))
+ if (hasDST && WindowsTimeZone._dstInEffect(tzInfo, stdTime))
return stdTime - convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.DaylightBias);
return stdTime - convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.StandardBias);
@@ -29874,23 +29874,23 @@ else version(Windows)
static long _tzToUTC(const TIME_ZONE_INFORMATION* tzInfo, long adjTime, bool hasDST) @trusted nothrow
{
- if(hasDST)
+ if (hasDST)
{
try
{
bool dstInEffectForLocalDateTime(DateTime localDateTime)
{
//The limits of what SystemTimeToTzSpecificLocalTime will accept.
- if(localDateTime.year < 1601)
+ if (localDateTime.year < 1601)
{
- if(localDateTime.month == Month.feb && localDateTime.day == 29)
+ if (localDateTime.month == Month.feb && localDateTime.day == 29)
localDateTime.day = 28;
localDateTime.year = 1601;
}
- else if(localDateTime.year > 30_827)
+ else if (localDateTime.year > 30_827)
{
- if(localDateTime.month == Month.feb && localDateTime.day == 29)
+ if (localDateTime.month == Month.feb && localDateTime.day == 29)
localDateTime.day = 28;
localDateTime.year = 30_827;
@@ -29900,12 +29900,12 @@ else version(Windows)
//beginning or end of the year (bleh). Unless some bizarre time
//zone changes DST on January 1st or December 31st, this should
//fix the problem.
- if(localDateTime.month == Month.jan)
+ if (localDateTime.month == Month.jan)
{
- if(localDateTime.day == 1)
+ if (localDateTime.day == 1)
localDateTime.day = 2;
}
- else if(localDateTime.month == Month.dec && localDateTime.day == 31)
+ else if (localDateTime.month == Month.dec && localDateTime.day == 31)
localDateTime.day = 30;
SYSTEMTIME utcTime = void;
@@ -29934,7 +29934,7 @@ else version(Windows)
immutable diff = localDateTime - utcDateTime;
immutable minutes = -tzInfo.Bias - diff.total!"minutes";
- if(minutes == tzInfo.DaylightBias)
+ if (minutes == tzInfo.DaylightBias)
return true;
assert(minutes == tzInfo.StandardBias);
@@ -29952,18 +29952,18 @@ else version(Windows)
bool isDST;
- if(dstInEffectBefore && dstInEffectNow && dstInEffectAfter)
+ if (dstInEffectBefore && dstInEffectNow && dstInEffectAfter)
isDST = true;
- else if(!dstInEffectBefore && !dstInEffectNow && !dstInEffectAfter)
+ else if (!dstInEffectBefore && !dstInEffectNow && !dstInEffectAfter)
isDST = false;
- else if(!dstInEffectBefore && dstInEffectAfter)
+ else if (!dstInEffectBefore && dstInEffectAfter)
isDST = false;
- else if(dstInEffectBefore && !dstInEffectAfter)
+ else if (dstInEffectBefore && !dstInEffectAfter)
isDST = dstInEffectNow;
else
assert(0, "Bad Logic.");
- if(isDST)
+ if (isDST)
return adjTime + convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.DaylightBias);
}
catch(Exception e)
@@ -30113,13 +30113,13 @@ TZConversions parseTZConversions(string windowsZonesXMLText) @safe pure
immutable f1 = `
line = line.find(f1);
- if(line.empty)
+ if (line.empty)
continue;
line = line[f1.length .. $];
auto next = line.find('"');
@@ -30132,23 +30132,23 @@ TZConversions parseTZConversions(string windowsZonesXMLText) @safe pure
enforce(!next.empty, "Error parsing. Text does not appear to be from windowsZones.xml");
auto nixes = line[0 .. $ - next.length].split();
- if(auto n = win in win2Nix)
+ if (auto n = win in win2Nix)
*n ~= nixes;
else
win2Nix[win] = nixes;
- foreach(nix; nixes)
+ foreach (nix; nixes)
{
- if(auto w = nix in nix2Win)
+ if (auto w = nix in nix2Win)
*w ~= win;
else
nix2Win[nix] = [win];
}
}
- foreach(key, ref value; nix2Win)
+ foreach (key, ref value; nix2Win)
value = value.sort().uniq().array();
- foreach(key, ref value; win2Nix)
+ foreach (key, ref value; win2Nix)
value = value.sort().uniq().array();
return TZConversions(nix2Win, win2Nix);
@@ -30227,7 +30227,7 @@ For terms of use, see http://www.unicode.org/copyright.html
assert(tzConversions.fromWindows["UTC-11"] ==
["Etc/GMT+11", "Pacific/Midway", "Pacific/Niue", "Pacific/Pago_Pago"]);
- foreach(key, value; tzConversions.fromWindows)
+ foreach (key, value; tzConversions.fromWindows)
{
assert(value.isSorted, key);
assert(equal(value.uniq(), value), key);
@@ -30264,7 +30264,7 @@ For terms of use, see http://www.unicode.org/copyright.html
+/
string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc
{
- switch(tzName)
+ switch (tzName)
{
case "Africa/Abidjan": return "Greenwich Standard Time";
case "Africa/Accra": return "Greenwich Standard Time";
@@ -30707,7 +30707,7 @@ string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc
version(Windows) unittest
{
import std.format : format;
- foreach(tzName; TimeZone.getInstalledTZNames())
+ foreach (tzName; TimeZone.getInstalledTZNames())
assert(tzDatabaseNameToWindowsTZName(tzName) !is null, format("TZName which failed: %s", tzName));
}
@@ -30732,7 +30732,7 @@ version(Windows) unittest
+/
string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc
{
- switch(tzName)
+ switch (tzName)
{
case "AUS Central Standard Time": return "Australia/Darwin";
case "AUS Eastern Standard Time": return "Australia/Sydney";
@@ -30863,7 +30863,7 @@ string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc
version(Windows) unittest
{
import std.format : format;
- foreach(tzName; WindowsTimeZone.getInstalledTZNames())
+ foreach (tzName; WindowsTimeZone.getInstalledTZNames())
assert(windowsTZNameToTZDatabaseName(tzName) !is null, format("TZName which failed: %s", tzName));
}
@@ -30894,7 +30894,7 @@ public:
+/
this(AutoStart autostart)
{
- if(autostart)
+ if (autostart)
start();
}
@@ -30924,7 +30924,7 @@ public:
+/
void reset()
{
- if(_flagStarted)
+ if (_flagStarted)
{
// Set current system time if StopWatch is measuring.
_timeStart = TickDuration.currSystemTick;
@@ -31007,7 +31007,7 @@ public:
+/
TickDuration peek() const
{
- if(_flagStarted)
+ if (_flagStarted)
return TickDuration.currSystemTick - _timeStart + _timeMeasured;
return _timeMeasured;
@@ -31096,10 +31096,10 @@ private:
enum n = 100;
TickDuration[n] times;
TickDuration last = TickDuration.from!"seconds"(0);
- foreach(i; 0..n)
+ foreach (i; 0..n)
{
sw.start(); //start/resume mesuring.
- foreach(unused; 0..1_000_000)
+ foreach (unused; 0..1_000_000)
bar();
sw.stop(); //stop/pause measuring.
//Return value of peek() after having stopped are the always same.
@@ -31112,7 +31112,7 @@ private:
// To get the number of seconds,
// use properties of TickDuration.
// (seconds, msecs, usecs, hnsecs)
- foreach(t; times)
+ foreach (t; times)
sum += t.hnsecs;
writeln("Average time: ", sum/n, " hnsecs");
}
@@ -31145,10 +31145,10 @@ TickDuration[fun.length] benchmark(fun...)(uint n)
StopWatch sw;
sw.start();
- foreach(i, unused; fun)
+ foreach (i, unused; fun)
{
sw.reset();
- foreach(j; 0 .. n)
+ foreach (j; 0 .. n)
fun[i]();
result[i] = sw.peek();
}
@@ -31353,13 +31353,13 @@ unittest
{
import std.meta : AliasSeq;
- foreach(TP; AliasSeq!(Date, DateTime, SysTime, TimeOfDay))
+ foreach (TP; AliasSeq!(Date, DateTime, SysTime, TimeOfDay))
{
static assert(isTimePoint!(const TP), TP.stringof);
static assert(isTimePoint!(immutable TP), TP.stringof);
}
- foreach(T; AliasSeq!(float, string, Duration, Interval!Date, PosInfInterval!Date, NegInfInterval!Date))
+ foreach (T; AliasSeq!(float, string, Duration, Interval!Date, PosInfInterval!Date, NegInfInterval!Date))
static assert(!isTimePoint!T, T.stringof);
}
@@ -31372,10 +31372,10 @@ unittest
+/
static bool yearIsLeapYear(int year) @safe pure nothrow
{
- if(year % 400 == 0)
+ if (year % 400 == 0)
return true;
- if(year % 100 == 0)
+ if (year % 100 == 0)
return false;
return year % 4 == 0;
@@ -31384,14 +31384,14 @@ static bool yearIsLeapYear(int year) @safe pure nothrow
unittest
{
import std.format : format;
- foreach(year; [1, 2, 3, 5, 6, 7, 100, 200, 300, 500, 600, 700, 1998, 1999,
+ foreach (year; [1, 2, 3, 5, 6, 7, 100, 200, 300, 500, 600, 700, 1998, 1999,
2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011])
{
assert(!yearIsLeapYear(year), format("year: %s.", year));
assert(!yearIsLeapYear(-year), format("year: %s.", year));
}
- foreach(year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012])
+ foreach (year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012])
{
assert(yearIsLeapYear(year), format("year: %s.", year));
assert(yearIsLeapYear(-year), format("year: %s.", year));
@@ -31457,7 +31457,7 @@ unittest
assert(unixTimeToStdTime(0) == (Date(1970, 1, 1) - Date(1, 1, 1)).total!"hnsecs");
assert(unixTimeToStdTime(0) == (DateTime(1970, 1, 1) - DateTime(1, 1, 1)).total!"hnsecs");
- foreach(dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
+ foreach (dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
assert(unixTimeToStdTime((dt - DateTime(1970, 1, 1)).total!"seconds") == (dt - DateTime.init).total!"hnsecs");
}
@@ -31507,18 +31507,18 @@ unittest
SysTime.toUnixTime
+/
T stdTimeToUnixTime(T = time_t)(long stdTime) @safe pure nothrow
- if(is(T == int) || is(T == long))
+ if (is(T == int) || is(T == long))
{
immutable unixTime = convert!("hnsecs", "seconds")(stdTime - 621_355_968_000_000_000L);
static assert(is(time_t == int) || is(time_t == long),
"Currently, std.datetime only supports systems where time_t is int or long");
- static if(is(T == long))
+ static if (is(T == long))
return unixTime;
- else static if(is(T == int))
+ else static if (is(T == int))
{
- if(unixTime > int.max)
+ if (unixTime > int.max)
return int.max;
return unixTime < int.min ? int.min : cast(int)unixTime;
}
@@ -31546,7 +31546,7 @@ unittest
assert(stdTimeToUnixTime((Date(1970, 1, 1) - Date(1, 1, 1)).total!"hnsecs") == 0);
assert(stdTimeToUnixTime((DateTime(1970, 1, 1) - DateTime(1, 1, 1)).total!"hnsecs") == 0);
- foreach(dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
+ foreach (dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
assert(stdTimeToUnixTime((dt - DateTime.init).total!"hnsecs") == (dt - DateTime(1970, 1, 1)).total!"seconds");
enum max = convert!("seconds", "hnsecs")(int.max);
@@ -31697,31 +31697,31 @@ else version(Windows)
throw new DateTimeException("The given SYSTEMTIME is for a date greater than SysTime.max.");
}
- if(st.wYear > max.year)
+ if (st.wYear > max.year)
throwLaterThanMax();
- else if(st.wYear == max.year)
+ else if (st.wYear == max.year)
{
- if(st.wMonth > max.month)
+ if (st.wMonth > max.month)
throwLaterThanMax();
- else if(st.wMonth == max.month)
+ else if (st.wMonth == max.month)
{
- if(st.wDay > max.day)
+ if (st.wDay > max.day)
throwLaterThanMax();
- else if(st.wDay == max.day)
+ else if (st.wDay == max.day)
{
- if(st.wHour > max.hour)
+ if (st.wHour > max.hour)
throwLaterThanMax();
- else if(st.wHour == max.hour)
+ else if (st.wHour == max.hour)
{
- if(st.wMinute > max.minute)
+ if (st.wMinute > max.minute)
throwLaterThanMax();
- else if(st.wMinute == max.minute)
+ else if (st.wMinute == max.minute)
{
- if(st.wSecond > max.second)
+ if (st.wSecond > max.second)
throwLaterThanMax();
- else if(st.wSecond == max.second)
+ else if (st.wSecond == max.second)
{
- if(st.wMilliseconds > max.fracSecs.total!"msecs")
+ if (st.wMilliseconds > max.fracSecs.total!"msecs")
throwLaterThanMax();
}
}
@@ -31751,7 +31751,7 @@ else version(Windows)
{
immutable dt = cast(DateTime)sysTime;
- if(dt.year < 1601)
+ if (dt.year < 1601)
throw new DateTimeException("SYSTEMTIME cannot hold dates prior to the year 1601.");
SYSTEMTIME st;
@@ -31795,7 +31795,7 @@ else version(Windows)
ul.LowPart = ft.dwLowDateTime;
ulong tempHNSecs = ul.QuadPart;
- if(tempHNSecs > long.max - hnsecsFrom1601)
+ if (tempHNSecs > long.max - hnsecsFrom1601)
throw new DateTimeException("The given FILETIME cannot be represented as a stdTime value.");
return cast(long)tempHNSecs + hnsecsFrom1601;
@@ -31826,7 +31826,7 @@ else version(Windows)
FILETIME stdTimeToFILETIME(long stdTime) @safe
{
- if(stdTime < hnsecsFrom1601)
+ if (stdTime < hnsecsFrom1601)
throw new DateTimeException("The given stdTime value cannot be represented as a FILETIME.");
ULARGE_INTEGER ul;
@@ -31880,7 +31880,7 @@ SysTime DosFileTimeToSysTime(DosFileTime dft, immutable TimeZone tz = LocalTime(
{
uint dt = cast(uint)dft;
- if(dt == 0)
+ if (dt == 0)
throw new DateTimeException("Invalid DosFileTime.");
int year = ((dt >> 25) & 0x7F) + 1980;
@@ -31923,10 +31923,10 @@ DosFileTime SysTimeToDosFileTime(SysTime sysTime) @safe
{
auto dateTime = cast(DateTime)sysTime;
- if(dateTime.year < 1980)
+ if (dateTime.year < 1980)
throw new DateTimeException("DOS File Times cannot hold dates prior to 1980.");
- if(dateTime.year > 2107)
+ if (dateTime.year > 2107)
throw new DateTimeException("DOS File Times cannot hold dates past 2107.");
uint retval = 0;
@@ -31995,7 +31995,7 @@ SysTime parseRFC822DateTime()(in char[] value) @safe
/++ Ditto +/
SysTime parseRFC822DateTime(R)(R value) @safe
- if(isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
+ if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
(is(Unqual!(ElementType!R) == char) || is(Unqual!(ElementType!R) == ubyte)))
{
import std.functional : not;
@@ -32008,12 +32008,12 @@ SysTime parseRFC822DateTime(R)(R value) @safe
void stripAndCheckLen(R valueBefore, size_t minLen, size_t line = __LINE__)
{
value = _stripCFWS(valueBefore);
- if(value.length < minLen)
+ if (value.length < minLen)
throw new DateTimeException("date-time value too short", __FILE__, line);
}
stripAndCheckLen(value, "7Dec1200:00A".length);
- static if(isArray!R && (is(ElementEncodingType!R == char) || is(ElementEncodingType!R == ubyte)))
+ static if (isArray!R && (is(ElementEncodingType!R == char) || is(ElementEncodingType!R == ubyte)))
{
static string sliceAsString(R str) @trusted
{
@@ -32026,19 +32026,19 @@ SysTime parseRFC822DateTime(R)(R value) @safe
char[] sliceAsString(R str) @trusted
{
size_t i = 0;
- foreach(c; str)
+ foreach (c; str)
temp[i++] = cast(char)c;
return temp[0 .. str.length];
}
}
// day-of-week
- if(isAlpha(value[0]))
+ if (isAlpha(value[0]))
{
auto dowStr = sliceAsString(value[0 .. 3]);
- switch(dowStr)
+ switch (dowStr)
{
- foreach(dow; EnumMembers!DayOfWeek)
+ foreach (dow; EnumMembers!DayOfWeek)
{
enum dowC = capitalize(to!string(dow));
case dowC:
@@ -32047,7 +32047,7 @@ SysTime parseRFC822DateTime(R)(R value) @safe
default: throw new DateTimeException(format("Invalid day-of-week: %s", dowStr));
}
afterDoW: stripAndCheckLen(value[3 .. value.length], ",7Dec1200:00A".length);
- if(value[0] != ',')
+ if (value[0] != ',')
throw new DateTimeException("day-of-week missing comma");
stripAndCheckLen(value[1 .. value.length], "7Dec1200:00A".length);
}
@@ -32055,7 +32055,7 @@ afterDoW: stripAndCheckLen(value[3 .. value.length], ",7Dec1200:00A".length);
// day
immutable digits = isDigit(value[1]) ? 2 : 1;
immutable day = _convDigits!short(value[0 .. digits]);
- if(day == -1)
+ if (day == -1)
throw new DateTimeException("Invalid day");
stripAndCheckLen(value[digits .. value.length], "Dec1200:00A".length);
@@ -32063,9 +32063,9 @@ afterDoW: stripAndCheckLen(value[3 .. value.length], ",7Dec1200:00A".length);
Month month;
{
auto monStr = sliceAsString(value[0 .. 3]);
- switch(monStr)
+ switch (monStr)
{
- foreach(mon; EnumMembers!Month)
+ foreach (mon; EnumMembers!Month)
{
enum monC = capitalize(to!string(mon));
case monC:
@@ -32082,20 +32082,20 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
// year
auto found = value[2 .. value.length].find!(not!(std.ascii.isDigit))();
size_t yearLen = value.length - found.length;
- if(found.length == 0)
+ if (found.length == 0)
throw new DateTimeException("Invalid year");
- if(found[0] == ':')
+ if (found[0] == ':')
yearLen -= 2;
auto year = _convDigits!short(value[0 .. yearLen]);
- if(year < 1900)
+ if (year < 1900)
{
- if(year == -1)
+ if (year == -1)
throw new DateTimeException("Invalid year");
- if(yearLen < 4)
+ if (yearLen < 4)
{
- if(yearLen == 3)
+ if (yearLen == 3)
year += 1900;
- else if(yearLen == 2)
+ else if (yearLen == 2)
year += year < 50 ? 2000 : 1900;
else
throw new DateTimeException("Invalid year. Too few digits.");
@@ -32108,7 +32108,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
// hour
immutable hour = _convDigits!short(value[0 .. 2]);
stripAndCheckLen(value[2 .. value.length], ":00A".length);
- if(value[0] != ':')
+ if (value[0] != ':')
throw new DateTimeException("Invalid hour");
stripAndCheckLen(value[1 .. value.length], "00A".length);
@@ -32118,27 +32118,27 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
// second
short second;
- if(value[0] == ':')
+ if (value[0] == ':')
{
stripAndCheckLen(value[1 .. value.length], "00A".length);
second = _convDigits!short(value[0 .. 2]);
// this is just if/until SysTime is sorted out to fully support leap seconds
- if(second == 60)
+ if (second == 60)
second = 59;
stripAndCheckLen(value[2 .. value.length], "A".length);
}
immutable(TimeZone) parseTZ(int sign)
{
- if(value.length < 5)
+ if (value.length < 5)
throw new DateTimeException("Invalid timezone");
immutable zoneHours = _convDigits!short(value[1 .. 3]);
immutable zoneMinutes = _convDigits!short(value[3 .. 5]);
- if(zoneHours == -1 || zoneMinutes == -1 || zoneMinutes > 59)
+ if (zoneHours == -1 || zoneMinutes == -1 || zoneMinutes > 59)
throw new DateTimeException("Invalid timezone");
value = value[5 .. value.length];
immutable utcOffset = (dur!"hours"(zoneHours) + dur!"minutes"(zoneMinutes)) * sign;
- if(utcOffset == Duration.zero)
+ if (utcOffset == Duration.zero)
{
return sign == 1 ? cast(immutable(TimeZone))UTC()
: cast(immutable(TimeZone))new immutable SimpleTimeZone(Duration.zero);
@@ -32148,15 +32148,15 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
// zone
Rebindable!(immutable TimeZone) tz;
- if(value[0] == '-')
+ if (value[0] == '-')
tz = parseTZ(-1);
- else if(value[0] == '+')
+ else if (value[0] == '+')
tz = parseTZ(1);
else
{
// obs-zone
immutable tzLen = value.length - find(value, ' ', '\t', '(')[0].length;
- switch(sliceAsString(value[0 .. tzLen <= 4 ? tzLen : 4]))
+ switch (sliceAsString(value[0 .. tzLen <= 4 ? tzLen : 4]))
{
case "UT": case "GMT": tz = UTC(); break;
case "EST": tz = new immutable SimpleTimeZone(dur!"hours"(-5)); break;
@@ -32170,7 +32170,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
case "J": case "j": throw new DateTimeException("Invalid timezone");
default:
{
- if(all!(std.ascii.isAlpha)(value[0 .. tzLen]))
+ if (all!(std.ascii.isAlpha)(value[0 .. tzLen]))
{
tz = new immutable SimpleTimeZone(Duration.zero);
break;
@@ -32187,7 +32187,7 @@ afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
// that if the next character is printable (and not part of CFWS), then it
// might be part of the timezone and thus affect what the timezone was
// supposed to be, so we'll throw, but otherwise, we'll just ignore it.
- if(!value.empty && isPrintable(value[0]) && value[0] != ' ' && value[0] != '(')
+ if (!value.empty && isPrintable(value[0]) && value[0] != ' ' && value[0] != '(')
throw new DateTimeException("Invalid timezone");
try
@@ -32216,7 +32216,7 @@ version(unittest) void testParse822(alias cr)(string str, SysTime expected, size
import std.format : format;
auto value = cr(str);
auto result = parseRFC822DateTime(value);
- if(result != expected)
+ if (result != expected)
throw new AssertError(format("wrong result. expected [%s], actual[%s]", expected, result), __FILE__, line);
}
@@ -32252,7 +32252,7 @@ unittest
static auto start() { Rand3Letters retval; retval.popFront(); return retval; }
}
- foreach(cr; AliasSeq!(function(string a){return cast(char[])a;},
+ foreach (cr; AliasSeq!(function(string a){return cast(char[])a;},
function(string a){return cast(ubyte[])a;},
function(string a){return a;},
function(string a){return map!(b => cast(char)b)(a.representation);}))
@@ -32350,14 +32350,14 @@ unittest
test("Sun, 4 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun, 4 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
- foreach(int i, mon; _monthNames)
+ foreach (int i, mon; _monthNames)
{
test(format("17 %s 2012 00:05:02 +0000", mon), SysTime(DateTime(2012, i + 1, 17, 0, 5, 2), UTC()));
test(format("17 %s 2012 00:05 +0000", mon), SysTime(DateTime(2012, i + 1, 17, 0, 5, 0), UTC()));
}
import std.uni;
- foreach(mon; chain(_monthNames[].map!(a => toLower(a))(),
+ foreach (mon; chain(_monthNames[].map!(a => toLower(a))(),
_monthNames[].map!(a => toUpper(a))(),
["Jam", "Jen", "Fec", "Fdb", "Mas", "Mbr", "Aps", "Aqr", "Mai", "Miy",
"Jum", "Jbn", "Jup", "Jal", "Aur", "Apg", "Sem", "Sap", "Ocm", "Odt",
@@ -32375,7 +32375,7 @@ unittest
auto start = SysTime(DateTime(2012, 11, 11, 9, 42, 0), UTC());
int day = 11;
- foreach(int i, dow; daysOfWeekNames)
+ foreach (int i, dow; daysOfWeekNames)
{
auto curr = start + dur!"days"(i);
test(format("%s, %s Nov 2012 09:42:00 +0000", dow, day), curr);
@@ -32387,7 +32387,7 @@ unittest
}
}
- foreach(dow; chain(daysOfWeekNames[].map!(a => toLower(a))(),
+ foreach (dow; chain(daysOfWeekNames[].map!(a => toLower(a))(),
daysOfWeekNames[].map!(a => toUpper(a))(),
["Sum", "Spn", "Mom", "Man", "Tuf", "Tae", "Wem", "Wdd", "The", "Tur",
"Fro", "Fai", "San", "Sut"],
@@ -32408,7 +32408,7 @@ unittest
{
auto st1 = SysTime(Date(1900, 1, 1), UTC());
auto st2 = SysTime(Date(1900, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-11)));
- foreach(i; 1900 .. 2102)
+ foreach (i; 1900 .. 2102)
{
test(format("1 Jan %05d 00:00 +0000", i), st1);
test(format("1 Jan %05d 00:00 -1100", i), st2);
@@ -32417,7 +32417,7 @@ unittest
}
st1.year = 9998;
st2.year = 9998;
- foreach(i; 9998 .. 11_002)
+ foreach (i; 9998 .. 11_002)
{
test(format("1 Jan %05d 00:00 +0000", i), st1);
test(format("1 Jan %05d 00:00 -1100", i), st2);
@@ -32438,7 +32438,7 @@ unittest
// test trailing stuff that gets ignored
{
- foreach(c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
+ foreach (c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
{
scope(failure) writefln("c: %d", c);
test(format("21 Dec 2012 13:14:15 +0000%c", cast(char)c), SysTime(std1, UTC()));
@@ -32449,7 +32449,7 @@ unittest
// test trailing stuff that doesn't get ignored
{
- foreach(c; chain(iota(33, '('), iota('(' + 1, 127)))
+ foreach (c; chain(iota(33, '('), iota('(' + 1, 127)))
{
scope(failure) writefln("c: %d", c);
testBad(format("21 Dec 2012 13:14:15 +0000%c", cast(char)c));
@@ -32480,14 +32480,14 @@ unittest
auto str = "01 Jan 2012 12:13:14 -0800 ";
test(str, SysTime(DateTime(2012, 1, 1, 12, 13, 14), new immutable SimpleTimeZone(hours(-8))));
- foreach(i; 0 .. str.length)
+ foreach (i; 0 .. str.length)
{
auto currStr = str.dup;
currStr[i] = 'x';
scope(failure) writefln("failed: %s", currStr);
testBad(cast(string)currStr);
}
- foreach(i; 2 .. str.length)
+ foreach (i; 2 .. str.length)
{
auto currStr = str[0 .. $ - i];
scope(failure) writefln("failed: %s", currStr);
@@ -32517,7 +32517,7 @@ unittest
auto tooLate1 = SysTime(Date(10_000, 1, 1), UTC());
auto tooLate2 = SysTime(DateTime(12_007, 12, 31, 12, 22, 19), UTC());
- foreach(cr; AliasSeq!(function(string a){return cast(char[])a;},
+ foreach (cr; AliasSeq!(function(string a){return cast(char[])a;},
function(string a){return cast(ubyte[])a;},
function(string a){return a;},
function(string a){return map!(b => cast(char)b)(a.representation);}))
@@ -32528,7 +32528,7 @@ unittest
auto list = ["", " ", " \r\n\t", "\t\r\n (hello world( frien(dog)) silly \r\n ) \t\t \r\n ()",
" \n ", "\t\n\t", " \n\t (foo) \n (bar) \r\n (baz) \n "];
- foreach(i, cfws; list)
+ foreach (i, cfws; list)
{
scope(failure) writefln("i: %s", i);
@@ -32588,7 +32588,7 @@ unittest
{
auto st1 = SysTime(Date(2000, 1, 1), UTC());
auto st2 = SysTime(Date(2000, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-12)));
- foreach(i; 0 .. 50)
+ foreach (i; 0 .. 50)
{
test(format("1 Jan %02d 00:00 GMT", i), st1);
test(format("1 Jan %02d 00:00 -1200", i), st2);
@@ -32600,7 +32600,7 @@ unittest
{
auto st1 = SysTime(Date(1950, 1, 1), UTC());
auto st2 = SysTime(Date(1950, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-12)));
- foreach(i; 50 .. 100)
+ foreach (i; 50 .. 100)
{
test(format("1 Jan %02d 00:00 GMT", i), st1);
test(format("1 Jan %02d 00:00 -1200", i), st2);
@@ -32612,7 +32612,7 @@ unittest
{
auto st1 = SysTime(Date(1900, 1, 1), UTC());
auto st2 = SysTime(Date(1900, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-11)));
- foreach(i; 0 .. 1000)
+ foreach (i; 0 .. 1000)
{
test(format("1 Jan %03d 00:00 GMT", i), st1);
test(format("1 Jan %03d 00:00 -1100", i), st2);
@@ -32621,7 +32621,7 @@ unittest
}
}
- foreach(i; 0 .. 10)
+ foreach (i; 0 .. 10)
{
auto str1 = cr(format("1 Jan %d 00:00 GMT", i));
auto str2 = cr(format("1 Jan %d 00:00 -1200", i));
@@ -32644,21 +32644,21 @@ unittest
test("Wed, 03 May 1982 12:22:04 PDT", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-7))));
auto badTZ = new immutable SimpleTimeZone(Duration.zero);
- foreach(dchar c; filter!(a => a != 'j' && a != 'J')(letters))
+ foreach (dchar c; filter!(a => a != 'j' && a != 'J')(letters))
{
scope(failure) writefln("c: %s", c);
test(format("Wed, 03 May 1982 12:22:04 %s", c), SysTime(dt, badTZ));
test(format("Wed, 03 May 1982 12:22:04%s", c), SysTime(dt, badTZ));
}
- foreach(dchar c; ['j', 'J'])
+ foreach (dchar c; ['j', 'J'])
{
scope(failure) writefln("c: %s", c);
assertThrown!DateTimeException(parseRFC822DateTime(cr(format("Wed, 03 May 1982 12:22:04 %s", c))));
assertThrown!DateTimeException(parseRFC822DateTime(cr(format("Wed, 03 May 1982 12:22:04%s", c))));
}
- foreach(string s; ["AAA", "GQW", "DDT", "PDA", "GT", "GM"])
+ foreach (string s; ["AAA", "GQW", "DDT", "PDA", "GT", "GM"])
{
scope(failure) writefln("s: %s", s);
test(format("Wed, 03 May 1982 12:22:04 %s", s), SysTime(dt, badTZ));
@@ -32666,7 +32666,7 @@ unittest
// test trailing stuff that gets ignored
{
- foreach(c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
+ foreach (c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
{
scope(failure) writefln("c: %d", c);
test(format("21Dec1213:14:15+0000%c", cast(char)c), std1);
@@ -32677,7 +32677,7 @@ unittest
// test trailing stuff that doesn't get ignored
{
- foreach(c; chain(iota(33, '('), iota('(' + 1, 127)))
+ foreach (c; chain(iota(33, '('), iota('(' + 1, 127)))
{
scope(failure) writefln("c: %d", c);
assertThrown!DateTimeException(parseRFC822DateTime(cr(format("21Dec1213:14:15+0000%c", cast(char)c))));
@@ -32699,9 +32699,9 @@ unittest
new immutable SimpleTimeZone(Duration.zero)));
auto tooShortMsg = collectExceptionMsg!DateTimeException(parseRFC822DateTime(""));
- foreach(str; ["Fri,7Dec1200:00:00", "7Dec1200:00:00"])
+ foreach (str; ["Fri,7Dec1200:00:00", "7Dec1200:00:00"])
{
- foreach(i; 0 .. str.length)
+ foreach (i; 0 .. str.length)
{
auto value = str[0 .. $ - i];
scope(failure) writeln(value);
@@ -32722,9 +32722,9 @@ unittest
bool validTimeUnits(string[] units...) @safe pure nothrow
{
import std.algorithm : canFind;
- foreach(str; units)
+ foreach (str; units)
{
- if(!canFind(timeStrings[], str))
+ if (!canFind(timeStrings[], str))
return false;
}
@@ -32759,9 +32759,9 @@ int cmpTimeUnits(string lhs, string rhs) @safe pure
enforce(indexOfLHS != -1, format("%s is not a valid TimeString", lhs));
enforce(indexOfRHS != -1, format("%s is not a valid TimeString", rhs));
- if(indexOfLHS < indexOfRHS)
+ if (indexOfLHS < indexOfRHS)
return -1;
- if(indexOfLHS > indexOfRHS)
+ if (indexOfLHS > indexOfRHS)
return 1;
return 0;
@@ -32769,18 +32769,18 @@ int cmpTimeUnits(string lhs, string rhs) @safe pure
unittest
{
- foreach(i, outerUnits; timeStrings)
+ foreach (i, outerUnits; timeStrings)
{
assert(cmpTimeUnits(outerUnits, outerUnits) == 0);
//For some reason, $ won't compile.
- foreach(innerUnits; timeStrings[i+1 .. timeStrings.length])
+ foreach (innerUnits; timeStrings[i+1 .. timeStrings.length])
assert(cmpTimeUnits(outerUnits, innerUnits) == -1);
}
- foreach(i, outerUnits; timeStrings)
+ foreach (i, outerUnits; timeStrings)
{
- foreach(innerUnits; timeStrings[0 .. i])
+ foreach (innerUnits; timeStrings[0 .. i])
assert(cmpTimeUnits(outerUnits, innerUnits) == 1);
}
}
@@ -32803,7 +32803,7 @@ unittest
)
+/
template CmpTimeUnits(string lhs, string rhs)
- if(validTimeUnits(lhs, rhs))
+ if (validTimeUnits(lhs, rhs))
{
enum CmpTimeUnits = cmpTimeUnitsCTFE(lhs, rhs);
}
@@ -32819,9 +32819,9 @@ private int cmpTimeUnitsCTFE(string lhs, string rhs) @safe pure nothrow
immutable indexOfLHS = countUntil(tstrings, lhs);
immutable indexOfRHS = countUntil(tstrings, rhs);
- if(indexOfLHS < indexOfRHS)
+ if (indexOfLHS < indexOfRHS)
return -1;
- if(indexOfLHS > indexOfRHS)
+ if (indexOfLHS > indexOfRHS)
return 1;
return 0;
@@ -32839,17 +32839,17 @@ unittest
auto currUnits = timeStrings[index];
auto test = format(`assert(CmpTimeUnits!("%s", "%s") == 0);`, currUnits, currUnits);
- foreach(units; timeStrings[index + 1 .. $])
+ foreach (units; timeStrings[index + 1 .. $])
test ~= format(`assert(CmpTimeUnits!("%s", "%s") == -1);`, currUnits, units);
- foreach(units; timeStrings[0 .. index])
+ foreach (units; timeStrings[0 .. index])
test ~= format(`assert(CmpTimeUnits!("%s", "%s") == 1);`, currUnits, units);
return test;
}
static assert(timeStrings.length == 10);
- foreach(n; AliasSeq!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
+ foreach (n; AliasSeq!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
mixin(genTest(n));
}
@@ -32865,18 +32865,18 @@ unittest
value = The number to validate.
+/
bool valid(string units)(int value) @safe pure nothrow
- if(units == "months" ||
+ if (units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds")
{
- static if(units == "months")
+ static if (units == "months")
return value >= Month.jan && value <= Month.dec;
- else static if(units == "hours")
+ else static if (units == "hours")
return value >= 0 && value <= TimeOfDay.maxHour;
- else static if(units == "minutes")
+ else static if (units == "minutes")
return value >= 0 && value <= TimeOfDay.maxMinute;
- else static if(units == "seconds")
+ else static if (units == "seconds")
return value >= 0 && value <= TimeOfDay.maxSecond;
}
@@ -32900,7 +32900,7 @@ unittest
day = The day to validate.
+/
bool valid(string units)(int year, int month, int day) @safe pure nothrow
- if(units == "days")
+ if (units == "days")
{
return day > 0 && day <= maxDay(year, month);
}
@@ -32918,31 +32918,31 @@ bool valid(string units)(int year, int month, int day) @safe pure nothrow
$(LREF DateTimeException) if $(D valid!units(value)) is false.
+/
void enforceValid(string units)(int value, string file = __FILE__, size_t line = __LINE__) @safe pure
- if(units == "months" ||
+ if (units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds")
{
import std.format : format;
- static if(units == "months")
+ static if (units == "months")
{
- if(!valid!units(value))
+ if (!valid!units(value))
throw new DateTimeException(format("%s is not a valid month of the year.", value), file, line);
}
- else static if(units == "hours")
+ else static if (units == "hours")
{
- if(!valid!units(value))
+ if (!valid!units(value))
throw new DateTimeException(format("%s is not a valid hour of the day.", value), file, line);
}
- else static if(units == "minutes")
+ else static if (units == "minutes")
{
- if(!valid!units(value))
+ if (!valid!units(value))
throw new DateTimeException(format("%s is not a valid minute of an hour.", value), file, line);
}
- else static if(units == "seconds")
+ else static if (units == "seconds")
{
- if(!valid!units(value))
+ if (!valid!units(value))
throw new DateTimeException(format("%s is not a valid second of a minute.", value), file, line);
}
}
@@ -32963,10 +32963,10 @@ void enforceValid(string units)(int value, string file = __FILE__, size_t line =
+/
void enforceValid(string units)
(int year, Month month, int day, string file = __FILE__, size_t line = __LINE__) @safe pure
- if(units == "days")
+ if (units == "days")
{
import std.format : format;
- if(!valid!"days"(year, month, day))
+ if (!valid!"days"(year, month, day))
throw new DateTimeException(format("%s is not a valid day in %s in %s", day, month, year), file, line);
}
@@ -32984,10 +32984,10 @@ static int monthsToMonth(int currMonth, int month) @safe pure
enforceValid!"months"(currMonth);
enforceValid!"months"(month);
- if(currMonth == month)
+ if (currMonth == month)
return 0;
- if(currMonth < month)
+ if (currMonth < month)
return month - currMonth;
return (Month.dec - currMonth) + month;
@@ -33059,10 +33059,10 @@ unittest
+/
static int daysToDayOfWeek(DayOfWeek currDoW, DayOfWeek dow) @safe pure nothrow
{
- if(currDoW == dow)
+ if (currDoW == dow)
return 0;
- if(currDoW < dow)
+ if (currDoW < dow)
return dow - currDoW;
return (DayOfWeek.sat - currDoW) + dow + 1;
@@ -33169,7 +33169,7 @@ version(StdDdoc)
else
{
@safe auto measureTime(alias func)()
- if(isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
+ if (isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
{
struct Result
{
@@ -33187,7 +33187,7 @@ else
}
auto measureTime(alias func)()
- if(!isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
+ if (!isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
{
struct Result
{
@@ -33326,23 +33326,23 @@ immutable string[12] _monthNames = ["Jan",
Template to help with converting between time units.
+/
template hnsecsPer(string units)
- if(CmpTimeUnits!(units, "months") < 0)
+ if (CmpTimeUnits!(units, "months") < 0)
{
- static if(units == "hnsecs")
+ static if (units == "hnsecs")
enum hnsecsPer = 1L;
- else static if(units == "usecs")
+ else static if (units == "usecs")
enum hnsecsPer = 10L;
- else static if(units == "msecs")
+ else static if (units == "msecs")
enum hnsecsPer = 1000 * hnsecsPer!"usecs";
- else static if(units == "seconds")
+ else static if (units == "seconds")
enum hnsecsPer = 1000 * hnsecsPer!"msecs";
- else static if(units == "minutes")
+ else static if (units == "minutes")
enum hnsecsPer = 60 * hnsecsPer!"seconds";
- else static if(units == "hours")
+ else static if (units == "hours")
enum hnsecsPer = 60 * hnsecsPer!"minutes";
- else static if(units == "days")
+ else static if (units == "days")
enum hnsecsPer = 24 * hnsecsPer!"hours";
- else static if(units == "weeks")
+ else static if (units == "weeks")
enum hnsecsPer = 7 * hnsecsPer!"days";
}
@@ -33361,7 +33361,7 @@ template hnsecsPer(string units)
The number of the given units from converting hnsecs to those units.
+/
long splitUnitsFromHNSecs(string units)(ref long hnsecs) @safe pure nothrow
- if(validTimeUnits(units) &&
+ if (validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
immutable value = convert!("hnsecs", units)(hnsecs);
@@ -33398,7 +33398,7 @@ unittest
The split out value.
+/
long getUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow
- if(validTimeUnits(units) &&
+ if (validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
return convert!("hnsecs", units)(hnsecs);
@@ -33428,7 +33428,7 @@ unittest
The remaining hnsecs.
+/
long removeUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow
- if(validTimeUnits(units) &&
+ if (validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
immutable value = convert!("hnsecs", units)(hnsecs);
@@ -33459,7 +33459,7 @@ in
}
body
{
- switch(month)
+ switch (month)
{
case Month.jan, Month.mar, Month.may, Month.jul, Month.aug, Month.oct, Month.dec:
return 31;
@@ -33540,13 +33540,13 @@ unittest
DayOfWeek getDayOfWeek(int day) @safe pure nothrow
{
//January 1st, 1 A.D. was a Monday
- if(day >= 0)
+ if (day >= 0)
return cast(DayOfWeek)(day % 7);
else
{
immutable dow = cast(DayOfWeek)((day % 7) + 7);
- if(dow == 7)
+ if (dow == 7)
return DayOfWeek.sun;
else
return dow;
@@ -33631,7 +33631,7 @@ unittest
Month monthFromString(string monthStr) @safe pure
{
import std.format : format;
- switch(monthStr)
+ switch (monthStr)
{
case "Jan":
return Month.jan;
@@ -33664,14 +33664,14 @@ Month monthFromString(string monthStr) @safe pure
unittest
{
- foreach(badStr; ["Ja", "Janu", "Januar", "Januarys", "JJanuary", "JANUARY",
+ foreach (badStr; ["Ja", "Janu", "Januar", "Januarys", "JJanuary", "JANUARY",
"JAN", "january", "jaNuary", "jaN", "jaNuaRy", "jAn"])
{
scope(failure) writeln(badStr);
assertThrown!DateTimeException(monthFromString(badStr));
}
- foreach(month; EnumMembers!Month)
+ foreach (month; EnumMembers!Month)
{
scope(failure) writeln(month);
assert(monthFromString(monthToString(month)) == month);
@@ -33683,7 +33683,7 @@ unittest
The time units which are one step smaller than the given units.
+/
template nextSmallerTimeUnits(string units)
- if(validTimeUnits(units) &&
+ if (validTimeUnits(units) &&
timeStrings.front != units)
{
import std.algorithm : countUntil;
@@ -33709,7 +33709,7 @@ unittest
The time units which are one step larger than the given units.
+/
template nextLargerTimeUnits(string units)
- if(validTimeUnits(units) &&
+ if (validTimeUnits(units) &&
timeStrings.back != units)
{
import std.algorithm : countUntil;
@@ -33741,12 +33741,12 @@ static string fracSecsToISOString(int hnsecs) @safe pure nothrow
try
{
- if(hnsecs == 0)
+ if (hnsecs == 0)
return "";
string isoString = format(".%07d", hnsecs);
- while(isoString[$ - 1] == '0')
+ while (isoString[$ - 1] == '0')
isoString.popBack();
return isoString;
@@ -33788,14 +33788,14 @@ unittest
fractional seconds.
+/
static Duration fracSecsFromISOString(S)(in S isoString) @trusted pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.ascii : isDigit;
import std.string : representation;
import std.conv : to;
import std.algorithm : all;
- if(isoString.empty)
+ if (isoString.empty)
return Duration.zero;
auto str = isoString.representation;
@@ -33807,9 +33807,9 @@ static Duration fracSecsFromISOString(S)(in S isoString) @trusted pure
enforce(all!isDigit(str), new DateTimeException("Invalid ISO String"));
dchar[7] fullISOString = void;
- foreach(i, ref dchar c; fullISOString)
+ foreach (i, ref dchar c; fullISOString)
{
- if(i < str.length)
+ if (i < str.length)
c = str[i];
else
c = '0';
@@ -33894,13 +33894,13 @@ unittest
Rather, it pops off the CFWS from the range and returns it.
+/
R _stripCFWS(R)(R range)
- if(isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
+ if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
(is(Unqual!(ElementType!R) == char) || is(Unqual!(ElementType!R) == ubyte)))
{
immutable e = range.length;
outer: for(size_t i = 0; i < e; )
{
- switch(range[i])
+ switch (range[i])
{
case ' ': case '\t':
{
@@ -33909,7 +33909,7 @@ R _stripCFWS(R)(R range)
}
case '\r':
{
- if(i + 2 < e && range[i + 1] == '\n' && (range[i + 2] == ' ' || range[i + 2] == '\t'))
+ if (i + 2 < e && range[i + 1] == '\n' && (range[i + 2] == ' ' || range[i + 2] == '\t'))
{
i += 3;
break;
@@ -33918,7 +33918,7 @@ R _stripCFWS(R)(R range)
}
case '\n':
{
- if(i + 1 < e && (range[i + 1] == ' ' || range[i + 1] == '\t'))
+ if (i + 1 < e && (range[i + 1] == ' ' || range[i + 1] == '\t'))
{
i += 2;
break;
@@ -33929,20 +33929,20 @@ R _stripCFWS(R)(R range)
{
++i;
size_t commentLevel = 1;
- while(i < e)
+ while (i < e)
{
- if(range[i] == '(')
+ if (range[i] == '(')
++commentLevel;
- else if(range[i] == ')')
+ else if (range[i] == ')')
{
++i;
- if(--commentLevel == 0)
+ if (--commentLevel == 0)
continue outer;
continue;
}
- else if(range[i] == '\\')
+ else if (range[i] == '\\')
{
- if(++i == e)
+ if (++i == e)
break outer;
}
++i;
@@ -33962,7 +33962,7 @@ unittest
import std.string;
import std.typecons;
- foreach(cr; AliasSeq!(function(string a){return cast(ubyte[])a;},
+ foreach (cr; AliasSeq!(function(string a){return cast(ubyte[])a;},
function(string a){return map!(b => cast(char)b)(a.representation);}))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
scope(failure) writeln(typeof(cr).stringof);
@@ -34059,17 +34059,17 @@ unittest
// doesn't have to worry about quite as many cases as std.conv.to, since it
// doesn't have to worry about a sign on the value or about whether it fits.
T _convDigits(T, R)(R str)
- if(isIntegral!T && isSigned!T) // The constraints on R were already covered by parseRFC822DateTime.
+ if (isIntegral!T && isSigned!T) // The constraints on R were already covered by parseRFC822DateTime.
{
import std.ascii : isDigit;
assert(!str.empty);
T num = 0;
- foreach(i; 0 .. str.length)
+ foreach (i; 0 .. str.length)
{
- if(i != 0)
+ if (i != 0)
num *= 10;
- if(!isDigit(str[i]))
+ if (!isDigit(str[i]))
return -1;
num += str[i] - '0';
}
@@ -34080,12 +34080,12 @@ unittest
{
import std.conv : to;
import std.range;
- foreach(i; chain(iota(0, 101), [250, 999, 1000, 1001, 2345, 9999]))
+ foreach (i; chain(iota(0, 101), [250, 999, 1000, 1001, 2345, 9999]))
{
scope(failure) writeln(i);
assert(_convDigits!int(to!string(i)) == i);
}
- foreach(str; ["-42", "+42", "1a", "1 ", " ", " 42 "])
+ foreach (str; ["-42", "+42", "1a", "1 ", " ", " 42 "])
{
scope(failure) writeln(str);
assert(_convDigits!int(str) == -1);
@@ -34389,44 +34389,44 @@ version(unittest)
testFracSecs = [Duration.zero, hnsecs(1), hnsecs(5007), hnsecs(9999999)];
- foreach(year; testYearsBC)
+ foreach (year; testYearsBC)
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
testDatesBC ~= Date(year, md.month, md.day);
}
- foreach(year; testYearsAD)
+ foreach (year; testYearsAD)
{
- foreach(md; testMonthDays)
+ foreach (md; testMonthDays)
testDatesAD ~= Date(year, md.month, md.day);
}
- foreach(dt; testDatesBC)
+ foreach (dt; testDatesBC)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
testDateTimesBC ~= DateTime(dt, tod);
}
- foreach(dt; testDatesAD)
+ foreach (dt; testDatesAD)
{
- foreach(tod; testTODs)
+ foreach (tod; testTODs)
testDateTimesAD ~= DateTime(dt, tod);
}
- foreach(dt; testDateTimesBC)
+ foreach (dt; testDateTimesBC)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
testSysTimesBC ~= SysTime(dt, fs, tz);
}
}
- foreach(dt; testDateTimesAD)
+ foreach (dt; testDateTimesAD)
{
- foreach(tz; testTZs)
+ foreach (tz; testTZs)
{
- foreach(fs; testFracSecs)
+ foreach (fs; testFracSecs)
testSysTimesAD ~= SysTime(dt, fs, tz);
}
}
@@ -34463,7 +34463,7 @@ import std.string;
int main(string[] args)
{
- if(args.length != 4 || args[1].baseName != "windowsZones.xml")
+ if (args.length != 4 || args[1].baseName != "windowsZones.xml")
{
stderr.writeln("genTZs.d windowsZones.xml ");
return -1;
@@ -34475,10 +34475,10 @@ int main(string[] args)
immutable f2 = `type="`;
auto file = File(args[1]);
- foreach(line; file.byLine())
+ foreach (line; file.byLine())
{
line = line.find(f1);
- if(line.empty)
+ if (line.empty)
continue;
line = line[f1.length .. $];
auto next = line.find('"');
@@ -34488,26 +34488,26 @@ int main(string[] args)
next = line.find('"');
auto nixes = to!string(line[0 .. $ - next.length]).split();
- if(auto l = win in win2Nix)
+ if (auto l = win in win2Nix)
*l ~= nixes;
else
win2Nix[win] = nixes;
- foreach(nix; nixes)
+ foreach (nix; nixes)
{
- if(auto w = nix in nix2Win)
+ if (auto w = nix in nix2Win)
*w ~= win;
else
nix2Win[nix] = [win];
}
}
- foreach(nix; nix2Win.byKey())
+ foreach (nix; nix2Win.byKey())
{
auto wins = nix2Win[nix];
nix2Win[nix] = wins.sort().uniq().array();
}
- foreach(win; win2Nix.byKey())
+ foreach (win; win2Nix.byKey())
{
auto nixes = win2Nix[win];
win2Nix[win] = nixes.sort().uniq().array();
@@ -34515,26 +34515,26 @@ int main(string[] args)
// AFAIK, there should be no cases of a TZ Database time zone converting to
// multiple windows time zones.
- foreach(nix, wins; nix2Win)
+ foreach (nix, wins; nix2Win)
enforce(wins.length == 1, format("%s -> %s", nix, wins));
// We'll try to eliminate multiples by favoring a conversion if it's already
// in Phobos, but if it's new, then the correct one will have to be chosen
// manually from the results.
string[] haveMultiple;
- foreach(win, nixes; win2Nix)
+ foreach (win, nixes; win2Nix)
{
- if(nixes.length > 1)
+ if (nixes.length > 1)
haveMultiple ~= win;
}
bool[string] haveConflicts;
- foreach(win; haveMultiple)
+ foreach (win; haveMultiple)
{
- if(auto curr = windowsTZNameToTZDatabaseName(win))
+ if (auto curr = windowsTZNameToTZDatabaseName(win))
{
- if(auto other = curr in nix2Win)
+ if (auto other = curr in nix2Win)
{
- if((*other)[0] == win)
+ if ((*other)[0] == win)
{
win2Nix[win] = [curr];
continue;
@@ -34549,10 +34549,10 @@ int main(string[] args)
string[] nix2WinLines = [
`string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc`,
`{`,
- ` switch(tzName)`,
+ ` switch (tzName)`,
` {`];
- foreach(nix; nix2Win.keys.sort())
+ foreach (nix; nix2Win.keys.sort())
nix2WinLines ~= format(` case "%s": return "%s";`, nix, nix2Win[nix][0]);
nix2WinLines ~= [
@@ -34564,12 +34564,12 @@ int main(string[] args)
string[] win2NixLines = [
`string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc`,
`{`,
- ` switch(tzName)`,
+ ` switch (tzName)`,
` {`];
- foreach(win; win2Nix.keys.sort())
+ foreach (win; win2Nix.keys.sort())
{
immutable hasMultiple = cast(bool)(win in haveConflicts);
- foreach(nix; win2Nix[win])
+ foreach (nix; win2Nix[win])
win2NixLines ~= format(` case "%s": return "%s";%s`, win, nix, hasMultiple ? " FIXME" : "");
}
diff --git a/std/digest/crc.d b/std/digest/crc.d
index 930cbb84f..e768fd450 100644
--- a/std/digest/crc.d
+++ b/std/digest/crc.d
@@ -252,7 +252,7 @@ unittest
{
//Let's use the template features:
//Note: When passing a CRC32 to a function, it must be passed by reference!
- void doSomething(T)(ref T hash) if(isDigest!T)
+ void doSomething(T)(ref T hash) if (isDigest!T)
{
hash.put(cast(ubyte)0);
}
diff --git a/std/digest/digest.d b/std/digest/digest.d
index e10021bdd..983aa70d9 100644
--- a/std/digest/digest.d
+++ b/std/digest/digest.d
@@ -92,7 +92,7 @@ unittest
import std.stdio;
// Digests a file and prints the result.
- void digestFile(Hash)(string filename) if(isDigest!Hash)
+ void digestFile(Hash)(string filename) if (isDigest!Hash)
{
auto file = File(filename);
auto result = digest!Hash(file.byChunk(4096 * 1024));
@@ -116,7 +116,7 @@ unittest
import std.digest.crc, std.digest.sha, std.digest.md;
import std.stdio;
// Digests a file and prints the result.
- void digestFile(Hash)(ref Hash hash, string filename) if(isDigest!Hash)
+ void digestFile(Hash)(ref Hash hash, string filename) if (isDigest!Hash)
{
File file = File(filename);
@@ -303,7 +303,7 @@ unittest
unittest
{
import std.digest.crc;
- void myFunction(T)() if(isDigest!T)
+ void myFunction(T)() if (isDigest!T)
{
T dig;
dig.start();
@@ -317,7 +317,7 @@ unittest
*/
template DigestType(T)
{
- static if(isDigest!T)
+ static if (isDigest!T)
{
alias DigestType =
ReturnType!(typeof(
@@ -377,7 +377,7 @@ unittest
unittest
{
import std.digest.crc;
- void myFunction(T)() if(hasPeek!T)
+ void myFunction(T)() if (hasPeek!T)
{
T dig;
dig.start();
@@ -424,7 +424,7 @@ package template isDigestibleRange(Range)
* Params:
* range= an $(D InputRange) with $(D ElementType) $(D ubyte), $(D ubyte[]) or $(D ubyte[num])
*/
-DigestType!Hash digest(Hash, Range)(auto ref Range range) if(!isArray!Range
+DigestType!Hash digest(Hash, Range)(auto ref Range range) if (!isArray!Range
&& isDigestibleRange!Range)
{
import std.algorithm : copy;
@@ -449,11 +449,11 @@ unittest
* Params:
* data= one or more arrays of any type
*/
-DigestType!Hash digest(Hash, T...)(scope const T data) if(allSatisfy!(isArray, typeof(data)))
+DigestType!Hash digest(Hash, T...)(scope const T data) if (allSatisfy!(isArray, typeof(data)))
{
Hash hash;
hash.start();
- foreach(datum; data)
+ foreach (datum; data)
hash.put(cast(const(ubyte[]))datum);
return hash.finish();
}
@@ -486,7 +486,7 @@ unittest
* range= an $(D InputRange) with $(D ElementType) $(D ubyte), $(D ubyte[]) or $(D ubyte[num])
*/
char[digestLength!(Hash)*2] hexDigest(Hash, Order order = Order.increasing, Range)(ref Range range)
- if(!isArray!Range && isDigestibleRange!Range)
+ if (!isArray!Range && isDigestibleRange!Range)
{
return toHexString!order(digest!Hash(range));
}
@@ -508,7 +508,7 @@ unittest
* data= one or more arrays of any type
*/
char[digestLength!(Hash)*2] hexDigest(Hash, Order order = Order.increasing, T...)(scope const T data)
- if(allSatisfy!(isArray, typeof(data)))
+ if (allSatisfy!(isArray, typeof(data)))
{
return toHexString!order(digest!Hash(data));
}
@@ -611,7 +611,7 @@ interface Digest
final @trusted nothrow ubyte[] digest(scope const(void[])[] data...)
{
this.reset();
- foreach(datum; data)
+ foreach (datum; data)
this.put(cast(ubyte[])datum);
return this.finish();
}
@@ -713,9 +713,9 @@ char[num*2] toHexString(Order order = Order.increasing, size_t num, LetterCase l
char[num*2] result;
size_t i;
- static if(order == Order.increasing)
+ static if (order == Order.increasing)
{
- foreach(u; digest)
+ foreach (u; digest)
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
@@ -724,7 +724,7 @@ char[num*2] toHexString(Order order = Order.increasing, size_t num, LetterCase l
else
{
size_t j = num - 1;
- while(i < num*2)
+ while (i < num*2)
{
result[i++] = hexDigits[digest[j] >> 4];
result[i++] = hexDigits[digest[j] & 15];
@@ -756,9 +756,9 @@ string toHexString(Order order = Order.increasing, LetterCase letterCase = Lette
auto result = new char[digest.length*2];
size_t i;
- static if(order == Order.increasing)
+ static if (order == Order.increasing)
{
- foreach(u; digest)
+ foreach (u; digest)
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
@@ -767,7 +767,7 @@ string toHexString(Order order = Order.increasing, LetterCase letterCase = Lette
else
{
import std.range : retro;
- foreach(u; retro(digest))
+ foreach (u; retro(digest))
{
result[i++] = hexDigits[u >> 4];
result[i++] = hexDigits[u & 15];
@@ -838,7 +838,7 @@ ref T[N] asArray(size_t N, T)(ref T[] source, string errorMsg = "")
* useful for other purposes as well. It returns the length (in bytes) of the hash value
* produced by T.
*/
-template digestLength(T) if(isDigest!T)
+template digestLength(T) if (isDigest!T)
{
enum size_t digestLength = (ReturnType!(T.finish)).length;
}
@@ -848,7 +848,7 @@ template digestLength(T) if(isDigest!T)
* Modules providing digest implementations will usually provide
* an alias for this template (e.g. MD5Digest, SHA1Digest, ...).
*/
-class WrapperDigest(T) if(isDigest!T) : Digest
+class WrapperDigest(T) if (isDigest!T) : Digest
{
protected:
T _digest;
@@ -943,7 +943,7 @@ class WrapperDigest(T) if(isDigest!T) : Digest
///ditto
@trusted ubyte[] peek() const;
}
- else static if(hasPeek!T)
+ else static if (hasPeek!T)
{
@trusted ubyte[] peek(scope ubyte[] buf) const
in
diff --git a/std/digest/md.d b/std/digest/md.d
index 7f28bff4e..da6159e37 100644
--- a/std/digest/md.d
+++ b/std/digest/md.d
@@ -428,7 +428,7 @@ unittest
unittest
{
//Let's use the template features:
- void doSomething(T)(ref T hash) if(isDigest!T)
+ void doSomething(T)(ref T hash) if (isDigest!T)
{
hash.put(cast(ubyte)0);
}
diff --git a/std/digest/ripemd.d b/std/digest/ripemd.d
index 19881e66b..2dd2b0606 100644
--- a/std/digest/ripemd.d
+++ b/std/digest/ripemd.d
@@ -586,7 +586,7 @@ unittest
unittest
{
//Let's use the template features:
- void doSomething(T)(ref T hash) if(isDigest!T)
+ void doSomething(T)(ref T hash) if (isDigest!T)
{
hash.put(cast(ubyte)0);
}
diff --git a/std/digest/sha.d b/std/digest/sha.d
index 82dd0b167..e81a37afd 100644
--- a/std/digest/sha.d
+++ b/std/digest/sha.d
@@ -213,7 +213,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
static assert(!(blockSize == 1024 && digestSize < 224),
"Invalid SHA digestSize for a blockSize of 1024. The digestSize must be 224, 256, 384 or 512.");
- static if(digestSize==160) /* SHA-1 */
+ static if (digestSize==160) /* SHA-1 */
{
version(USE_SSSE3)
{
@@ -230,35 +230,35 @@ struct SHA(uint hashBlockSize, uint digestSize)
alias transform = transformX86;
}
}
- else static if(blockSize == 512) /* SHA-224, SHA-256 */
+ else static if (blockSize == 512) /* SHA-224, SHA-256 */
alias transform = transformSHA2!uint;
- else static if(blockSize == 1024) /* SHA-384, SHA-512, SHA-512/224, SHA-512/256 */
+ else static if (blockSize == 1024) /* SHA-384, SHA-512, SHA-512/224, SHA-512/256 */
alias transform = transformSHA2!ulong;
else
static assert(0);
private:
/* magic initialization constants - state (ABCDEFGH) */
- static if(blockSize == 512 && digestSize == 160) /* SHA-1 */
+ static if (blockSize == 512 && digestSize == 160) /* SHA-1 */
{
uint[5] state =
[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];
}
- else static if(blockSize == 512 && digestSize == 224) /* SHA-224 */
+ else static if (blockSize == 512 && digestSize == 224) /* SHA-224 */
{
uint[8] state = [
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,
];
}
- else static if(blockSize == 512 && digestSize == 256) /* SHA-256 */
+ else static if (blockSize == 512 && digestSize == 256) /* SHA-256 */
{
uint[8] state = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
];
}
- else static if(blockSize == 1024 && digestSize == 224) /* SHA-512/224 */
+ else static if (blockSize == 1024 && digestSize == 224) /* SHA-512/224 */
{
ulong[8] state = [
0x8C3D37C8_19544DA2, 0x73E19966_89DCD4D6,
@@ -267,7 +267,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
0x3F9D85A8_6A1D36C8, 0x1112E6AD_91D692A1,
];
}
- else static if(blockSize == 1024 && digestSize == 256) /* SHA-512/256 */
+ else static if (blockSize == 1024 && digestSize == 256) /* SHA-512/256 */
{
ulong[8] state = [
0x22312194_FC2BF72C, 0x9F555FA3_C84C64C2,
@@ -276,7 +276,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
0x2B0199FC_2C85B8AA, 0x0EB72DDC_81C52CA2,
];
}
- else static if(blockSize == 1024 && digestSize == 384) /* SHA-384 */
+ else static if (blockSize == 1024 && digestSize == 384) /* SHA-384 */
{
ulong[8] state = [
0xcbbb9d5d_c1059ed8, 0x629a292a_367cd507,
@@ -285,7 +285,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
0xdb0c2e0d_64f98fa7, 0x47b5481d_befa4fa4,
];
}
- else static if(blockSize == 1024 && digestSize == 512) /* SHA-512 */
+ else static if (blockSize == 1024 && digestSize == 512) /* SHA-512 */
{
ulong[8] state = [
0x6a09e667_f3bcc908, 0xbb67ae85_84caa73b,
@@ -298,7 +298,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
static assert(0);
/* constants */
- static if(blockSize == 512)
+ static if (blockSize == 512)
{
static immutable uint[64] constants = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
@@ -311,7 +311,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
];
}
- else static if(blockSize == 1024)
+ else static if (blockSize == 1024)
{
static immutable ulong[80] constants = [
0x428a2f98_d728ae22, 0x71374491_23ef65cd, 0xb5c0fbcf_ec4d3b2f, 0xe9b5dba5_8189dbbc,
@@ -632,7 +632,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
T_SHA2_16_79!Word(62, W, C, D, E, F, G, H, A, B, constants[62]);
T_SHA2_16_79!Word(63, W, B, C, D, E, F, G, H, A, constants[63]);
- static if(is(Word==ulong))
+ static if (is(Word==ulong))
{
T_SHA2_16_79!Word(64, W, A, B, C, D, E, F, G, H, constants[64]);
T_SHA2_16_79!Word(65, W, H, A, B, C, D, E, F, G, constants[65]);
@@ -702,14 +702,14 @@ struct SHA(uint hashBlockSize, uint digestSize)
index = (cast(uint)count[0] >> 3) & (blockSizeInBytes - 1);
/* Update number of bits */
- static if(blockSize==512)
+ static if (blockSize==512)
count[0] += inputLen * 8;
- else static if(blockSize==1024)
+ else static if (blockSize==1024)
{
/* ugly hack to work around lack of ucent */
auto oldCount0 = count[0];
count[0] += inputLen * 8;
- if(count[0] < oldCount0)
+ if (count[0] < oldCount0)
count[1]++;
}
else
@@ -752,7 +752,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
*/
ubyte[digestSize/8] finish() @trusted pure nothrow @nogc
{
- static if(blockSize==512)
+ static if (blockSize==512)
{
ubyte[32] data = void;
uint index, padLen;
@@ -776,7 +776,7 @@ struct SHA(uint hashBlockSize, uint digestSize)
start();
return data[0..digestSize/8];
}
- else static if(blockSize==1024)
+ else static if (blockSize==1024)
{
ubyte[64] data = void;
uint index, padLen;
@@ -854,7 +854,7 @@ unittest
{
//Let's use the template features:
//Note: When passing a SHA1 to a function, it must be passed by reference!
- void doSomething(T)(ref T hash) if(isDigest!T)
+ void doSomething(T)(ref T hash) if (isDigest!T)
{
hash.put(cast(ubyte)0);
}
diff --git a/std/encoding.d b/std/encoding.d
index 2a19f7758..ff0fd64ba 100644
--- a/std/encoding.d
+++ b/std/encoding.d
@@ -229,14 +229,14 @@ unittest
];
// Make sure everything that should be valid, is
- foreach(a;validStrings)
+ foreach (a;validStrings)
{
string s = cast(string)a;
assert(isValid(s),"Failed to validate: "~makeReadable(s));
}
// Make sure everything that shouldn't be valid, isn't
- foreach(a;invalidStrings)
+ foreach (a;invalidStrings)
{
string s = cast(string)a;
assert(!isValid(s),"Incorrectly validated: "~makeReadable(s));
@@ -256,7 +256,7 @@ unittest
// Make sure all transcodings work in both directions, using both forward
// and reverse iteration
- foreach(a; validStrings)
+ foreach (a; validStrings)
{
string s = cast(string)a;
string s2;
@@ -622,7 +622,7 @@ struct CodeUnits(E)
int opApply(scope int delegate(ref E) dg)
{
int result = 0;
- foreach(E c;s)
+ foreach (E c;s)
{
result = dg(c);
if (result != 0) break;
@@ -633,7 +633,7 @@ struct CodeUnits(E)
int opApplyReverse(scope int delegate(ref E) dg)
{
int result = 0;
- foreach_reverse(E c;s)
+ foreach_reverse (E c;s)
{
result = dg(c);
if (result != 0) break;
@@ -2108,13 +2108,13 @@ size_t encode(Tgt, Src, R)(in Src[] s, R range)
Example:
--------------------------------------------------------
string s = "hello world";
- foreach(c;codePoints(s))
+ foreach (c;codePoints(s))
{
// do something with c (which will always be a dchar)
}
--------------------------------------------------------
- Note that, currently, foreach(c:codePoints(s)) is superior to foreach(c;s)
+ Note that, currently, foreach (c:codePoints(s)) is superior to foreach(c;s)
in that the latter will fall over on encountering U+FFFF.
*/
CodePoints!(E) codePoints(E)(immutable(E)[] s)
@@ -2132,7 +2132,7 @@ unittest
{
string s = "hello";
string t;
- foreach(c;codePoints(s))
+ foreach (c;codePoints(s))
{
t ~= cast(char)c;
}
@@ -2172,7 +2172,7 @@ body
unittest
{
char[] a;
- foreach(c;codeUnits!(char)(cast(dchar)'\u20AC'))
+ foreach (c;codeUnits!(char)(cast(dchar)'\u20AC'))
{
a ~= c;
}
@@ -2208,21 +2208,21 @@ in
}
body
{
- static if(is(Src==Dst))
+ static if (is(Src==Dst))
{
r = s;
}
- else static if(is(Src==AsciiChar))
+ else static if (is(Src==AsciiChar))
{
transcode!(char,Dst)(cast(string)s,r);
}
else
{
- static if(is(Dst == wchar))
+ static if (is(Dst == wchar))
{
immutable minReservePlace = 2;
}
- else static if(is(Dst == dchar))
+ else static if (is(Dst == dchar))
{
immutable minReservePlace = 1;
}
@@ -2237,7 +2237,7 @@ body
while (t.length != 0)
{
- if(tmpBuffer.length < minReservePlace)
+ if (tmpBuffer.length < minReservePlace)
{
size_t prevLength = buffer.length;
buffer.length += t.length + minReservePlace;
@@ -2274,8 +2274,8 @@ unittest
string asciiCharString = to!string(iota(0, 128, 1));
alias Types = AliasSeq!(string, Latin1String, Latin2String, AsciiString, Windows1250String, Windows1252String, dstring, wstring);
- foreach(S; Types)
- foreach(D; Types)
+ foreach (S; Types)
+ foreach (D; Types)
{
string str;
S sStr;
@@ -2289,8 +2289,8 @@ unittest
{
string czechChars = "Příliš žluťoučký kůň úpěl ďábelské ódy.";
alias Types = AliasSeq!(string, dstring, wstring);
- foreach(S; Types)
- foreach(D; Types)
+ foreach (S; Types)
+ foreach (D; Types)
{
string str;
S sStr;
@@ -2340,7 +2340,7 @@ abstract class EncodingScheme
auto scheme = cast(EncodingScheme)ClassInfo.find(className).create();
if (scheme is null)
throw new EncodingException("Unable to create class "~className);
- foreach(encodingName;scheme.names())
+ foreach (encodingName;scheme.names())
{
supported[toLower(encodingName)] = className;
}
@@ -3262,19 +3262,19 @@ version(unittest)
{
void transcodeReverse(Src,Dst)(immutable(Src)[] s, out immutable(Dst)[] r)
{
- static if(is(Src==Dst))
+ static if (is(Src==Dst))
{
return s;
}
- else static if(is(Src==AsciiChar))
+ else static if (is(Src==AsciiChar))
{
transcodeReverse!(char,Dst)(cast(string)s,r);
}
else
{
- foreach_reverse(d;codePoints(s))
+ foreach_reverse (d;codePoints(s))
{
- foreach_reverse(c;codeUnits!(Dst)(d))
+ foreach_reverse (c;codeUnits!(Dst)(d))
{
r = c ~ r;
}
@@ -3285,7 +3285,7 @@ version(unittest)
string makeReadable(string s)
{
string r = "\"";
- foreach(char c;s)
+ foreach (char c;s)
{
if (c >= 0x20 && c < 0x80)
{
@@ -3305,7 +3305,7 @@ version(unittest)
string makeReadable(wstring s)
{
string r = "\"";
- foreach(wchar c;s)
+ foreach (wchar c;s)
{
if (c >= 0x20 && c < 0x80)
{
@@ -3327,7 +3327,7 @@ version(unittest)
string makeReadable(dstring s)
{
string r = "\"";
- foreach(dchar c; s)
+ foreach (dchar c; s)
{
if (c >= 0x20 && c < 0x80)
{
diff --git a/std/experimental/allocator/gc_allocator.d b/std/experimental/allocator/gc_allocator.d
index 4ccbd8cc1..c87f25677 100644
--- a/std/experimental/allocator/gc_allocator.d
+++ b/std/experimental/allocator/gc_allocator.d
@@ -39,7 +39,7 @@ struct GCAllocator
immutable curLength = GC.sizeOf(b.ptr);
assert(curLength != 0); // we have a valid GC pointer here
immutable desired = b.length + delta;
- if(desired > curLength) // check to see if the current block can't hold the data
+ if (desired > curLength) // check to see if the current block can't hold the data
{
immutable sizeRequest = desired - curLength;
immutable newSize = GC.extend(b.ptr, sizeRequest, sizeRequest);
@@ -89,9 +89,9 @@ struct GCAllocator
/// Ditto
size_t goodAllocSize(size_t n) shared
{
- if(n == 0)
+ if (n == 0)
return 0;
- if(n <= 16)
+ if (n <= 16)
return 16;
import core.bitop: bsr;
diff --git a/std/experimental/allocator/mallocator.d b/std/experimental/allocator/mallocator.d
index 4d4d7ef8b..4c6b16258 100644
--- a/std/experimental/allocator/mallocator.d
+++ b/std/experimental/allocator/mallocator.d
@@ -157,7 +157,7 @@ version (Windows)
import std.c.stdlib: free;
import std.c.string: memcpy;
- if(!ptr) return _aligned_malloc(size, alignment);
+ if (!ptr) return _aligned_malloc(size, alignment);
// gets the header from the exising pointer
AlignInfo* head = AlignInfo(ptr);
diff --git a/std/experimental/ndslice/internal.d b/std/experimental/ndslice/internal.d
index 1076189e0..12e2515cc 100644
--- a/std/experimental/ndslice/internal.d
+++ b/std/experimental/ndslice/internal.d
@@ -11,7 +11,7 @@ enum indexError(size_t pos, size_t N) =
~ " must be less than corresponding length.";
enum indexStrideCode = q{
- static if(_indexes.length)
+ static if (_indexes.length)
{
size_t stride = _strides[0] * _indexes[0];
assert(_indexes[0] < _lengths[0], indexError!(0, N));
@@ -29,7 +29,7 @@ enum indexStrideCode = q{
};
enum mathIndexStrideCode = q{
- static if(_indexes.length)
+ static if (_indexes.length)
{
size_t stride = _strides[0] * _indexes[N - 1];
assert(_indexes[N - 1] < _lengths[0], indexError!(N - 1, N));
diff --git a/std/experimental/ndslice/selection.d b/std/experimental/ndslice/selection.d
index 9d21f7c7f..d166916d4 100644
--- a/std/experimental/ndslice/selection.d
+++ b/std/experimental/ndslice/selection.d
@@ -767,7 +767,7 @@ Slice!(Lengths.length, Range)
}
ret._strides[nj - 1] = slice._strides[oj - 1];
- foreach_reverse(i; ni .. nj - 1)
+ foreach_reverse (i; ni .. nj - 1)
ret._strides[i] = ret._lengths[i + 1] * ret._strides[i + 1];
assert((oi == slice.N) == (ni == ret.N));
}
@@ -964,7 +964,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice)
private void popFrontImpl()
{
- foreach_reverse(i; Iota!(0, N)) with (_slice)
+ foreach_reverse (i; Iota!(0, N)) with (_slice)
{
_ptr += _strides[i];
_indexes[i]++;
@@ -1007,7 +1007,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice)
//calculates shift and new indexes
sizediff_t _shift;
n += _indexes[N-1];
- foreach_reverse(i; Iota!(1, N)) with (_slice)
+ foreach_reverse (i; Iota!(1, N)) with (_slice)
{
immutable v = n / _lengths[i];
n %= _lengths[i];
@@ -1045,7 +1045,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice)
{
sizediff_t _shift;
n += _indexes[N-1];
- foreach_reverse(i; Iota!(1, N)) with (_slice)
+ foreach_reverse (i; Iota!(1, N)) with (_slice)
{
immutable v = n / _lengths[i];
n %= _lengths[i];
@@ -1455,7 +1455,7 @@ auto byElementInStandardSimplex(size_t N, Range)(auto ref Slice!(N, Range) slice
private void popFrontImpl()
{
- foreach_reverse(i; Iota!(0, N)) with (_slice)
+ foreach_reverse (i; Iota!(0, N)) with (_slice)
{
_ptr += _strides[i];
_indexes[i]++;
@@ -1634,7 +1634,7 @@ template IndexSlice(size_t N)
{
pragma(inline, true);
size_t[N] indexes = void;
- foreach_reverse(i; Iota!(0, N - 1))
+ foreach_reverse (i; Iota!(0, N - 1))
{
indexes[i + 1] = index % _lengths[i];
index /= _lengths[i];
diff --git a/std/experimental/ndslice/slice.d b/std/experimental/ndslice/slice.d
index 350ab9ebd..1a042d83a 100644
--- a/std/experimental/ndslice/slice.d
+++ b/std/experimental/ndslice/slice.d
@@ -124,7 +124,7 @@ body
ret._strides[N - 1] = 1;
else
ret._strides[N - 1] = range._strides[0];
- foreach_reverse(i; Iota!(0, N - 1))
+ foreach_reverse (i; Iota!(0, N - 1))
{
ret._lengths[i] = lengths[i];
ret._strides[i] = ret._strides[i + 1] * ret._lengths[i + 1];
@@ -731,7 +731,7 @@ auto makeNdarray(T, Allocator, size_t N, Range)(auto ref Allocator alloc, Slice
{
alias E = typeof(makeNdarray!T(alloc, slice[0]));
auto ret = makeArray!E(alloc, slice.length);
- foreach(i, ref e; ret)
+ foreach (i, ref e; ret)
e = .makeNdarray!T(alloc, slice[i]);
return ret;
}
@@ -752,7 +752,7 @@ auto makeNdarray(T, Allocator, size_t N, Range)(auto ref Allocator alloc, Slice
static immutable ar = [[0L, 1, 2, 3], [4L, 5, 6, 7], [8L, 9, 10, 11]];
assert(m == ar);
- foreach(ref row; m)
+ foreach (ref row; m)
Mallocator.instance.dispose(row);
Mallocator.instance.dispose(m);
}
@@ -1623,7 +1623,7 @@ struct Slice(size_t _N, _Range)
{
if (this.length != rarrary.length)
return false;
- foreach(i, ref e; rarrary)
+ foreach (i, ref e; rarrary)
if (e != this[i])
return false;
return true;
diff --git a/std/experimental/typecons.d b/std/experimental/typecons.d
index aee9dc810..0c2b5175c 100644
--- a/std/experimental/typecons.d
+++ b/std/experimental/typecons.d
@@ -294,7 +294,7 @@ if (Targets.length >= 1 && allSatisfy!(isInterface, Targets))
{
string r;
bool first = true;
- foreach(i; staticIota!(0, num))
+ foreach (i; staticIota!(0, num))
{
import std.conv : to;
r ~= (first ? "" : ", ") ~ " a" ~ (i+1).to!string;
@@ -362,7 +362,7 @@ private template wrapperSignature(alias fun)
{
string r;
bool first = true;
- foreach(i, p; param)
+ foreach (i, p; param)
{
import std.conv : to;
r ~= (first ? "" : ", ") ~ p.stringof ~ " a" ~ (i+1).to!string;
diff --git a/std/file.d b/std/file.d
index 3c7b38ee7..22f736931 100644
--- a/std/file.d
+++ b/std/file.d
@@ -65,7 +65,7 @@ package @property string deleteme() @safe
static _deleteme = "deleteme.dmd.unittest.pid";
static _first = true;
- if(_first)
+ if (_first)
{
_deleteme = buildPath(tempDir(), _deleteme) ~ to!string(thisProcessID);
_first = false;
@@ -115,7 +115,7 @@ class FileException : Exception
+/
this(in char[] name, in char[] msg, string file = __FILE__, size_t line = __LINE__) @safe pure
{
- if(msg.empty)
+ if (msg.empty)
super(name.idup, file, line);
else
super(text(name, ": ", msg), file, line);
@@ -1305,7 +1305,7 @@ unittest
Example:
--------------------
-if(timeLastModified(source) >= timeLastModified(target, SysTime.min))
+if (timeLastModified(source) >= timeLastModified(target, SysTime.min))
{
// must (re)build
}
@@ -1348,7 +1348,7 @@ SysTime timeLastModified(R)(R name, SysTime returnIfMissing)
unittest
{
//std.process.system("echo a > deleteme") == 0 || assert(false);
- if(exists(deleteme))
+ if (exists(deleteme))
remove(deleteme);
write(deleteme, "a\n");
@@ -1378,7 +1378,7 @@ unittest
{
import core.thread;
- if(exists(deleteme))
+ if (exists(deleteme))
remove(deleteme);
SysTime lastTime;
@@ -1688,18 +1688,18 @@ unittest
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
assert("C:\\Program Files\\".isDir);
- if("C:\\Windows\\system.ini".exists)
+ if ("C:\\Windows\\system.ini".exists)
assert(!"C:\\Windows\\system.ini".isDir);
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
assert(system_directory.isDir);
- if(system_file.exists)
+ if (system_file.exists)
assert(!system_file.isDir);
}
}
@@ -1750,13 +1750,13 @@ bool attrIsDir(uint attributes) @safe pure nothrow @nogc
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
{
assert(attrIsDir(getAttributes("C:\\Program Files\\")));
assert(attrIsDir(getLinkAttributes("C:\\Program Files\\")));
}
- if("C:\\Windows\\system.ini".exists)
+ if ("C:\\Windows\\system.ini".exists)
{
assert(!attrIsDir(getAttributes("C:\\Windows\\system.ini")));
assert(!attrIsDir(getLinkAttributes("C:\\Windows\\system.ini")));
@@ -1764,13 +1764,13 @@ bool attrIsDir(uint attributes) @safe pure nothrow @nogc
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
{
assert(attrIsDir(getAttributes(system_directory)));
assert(attrIsDir(getLinkAttributes(system_directory)));
}
- if(system_file.exists)
+ if (system_file.exists)
{
assert(!attrIsDir(getAttributes(system_file)));
assert(!attrIsDir(getLinkAttributes(system_file)));
@@ -1840,18 +1840,18 @@ unittest
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
assert(!"C:\\Program Files\\".isFile);
- if("C:\\Windows\\system.ini".exists)
+ if ("C:\\Windows\\system.ini".exists)
assert("C:\\Windows\\system.ini".isFile);
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
assert(!system_directory.isFile);
- if(system_file.exists)
+ if (system_file.exists)
assert(system_file.isFile);
}
}
@@ -1899,13 +1899,13 @@ bool attrIsFile(uint attributes) @safe pure nothrow @nogc
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
{
assert(!attrIsFile(getAttributes("C:\\Program Files\\")));
assert(!attrIsFile(getLinkAttributes("C:\\Program Files\\")));
}
- if("C:\\Windows\\system.ini".exists)
+ if ("C:\\Windows\\system.ini".exists)
{
assert(attrIsFile(getAttributes("C:\\Windows\\system.ini")));
assert(attrIsFile(getLinkAttributes("C:\\Windows\\system.ini")));
@@ -1913,13 +1913,13 @@ bool attrIsFile(uint attributes) @safe pure nothrow @nogc
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
{
assert(!attrIsFile(getAttributes(system_directory)));
assert(!attrIsFile(getLinkAttributes(system_directory)));
}
- if(system_file.exists)
+ if (system_file.exists)
{
assert(attrIsFile(getAttributes(system_file)));
assert(attrIsFile(getLinkAttributes(system_file)));
@@ -1968,14 +1968,14 @@ unittest
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
assert(!"C:\\Program Files\\".isSymlink);
- if("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
+ if ("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
assert("C:\\Documents and Settings\\".isSymlink);
enum fakeSymFile = "C:\\Windows\\system.ini";
- if(fakeSymFile.exists)
+ if (fakeSymFile.exists)
{
assert(!fakeSymFile.isSymlink);
@@ -1993,12 +1993,12 @@ unittest
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
{
assert(!system_directory.isSymlink);
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink(system_directory, symfile.ptr);
@@ -2013,12 +2013,12 @@ unittest
assert(!attrIsFile(getLinkAttributes(symfile)));
}
- if(system_file.exists)
+ if (system_file.exists)
{
assert(!system_file.isSymlink);
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink(system_file, symfile.ptr);
@@ -2339,10 +2339,10 @@ else version(Posix) void symlink(RO, RL)(RO original, RL link)
version(Posix) @safe unittest
{
- if(system_directory.exists)
+ if (system_directory.exists)
{
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
symlink(system_directory, symfile);
@@ -2358,12 +2358,12 @@ version(Posix) @safe unittest
assert(!attrIsFile(getLinkAttributes(symfile)));
}
- if(system_file.exists)
+ if (system_file.exists)
{
assert(!system_file.isSymlink);
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
symlink(system_file, symfile);
@@ -2421,12 +2421,12 @@ else version(Posix) string readLink(R)(R link)
} ();
cenforce(size != -1, to!string(link));
- if(size <= bufferLen - maxCodeUnits)
+ if (size <= bufferLen - maxCodeUnits)
return to!string(buffer[0 .. size]);
auto dynamicBuffer = new char[](bufferLen * 3 / 2);
- foreach(i; 0 .. 10)
+ foreach (i; 0 .. 10)
{
size = () @trusted {
return posixReadlink(linkz, dynamicBuffer.ptr,
@@ -2434,7 +2434,7 @@ else version(Posix) string readLink(R)(R link)
} ();
cenforce(size != -1, to!string(link));
- if(size <= dynamicBuffer.length - maxCodeUnits)
+ if (size <= dynamicBuffer.length - maxCodeUnits)
{
dynamicBuffer.length = size;
return () @trusted {
@@ -2452,12 +2452,12 @@ else version(Posix) string readLink(R)(R link)
version(Posix) @safe unittest
{
import std.string;
- foreach(file; [system_directory, system_file])
+ foreach (file; [system_directory, system_file])
{
- if(file.exists)
+ if (file.exists)
{
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
symlink(file, symfile);
assert(readLink(symfile) == file, format("Failed file: %s", file));
@@ -2475,7 +2475,7 @@ version(Posix) @safe unittest
version(Posix) unittest // input range of dchars
{
mkdirRecurse(deleteme);
- scope(exit) if(deleteme.exists) rmdirRecurse(deleteme);
+ scope(exit) if (deleteme.exists) rmdirRecurse(deleteme);
write(deleteme ~ "/f", "");
import std.range.interfaces: InputRange, inputRangeObject;
import std.utf: byChar;
@@ -2507,7 +2507,7 @@ version(Windows) string getcwd()
immutable n = cenforce(GetCurrentDirectoryW(to!DWORD(buffW.length), buffW.ptr),
"getcwd");
// we can do it because toUTFX always produces a fresh string
- if(n < buffW.length)
+ if (n < buffW.length)
{
return toUTF8(buffW[0 .. n]);
}
@@ -2808,7 +2808,7 @@ else version(Windows)
this(string path)
{
- if(!path.exists())
+ if (!path.exists())
throw new FileException(path, "File does not exist");
_name = path;
@@ -2910,7 +2910,7 @@ else version(Posix)
this(string path)
{
- if(!path.exists)
+ if (!path.exists)
throw new FileException(path, "File does not exist");
_name = path;
@@ -2938,7 +2938,7 @@ else version(Posix)
//cost of calling lstat).
static if (__traits(compiles, fd.d_type != DT_UNKNOWN))
{
- if(fd.d_type != DT_UNKNOWN)
+ if (fd.d_type != DT_UNKNOWN)
{
_dType = fd.d_type;
_dTypeSet = true;
@@ -3038,7 +3038,7 @@ else version(Posix)
{
return stat(path.tempCString(), buf);
}
- if(_didStat)
+ if (_didStat)
return;
enforce(trustedStat(_name, &_statBuf) == 0,
@@ -3056,10 +3056,10 @@ else version(Posix)
+/
void _ensureStatOrLStatDone()
{
- if(_didStat)
+ if (_didStat)
return;
- if( stat(_name.tempCString(), &_statBuf) != 0 )
+ if ( stat(_name.tempCString(), &_statBuf) != 0 )
{
_ensureLStatDone();
@@ -3078,7 +3078,7 @@ else version(Posix)
+/
void _ensureLStatDone()
{
- if(_didLStat)
+ if (_didLStat)
return;
stat_t statbuf = void;
@@ -3108,7 +3108,7 @@ unittest
{
version(Windows)
{
- if("C:\\Program Files\\".exists)
+ if ("C:\\Program Files\\".exists)
{
auto de = DirEntry("C:\\Program Files\\");
assert(!de.isFile);
@@ -3116,13 +3116,13 @@ unittest
assert(!de.isSymlink);
}
- if("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
+ if ("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
{
auto de = DirEntry("C:\\Documents and Settings\\");
assert(de.isSymlink);
}
- if("C:\\Windows\\system.ini".exists)
+ if ("C:\\Windows\\system.ini".exists)
{
auto de = DirEntry("C:\\Windows\\system.ini");
assert(de.isFile);
@@ -3132,7 +3132,7 @@ unittest
}
else version(Posix)
{
- if(system_directory.exists)
+ if (system_directory.exists)
{
{
auto de = DirEntry(system_directory);
@@ -3142,7 +3142,7 @@ unittest
}
immutable symfile = deleteme ~ "_slink\0";
- scope(exit) if(symfile.exists) symfile.remove();
+ scope(exit) if (symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink(system_directory, symfile.ptr);
@@ -3174,7 +3174,7 @@ unittest
}
}
- if(system_file.exists)
+ if (system_file.exists)
{
auto de = DirEntry(system_file);
assert(de.isFile);
@@ -3397,7 +3397,7 @@ void rmdirRecurse(in char[] pathname)
+/
void rmdirRecurse(ref DirEntry de)
{
- if(!de.isDir)
+ if (!de.isDir)
throw new FileException(de.name, "Not a directory");
if (de.isSymlink)
@@ -3410,7 +3410,7 @@ void rmdirRecurse(ref DirEntry de)
else
{
// all children, recursively depth-first
- foreach(DirEntry e; dirEntries(de.name, SpanMode.depth, false))
+ foreach (DirEntry e; dirEntries(de.name, SpanMode.depth, false))
{
attrIsDir(e.linkAttributes) ? rmdir(e.name) : remove(e.name);
}
@@ -3545,7 +3545,7 @@ private struct DirIteratorImpl
bool next()
{
- if(_stack.data.empty)
+ if (_stack.data.empty)
return false;
WIN32_FIND_DATAW findinfo;
return toNext(true, &findinfo);
@@ -3555,17 +3555,17 @@ private struct DirIteratorImpl
{
import core.stdc.wchar_ : wcscmp;
- if(fetch)
+ if (fetch)
{
- if(FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
+ if (FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
}
}
- while( wcscmp(findinfo.cFileName.ptr, ".") == 0
+ while ( wcscmp(findinfo.cFileName.ptr, ".") == 0
|| wcscmp(findinfo.cFileName.ptr, "..") == 0)
- if(FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
+ if (FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
@@ -3583,7 +3583,7 @@ private struct DirIteratorImpl
void releaseDirStack()
{
- foreach( d; _stack.data)
+ foreach ( d; _stack.data)
FindClose(d.h);
}
@@ -3610,12 +3610,12 @@ private struct DirIteratorImpl
bool next()
{
- if(_stack.data.empty)
+ if (_stack.data.empty)
return false;
for(dirent* fdata; (fdata = readdir(_stack.data[$-1].h)) != null; )
{
// Skip "." and ".."
- if(core.stdc.string.strcmp(fdata.d_name.ptr, ".") &&
+ if (core.stdc.string.strcmp(fdata.d_name.ptr, ".") &&
core.stdc.string.strcmp(fdata.d_name.ptr, "..") )
{
_cur = DirEntry(_stack.data[$-1].dirpath, fdata);
@@ -3635,7 +3635,7 @@ private struct DirIteratorImpl
void releaseDirStack()
{
- foreach( d; _stack.data)
+ foreach ( d; _stack.data)
closedir(d.h);
}
@@ -3663,11 +3663,11 @@ private struct DirIteratorImpl
}
if (stepIn(pathnameStr))
{
- if(_mode == SpanMode.depth)
- while(mayStepIn())
+ if (_mode == SpanMode.depth)
+ while (mayStepIn())
{
auto thisDir = _cur;
- if(stepIn(_cur.name))
+ if (stepIn(_cur.name))
{
pushExtra(thisDir);
}
@@ -3680,15 +3680,15 @@ private struct DirIteratorImpl
@property DirEntry front(){ return _cur; }
void popFront()
{
- switch(_mode)
+ switch (_mode)
{
case SpanMode.depth:
- if(next())
+ if (next())
{
- while(mayStepIn())
+ while (mayStepIn())
{
auto thisDir = _cur;
- if(stepIn(_cur.name))
+ if (stepIn(_cur.name))
{
pushExtra(thisDir);
}
@@ -3696,17 +3696,17 @@ private struct DirIteratorImpl
break;
}
}
- else if(hasExtra())
+ else if (hasExtra())
_cur = popExtra();
break;
case SpanMode.breadth:
- if(mayStepIn())
+ if (mayStepIn())
{
- if(!stepIn(_cur.name))
- while(!empty && !next()){}
+ if (!stepIn(_cur.name))
+ while (!empty && !next()){}
}
else
- while(!empty && !next()){}
+ while (!empty && !next()){}
break;
default:
next();
@@ -3773,10 +3773,10 @@ foreach (DirEntry e; dirEntries("dmd-testing", SpanMode.breadth))
}
// Iterate over all *.d files in current directory and all its subdirectories
auto dFiles = dirEntries("", SpanMode.depth).filter!(f => f.name.endsWith(".d"));
-foreach(d; dFiles)
+foreach (d; dFiles)
writeln(d.name);
// Hook it up with std.parallelism to compile them all in parallel:
-foreach(d; parallel(dFiles, 1)) //passes by 1 file to each thread
+foreach (d; parallel(dFiles, 1)) //passes by 1 file to each thread
{
string cmd = "dmd -c " ~ d.name;
writeln(cmd);
@@ -3871,7 +3871,7 @@ unittest
// issue 11392
auto dFiles = dirEntries(testdir, SpanMode.shallow);
- foreach(d; dFiles){}
+ foreach (d; dFiles){}
// issue 15146
dirEntries("", SpanMode.shallow).walkLength();
@@ -3900,7 +3900,7 @@ Example:
// Iterate over all D source files in current directory and all its
// subdirectories
auto dFiles = dirEntries("","*.{d,di}",SpanMode.depth);
-foreach(d; dFiles)
+foreach (d; dFiles)
writeln(d.name);
--------------------
+/
diff --git a/std/format.d b/std/format.d
index d145498b2..20bffcce6 100644
--- a/std/format.d
+++ b/std/format.d
@@ -537,7 +537,7 @@ uint formattedWrite(Writer, Char, A...)(Writer w, in Char[] fmt, A args)
// using positional parameters!
// Make the conditional compilation of this loop explicit, to avoid "statement not reachable" warnings.
- static if(A.length > 0)
+ static if (A.length > 0)
{
foreach (i; spec.indexStart - 1 .. spec.indexEnd)
{
@@ -2767,7 +2767,7 @@ unittest // Issue 8921
template hasToString(T, Char)
{
- static if(isPointer!T && !isAggregateType!T)
+ static if (isPointer!T && !isAggregateType!T)
{
// X* does not have toString, even if X is aggregate type has toString.
enum hasToString = 0;
@@ -3580,9 +3580,9 @@ void formatTest(T)(T val, string[] expected, size_t ln = __LINE__, string fn = _
FormatSpec!char f;
auto w = appender!string();
formatValue(w, val, f);
- foreach(cur; expected)
+ foreach (cur; expected)
{
- if(w.data == cur) return;
+ if (w.data == cur) return;
}
enforce!AssertError(
false,
@@ -3597,9 +3597,9 @@ void formatTest(T)(string fmt, T val, string[] expected, size_t ln = __LINE__, s
import std.array : appender;
auto w = appender!string();
formattedWrite(w, fmt, val);
- foreach(cur; expected)
+ foreach (cur; expected)
{
- if(w.data == cur) return;
+ if (w.data == cur) return;
}
enforce!AssertError(
false,
@@ -4116,9 +4116,9 @@ void formatReflectTest(T)(ref T val, string fmt, string[] formatted, string fn =
auto input = w.data;
- foreach(cur; formatted)
+ foreach (cur; formatted)
{
- if(input == cur) return;
+ if (input == cur) return;
}
enforce!AssertError(
false,
@@ -5184,7 +5184,7 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
scope(exit) free(argBuffer);
size_t bufUsed = 0;
- foreach(ti; arguments)
+ foreach (ti; arguments)
{
// Ensure the required alignment
bufUsed += ti.talign - 1;
@@ -5378,7 +5378,7 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
import std.math : isNaN, isInfinity;
if (isNaN(v)) // snprintf writes 1.#QNAN
n = snprintf(fbuf.ptr, sl, "nan");
- else if(isInfinity(v)) // snprintf writes 1.#INF
+ else if (isInfinity(v)) // snprintf writes 1.#INF
n = snprintf(fbuf.ptr, sl, v < 0 ? "-inf" : "inf");
else
n = snprintf(fbuf.ptr, sl, format.ptr, field_width,
@@ -5451,7 +5451,7 @@ void doFormat()(scope void delegate(dchar) putc, TypeInfo[] arguments, va_list a
auto mSave = m;
valti = skipCI(valti);
keyti = skipCI(keyti);
- foreach(ref fakevalue; vaa)
+ foreach (ref fakevalue; vaa)
{
if (comma) putc(',');
comma = true;
diff --git a/std/functional.d b/std/functional.d
index 19ed00931..9eac9f135 100644
--- a/std/functional.d
+++ b/std/functional.d
@@ -269,7 +269,7 @@ private uint _ctfeSkipOp(ref string op)
while (op.length)
{
immutable front = op[0];
- if(front.isASCII() && !(front.isAlphaNum() || front == '_' || front == '.'))
+ if (front.isASCII() && !(front.isAlphaNum() || front == '_' || front == '.'))
op = op[1..$];
else
break;
@@ -286,7 +286,7 @@ private uint _ctfeSkipInteger(ref string op)
while (op.length)
{
immutable front = op[0];
- if(front.isDigit())
+ if (front.isDigit())
op = op[1..$];
else
break;
@@ -322,7 +322,7 @@ private uint _ctfeMatchUnary(string fun, string name)
}
else if (h == 1)
{
- if(!fun._ctfeSkipOp())
+ if (!fun._ctfeSkipOp())
break;
}
else
@@ -369,7 +369,7 @@ private uint _ctfeMatchBinary(string fun, string name1, string name2)
}
else if (h == 1)
{
- if(!fun._ctfeSkipOp())
+ if (!fun._ctfeSkipOp())
break;
}
else
@@ -679,7 +679,7 @@ template partial(alias fun, alias arg)
{
string msg = "Cannot call '" ~ fun.stringof ~ "' with arguments " ~
"(" ~ arg.stringof;
- foreach(T; Ts)
+ foreach (T; Ts)
msg ~= ", " ~ T.stringof;
msg ~= ").";
return msg;
diff --git a/std/getopt.d b/std/getopt.d
index 229ec8d7a..766f1a3dc 100644
--- a/std/getopt.d
+++ b/std/getopt.d
@@ -559,7 +559,7 @@ private template optionValidator(A...)
{
msg = format(fmt, "invalid argument type " ~ A[0].stringof, 0);
}
- else foreach(i; staticIota!(1, A.length))
+ else foreach (i; staticIota!(1, A.length))
{
static if (!isReceiver!(A[i]) && !isSomeString!(A[i]) &&
!(is(A[i] == config)))
@@ -1488,7 +1488,7 @@ $(D Option). If a help message is present it will be printed next. The format is
illustrated by this code:
------------
-foreach(it; opt)
+foreach (it; opt)
{
writefln("%*s %*s%s%s", lengthOfLongestShortOption, it.optShort,
lengthOfLongestLongOption, it.optLong,
diff --git a/std/internal/cstring.d b/std/internal/cstring.d
index 16cbb2a1c..fee485400 100644
--- a/std/internal/cstring.d
+++ b/std/internal/cstring.d
@@ -43,12 +43,12 @@ import std.range;
version(unittest)
@property inout(C)[] asArray(C)(inout C* cstr) pure nothrow @nogc @trusted
-if(isSomeChar!C)
+if (isSomeChar!C)
in { assert(cstr); }
body
{
size_t length = 0;
- while(cstr[length])
+ while (cstr[length])
++length;
return cstr[0 .. length];
}
diff --git a/std/internal/math/biguintcore.d b/std/internal/math/biguintcore.d
index 317a88467..aa4c94cdd 100644
--- a/std/internal/math/biguintcore.d
+++ b/std/internal/math/biguintcore.d
@@ -211,7 +211,7 @@ public:
}
///
- int opCmp(Tulong)(Tulong y) pure nothrow @nogc const @safe if(is (Tulong == ulong))
+ int opCmp(Tulong)(Tulong y) pure nothrow @nogc const @safe if (is (Tulong == ulong))
{
if (data.length > maxBigDigits!Tulong)
return 1;
@@ -847,14 +847,14 @@ public:
BigDigit [] r2;
int shifts = 63; // num bits in a long
- while(!(y & 0x8000_0000_0000_0000L))
+ while (!(y & 0x8000_0000_0000_0000L))
{
y <<= 1;
--shifts;
}
y <<=1;
- while(y!=0)
+ while (y!=0)
{
// For each bit of y: Set r1 = r1 * r1
// If the bit is 1, set r1 = r1 * x
@@ -913,7 +913,7 @@ public:
r1[$ - 1] = carry;
}
}
- while(r1[$ - 1]==0)
+ while (r1[$ - 1]==0)
{
r1=r1[0 .. $ - 1];
}
@@ -946,7 +946,7 @@ public:
inout(BigDigit) [] removeLeadingZeros(inout(BigDigit) [] x) pure nothrow @safe
{
size_t k = x.length;
- while(k>1 && x[k - 1]==0) --k;
+ while (k>1 && x[k - 1]==0) --k;
return x[0 .. k];
}
@@ -1642,7 +1642,7 @@ size_t biguintToDecimal(char [] buff, BigDigit [] data) pure nothrow
// Might be better to divide by (10^38/2^32) since that gives 38 digits for
// the price of 3 divisions and a shr; this version only gives 27 digits
// for 3 divisions.
- while(data.length>1)
+ while (data.length>1)
{
uint rem = multibyteDivAssign(data, 10_0000_0000, 0);
itoaZeroPadded(buff[sofar-9 .. sofar], rem);
@@ -1655,7 +1655,7 @@ size_t biguintToDecimal(char [] buff, BigDigit [] data) pure nothrow
itoaZeroPadded(buff[sofar-10 .. sofar], data[0]);
sofar -= 10;
// and strip off the leading zeros
- while(sofar!= buff.length-1 && buff[sofar] == '0')
+ while (sofar!= buff.length-1 && buff[sofar] == '0')
sofar++;
return sofar;
}
@@ -1924,7 +1924,7 @@ bool less(const(BigDigit)[] x, const(BigDigit)[] y) pure nothrow
{
assert(x.length >= y.length);
auto k = x.length-1;
- while(x[k]==0 && k>=y.length)
+ while (x[k]==0 && k>=y.length)
--k;
if (k>=y.length)
return false;
@@ -2427,7 +2427,7 @@ void adjustRemainder(BigDigit[] quot, BigDigit[] rem, const(BigDigit)[] v,
carry = scratch[$-1] + subAssignSimple(rem, scratch[0..$-1]);
else
carry = subAssignSimple(rem, scratch);
- while(carry)
+ while (carry)
{
multibyteIncrementAssign!('-')(quot, 1); // quot--
carry -= multibyteAdd(rem, rem, v, 0);
diff --git a/std/internal/math/biguintnoasm.d b/std/internal/math/biguintnoasm.d
index 035aad4b9..247e2b0c4 100644
--- a/std/internal/math/biguintnoasm.d
+++ b/std/internal/math/biguintnoasm.d
@@ -224,7 +224,7 @@ uint multibyteMulAdd(char op)(uint [] dest, const(uint)[] src,
ulong c = carry;
for(size_t i = 0; i < src.length; ++i)
{
- static if(op=='+')
+ static if (op=='+')
{
c += cast(ulong)(multiplier) * src[i] + dest[i];
dest[i] = cast(uint)c;
diff --git a/std/internal/math/errorfunction.d b/std/internal/math/errorfunction.d
index 33f1dd9c6..aa69edb05 100644
--- a/std/internal/math/errorfunction.d
+++ b/std/internal/math/errorfunction.d
@@ -135,7 +135,7 @@ real erfc(real a)
real y = 1.0/x;
- if( x < 8.0 ) y = z * rationalPoly(y, P, Q);
+ if ( x < 8.0 ) y = z * rationalPoly(y, P, Q);
else y = z * y * rationalPoly(y * y, R, S);
if (a < 0.0L)
@@ -323,14 +323,14 @@ real normalDistributionImpl(real a)
real x = a * SQRT1_2;
real z = abs(x);
- if( z < 1.0 )
+ if ( z < 1.0 )
return 0.5L + 0.5L * erf(x);
else {
real y = 0.5L * erfce(z);
/* Multiply by exp(-x^2 / 2) */
z = expx2(a, -1);
y = y * sqrt(z);
- if( x > 0.0L )
+ if ( x > 0.0L )
y = 1.0L - y;
return y;
}
@@ -410,17 +410,17 @@ static immutable real[8] Q3 =
0x1.e05268dd3c07989ep-3, 0x1.239c6aff14afbf82p+1, 1.0
];
- if(p<=0.0L || p>=1.0L)
+ if (p<=0.0L || p>=1.0L)
{
if (p == 0.0L)
return -real.infinity;
- if( p == 1.0L )
+ if ( p == 1.0L )
return real.infinity;
return real.nan; // domain error
}
int code = 1;
real y = p;
- if( y > (1.0L - EXP_2) ) {
+ if ( y > (1.0L - EXP_2) ) {
y = 1.0L - y;
code = 0;
}
@@ -439,7 +439,7 @@ static immutable real[8] Q3 =
z = 1.0L/x;
if ( x < 8.0L ) {
x1 = z * rationalPoly( z, P1, Q1);
- } else if( x < 32.0L ) {
+ } else if ( x < 32.0L ) {
x1 = z * rationalPoly( z, P2, Q2);
} else {
x1 = z * rationalPoly( z, P3, Q3);
diff --git a/std/internal/math/gammafunction.d b/std/internal/math/gammafunction.d
index dbc8223b5..21b023854 100644
--- a/std/internal/math/gammafunction.d
+++ b/std/internal/math/gammafunction.d
@@ -211,10 +211,10 @@ real igammaTemmeLarge(real a, real x)
];
// avoid nans when one of the arguments is inf:
- if(x == real.infinity && a != real.infinity)
+ if (x == real.infinity && a != real.infinity)
return 0;
- if(x != real.infinity && a == real.infinity)
+ if (x != real.infinity && a == real.infinity)
return 1;
real sigma = (x - a) / a;
@@ -222,16 +222,16 @@ real igammaTemmeLarge(real a, real x)
real y = a * phi;
real z = sqrt(2 * phi);
- if(x < a)
+ if (x < a)
z = -z;
real[13] workspace;
- foreach(i; 0 .. coef.length)
+ foreach (i; 0 .. coef.length)
workspace[i] = poly(z, coef[i]);
real result = poly(1 / a, workspace);
result *= exp(-y) / sqrt(2 * PI * a);
- if(x < a)
+ if (x < a)
result = -result;
result += erfc(sqrt(y)) / 2;
@@ -429,7 +429,7 @@ real logGamma(real x)
if (isNaN(x)) return x;
if (fabs(x) == x.infinity) return x.infinity;
- if( x < -34.0L )
+ if ( x < -34.0L )
{
q = -x;
w = logGamma(q);
@@ -453,7 +453,7 @@ real logGamma(real x)
return z;
}
- if( x < 13.0L )
+ if ( x < 13.0L )
{
z = 1.0L;
nx = floor( x + 0.5L );
@@ -464,7 +464,7 @@ real logGamma(real x)
z *= x;
}
while ( x < 2.0L ) {
- if( fabs(x) <= 0.03125 )
+ if ( fabs(x) <= 0.03125 )
{
if ( x == 0.0L )
return real.infinity;
@@ -489,7 +489,7 @@ real logGamma(real x)
}
// const real MAXLGM = 1.04848146839019521116e+4928L;
- // if( x > MAXLGM ) return sgngaml * real.infinity;
+ // if ( x > MAXLGM ) return sgngaml * real.infinity;
const real LOGSQRT2PI = 0.91893853320467274178L; // log( sqrt( 2*pi ) )
@@ -607,7 +607,7 @@ real betaIncomplete(real aa, real bb, real xx )
int flag = 0;
/* Reverse a and b if x is greater than the mean. */
- if( xx > (aa/(aa+bb)) ) {
+ if ( xx > (aa/(aa+bb)) ) {
// here x > aa/(aa+bb) and (bb*x>1 or x>0.95)
flag = 1;
a = bb;
@@ -621,7 +621,7 @@ real betaIncomplete(real aa, real bb, real xx )
x = xx;
}
- if( flag == 1 && (b * x) <= 1.0L && x <= 0.95L) {
+ if ( flag == 1 && (b * x) <= 1.0L && x <= 0.95L) {
// here xx > aa/(aa+bb) and ((bb*xx>1) or xx>0.95) and (aa*(1-xx)<=1) and xx > 0.05
return 1.0 - betaDistPowerSeries(a, b, x); // note loss of precision
}
@@ -631,7 +631,7 @@ real betaIncomplete(real aa, real bb, real xx )
// One is for x * (a+b+2) < (a+1),
// the other is for x * (a+b+2) > (a+1).
real y = x * (a+b-2.0L) - (a-1.0L);
- if( y < 0.0L ) {
+ if ( y < 0.0L ) {
w = betaDistExpansion1( a, b, x );
} else {
w = betaDistExpansion2( a, b, x ) / xc;
@@ -658,16 +658,16 @@ real betaIncomplete(real aa, real bb, real xx )
/+
// There seems to be a bug in Cephes at this point.
// Problems occur for y > MAXLOG, not y < MINLOG.
- if( y < MINLOG ) {
+ if ( y < MINLOG ) {
t = 0.0L;
} else {
t = exp(y);
}
+/
}
- if( flag == 1 ) {
+ if ( flag == 1 ) {
/+ // CEPHES includes this code, but I think it is erroneous.
- if( t <= real.epsilon ) {
+ if ( t <= real.epsilon ) {
t = 1.0L - real.epsilon;
} else
+/
@@ -692,15 +692,15 @@ real betaIncompleteInv(real aa, real bb, real yy0 )
if (isNaN(yy0)) return yy0;
if (isNaN(aa)) return aa;
if (isNaN(bb)) return bb;
- if( yy0 <= 0.0L )
+ if ( yy0 <= 0.0L )
return 0.0L;
- if( yy0 >= 1.0L )
+ if ( yy0 >= 1.0L )
return 1.0L;
x0 = 0.0L;
yl = 0.0L;
x1 = 1.0L;
yh = 1.0L;
- if( aa <= 1.0L || bb <= 1.0L ) {
+ if ( aa <= 1.0L || bb <= 1.0L ) {
dithresh = 1.0e-7L;
rflg = 0;
a = aa;
@@ -719,7 +719,7 @@ real betaIncompleteInv(real aa, real bb, real yy0 )
yp = -normalDistributionInvImpl( yy0 );
- if( yy0 > 0.5L ) {
+ if ( yy0 > 0.5L ) {
rflg = 1;
a = bb;
b = aa;
@@ -738,14 +738,14 @@ real betaIncompleteInv(real aa, real bb, real yy0 )
- ( 1.0L/(2.0L * b - 1.0L) - 1.0L/(2.0L * a - 1.0L) )
* (lgm + (5.0L/6.0L) - 2.0L/(3.0L * x));
d = 2.0L * d;
- if( d < MINLOG ) {
+ if ( d < MINLOG ) {
x = 1.0L;
goto under;
}
x = a/( a + b * exp(d) );
y = betaIncomplete( a, b, x );
yp = (y - y0)/y0;
- if( fabs(yp) < 0.2 )
+ if ( fabs(yp) < 0.2 )
goto newt;
/* Resort to interval halving if not close enough. */
@@ -754,40 +754,40 @@ ihalve:
dir = 0;
di = 0.5L;
for( i=0; i<400; i++ ) {
- if( i != 0 ) {
+ if ( i != 0 ) {
x = x0 + di * (x1 - x0);
- if( x == 1.0L ) {
+ if ( x == 1.0L ) {
x = 1.0L - real.epsilon;
}
- if( x == 0.0L ) {
+ if ( x == 0.0L ) {
di = 0.5;
x = x0 + di * (x1 - x0);
- if( x == 0.0 )
+ if ( x == 0.0 )
goto under;
}
y = betaIncomplete( a, b, x );
yp = (x1 - x0)/(x1 + x0);
- if( fabs(yp) < dithresh )
+ if ( fabs(yp) < dithresh )
goto newt;
yp = (y-y0)/y0;
- if( fabs(yp) < dithresh )
+ if ( fabs(yp) < dithresh )
goto newt;
}
- if( y < y0 ) {
+ if ( y < y0 ) {
x0 = x;
yl = y;
- if( dir < 0 ) {
+ if ( dir < 0 ) {
dir = 0;
di = 0.5L;
- } else if( dir > 3 )
+ } else if ( dir > 3 )
di = 1.0L - (1.0L - di) * (1.0L - di);
- else if( dir > 1 )
+ else if ( dir > 1 )
di = 0.5L * di + 0.5L;
else
di = (y0 - y)/(yh - yl);
dir += 1;
- if( x0 > 0.95L ) {
- if( rflg == 1 ) {
+ if ( x0 > 0.95L ) {
+ if ( rflg == 1 ) {
rflg = 0;
a = aa;
b = bb;
@@ -808,30 +808,30 @@ ihalve:
}
} else {
x1 = x;
- if( rflg == 1 && x1 < real.epsilon ) {
+ if ( rflg == 1 && x1 < real.epsilon ) {
x = 0.0L;
goto done;
}
yh = y;
- if( dir > 0 ) {
+ if ( dir > 0 ) {
dir = 0;
di = 0.5L;
}
- else if( dir < -3 )
+ else if ( dir < -3 )
di = di * di;
- else if( dir < -1 )
+ else if ( dir < -1 )
di = 0.5L * di;
else
di = (y - y0)/(yh - yl);
dir -= 1;
}
}
- if( x0 >= 1.0L ) {
+ if ( x0 >= 1.0L ) {
// partial loss of precision
x = 1.0L - real.epsilon;
goto done;
}
- if( x <= 0.0L ) {
+ if ( x <= 0.0L ) {
under:
// underflow has occurred
x = real.min_normal * real.min_normal;
@@ -853,17 +853,17 @@ newt:
if ( y < yl ) {
x = x0;
y = yl;
- } else if( y > yh ) {
+ } else if ( y > yh ) {
x = x1;
y = yh;
- } else if( y < y0 ) {
+ } else if ( y < y0 ) {
x0 = x;
yl = y;
} else {
x1 = x;
yh = y;
}
- if( x == 1.0L || x == 0.0L )
+ if ( x == 1.0L || x == 0.0L )
break;
/* Compute the derivative of the function at this point. */
d = (a - 1.0L) * log(x) + (b - 1.0L) * log(1.0L - x) + lgm;
@@ -880,7 +880,7 @@ newt:
if ( xt <= x0 ) {
y = (x - x0) / (x1 - x0);
xt = x0 + 0.5L * y * (x - x0);
- if( xt <= 0.0L )
+ if ( xt <= 0.0L )
break;
}
if ( xt >= x1 ) {
@@ -899,7 +899,7 @@ newt:
done:
if ( rflg ) {
- if( x <= real.epsilon )
+ if ( x <= real.epsilon )
x = 1.0L - real.epsilon;
else
x = 1.0L - x;
@@ -1020,16 +1020,16 @@ real betaDistExpansion1(real a, real b, real x )
qkm2 = qkm1;
qkm1 = qk;
- if( qk != 0.0L )
+ if ( qk != 0.0L )
r = pk/qk;
- if( r != 0.0L ) {
+ if ( r != 0.0L ) {
t = fabs( (ans - r)/r );
ans = r;
} else {
t = 1.0L;
}
- if( t < thresh )
+ if ( t < thresh )
return ans;
k1 += 1.0L;
@@ -1041,20 +1041,20 @@ real betaDistExpansion1(real a, real b, real x )
k7 += 2.0L;
k8 += 2.0L;
- if( (fabs(qk) + fabs(pk)) > BETA_BIG ) {
+ if ( (fabs(qk) + fabs(pk)) > BETA_BIG ) {
pkm2 *= BETA_BIGINV;
pkm1 *= BETA_BIGINV;
qkm2 *= BETA_BIGINV;
qkm1 *= BETA_BIGINV;
}
- if( (fabs(qk) < BETA_BIGINV) || (fabs(pk) < BETA_BIGINV) ) {
+ if ( (fabs(qk) < BETA_BIGINV) || (fabs(pk) < BETA_BIGINV) ) {
pkm2 *= BETA_BIG;
pkm1 *= BETA_BIG;
qkm2 *= BETA_BIG;
qkm1 *= BETA_BIG;
}
}
- while( ++n < 400 );
+ while ( ++n < 400 );
// loss of precision has occurred
// mtherr( "incbetl", PLOSS );
return ans;
@@ -1104,15 +1104,15 @@ real betaDistExpansion2(real a, real b, real x )
qkm2 = qkm1;
qkm1 = qk;
- if( qk != 0.0L )
+ if ( qk != 0.0L )
r = pk/qk;
- if( r != 0.0L ) {
+ if ( r != 0.0L ) {
t = fabs( (ans - r)/r );
ans = r;
} else
t = 1.0L;
- if( t < thresh )
+ if ( t < thresh )
return ans;
k1 += 1.0L;
k2 -= 1.0L;
@@ -1123,19 +1123,19 @@ real betaDistExpansion2(real a, real b, real x )
k7 += 2.0L;
k8 += 2.0L;
- if( (fabs(qk) + fabs(pk)) > BETA_BIG ) {
+ if ( (fabs(qk) + fabs(pk)) > BETA_BIG ) {
pkm2 *= BETA_BIGINV;
pkm1 *= BETA_BIGINV;
qkm2 *= BETA_BIGINV;
qkm1 *= BETA_BIGINV;
}
- if( (fabs(qk) < BETA_BIGINV) || (fabs(pk) < BETA_BIGINV) ) {
+ if ( (fabs(qk) < BETA_BIGINV) || (fabs(pk) < BETA_BIGINV) ) {
pkm2 *= BETA_BIG;
pkm1 *= BETA_BIG;
qkm2 *= BETA_BIG;
qkm1 *= BETA_BIG;
}
- } while( ++n < 400 );
+ } while ( ++n < 400 );
// loss of precision has occurred
//mtherr( "incbetl", PLOSS );
return ans;
@@ -1153,7 +1153,7 @@ real betaDistPowerSeries(real a, real b, real x )
real n = 2.0L;
real s = 0.0L;
real z = real.epsilon * ai;
- while( fabs(v) > z ) {
+ while ( fabs(v) > z ) {
u = (n - b) * x / n;
t *= u;
v = t / (a + n);
@@ -1170,7 +1170,7 @@ real betaDistPowerSeries(real a, real b, real x )
} else {
t = logGamma(a+b) - logGamma(a) - logGamma(b) + u + log(s);
- if( t < MINLOG ) {
+ if ( t < MINLOG ) {
s = 0.0L;
} else
s = exp(t);
@@ -1218,7 +1218,7 @@ body {
real ax = a * log(x) - x - logGamma(a);
/+
- if( ax < MINLOGL ) return 0; // underflow
+ if ( ax < MINLOGL ) return 0; // underflow
// { mtherr( "igaml", UNDERFLOW ); return( 0.0L ); }
+/
ax = exp(ax);
@@ -1232,7 +1232,7 @@ body {
r += 1.0L;
c *= x/r;
ans += c;
- } while( c/ans > real.epsilon );
+ } while ( c/ans > real.epsilon );
return ans * ax/a;
}
@@ -1282,7 +1282,7 @@ body {
real yc = y * c;
pk = pkm1 * z - pkm2 * yc;
qk = qkm1 * z - qkm2 * yc;
- if( qk != 0.0L ) {
+ if ( qk != 0.0L ) {
real r = pk/qk;
t = fabs( (ans - r)/r );
ans = r;
@@ -1347,7 +1347,7 @@ body {
lgm = logGamma(a);
for( i=0; i<10; i++ ) {
- if( x > x0 || x < x1 )
+ if ( x > x0 || x < x1 )
goto ihalve;
y = gammaIncompleteCompl(a,x);
if ( y < yl || y > yh )
@@ -1375,9 +1375,9 @@ body {
ihalve:
d = 0.0625L;
if ( x0 == real.max ) {
- if( x <= 0.0L )
+ if ( x <= 0.0L )
x = 1.0L;
- while( x0 == real.max ) {
+ while ( x0 == real.max ) {
x = (1.0L + d) * x;
y = gammaIncompleteCompl( a, x );
if ( y < y0 ) {
@@ -1427,7 +1427,7 @@ ihalve:
}
}
/+
- if( x == 0.0L )
+ if ( x == 0.0L )
mtherr( "igamil", UNDERFLOW );
+/
return x;
@@ -1490,7 +1490,7 @@ real digamma(real x)
negative = 1;
q = x;
p = floor(q);
- if( p == q ) {
+ if ( p == q ) {
return real.nan; // singularity.
}
/* Remove the zeros of tan(PI x)
diff --git a/std/internal/scopebuffer.d b/std/internal/scopebuffer.d
index f8fd2d8f9..f92856477 100644
--- a/std/internal/scopebuffer.d
+++ b/std/internal/scopebuffer.d
@@ -359,7 +359,7 @@ unittest
char[10] tmpbuf = void;
auto textbuf = ScopeBuffer!char(tmpbuf);
scope(exit) textbuf.free();
- foreach(i; 0..10) textbuf.put('w');
+ foreach (i; 0..10) textbuf.put('w');
const csb = textbuf;
const elem = csb[3];
const slice0 = csb[0..5];
diff --git a/std/internal/unicode_comp.d b/std/internal/unicode_comp.d
index 966a83e03..8d3544acd 100644
--- a/std/internal/unicode_comp.d
+++ b/std/internal/unicode_comp.d
@@ -3,7 +3,7 @@ import std.internal.unicode_tables;
@safe pure nothrow @nogc:
-static if(size_t.sizeof == 8) {
+static if (size_t.sizeof == 8) {
//6976 bytes
enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 7, 6)([ 0x0, 0x20, 0x120], [ 0x100, 0x400, 0x1240], [ 0x402030202020100, 0x206020202020205, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x20001, 0x300000000, 0x5000400000000, 0x8000000070006, 0xb0000000a0009, 0xe0000000d000c, 0x11000f0010000f, 0x11000f0011000f, 0x1100000011000f, 0x11000f00120000, 0x13000000110000, 0x17001600150014, 0x1b001a00190018, 0x1d0000001c, 0x0, 0x0, 0x1e0000, 0x0, 0x0, 0x0, 0x2000000000001f, 0x2100000000, 0x22, 0x240023, 0x28002700260025, 0x2a000000000029, 0x2b000000000000, 0x0, 0x0, 0x2c000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2d000000000000, 0x2f0000002e0000, 0x0, 0x0, 0x3100000030, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x34003300320000, 0x0, 0x36000000000035, 0x3a003900380037, 0x3c003b00000000, 0x3d000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x0, 0x3f, 0x0, 0x0, 0x40000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4200350000, 0x3a000000000043, 0x0, 0x0, 0x0, 0x0, 0x4400000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4600450000, 0x470000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6e6, 0xdcdce8e6e6e6e6e6, 0xdcdcdcdcd8e8dcdc, 0xcadcdcdcdccacadc, 0xdcdcdcdcdcdcdcca, 0x1010101dcdcdcdc, 0xe6e6e6dcdcdcdc01, 0xdce6f0e6e6e6e6e6, 0xdcdce6e6e6dcdc, 0xe6dcdcdcdce6e6e6, 0xe9eaeae9e6dcdce8, 0xe6e6e6e6e6e9eaea, 0xe6e6e6e6e6e6e6e6, 0x0, 0x0, 0xe6e6e6e6e6000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6dce6e6e6e6dc00, 0xe6e6e6e6dcdee6e6, 0xdcdcdcdcdcdce6e6, 0xe6e4dee6e6dce6e6, 0x11100f0e0d0c0b0a, 0x1700161514131312, 0x1200dce600191800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6e6e6e6e6, 0x201f1e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f1e1d1c1b000000, 0xe6dcdce6e6222120, 0xdce6e6dce6e6e6e6, 0x0, 0x0, 0x23, 0x0, 0x0, 0x0, 0xe6e6000000000000, 0xe60000e6e6e6e6e6, 0xe60000e6dce6e6e6, 0xdce6e6dc00e6, 0x0, 0x0, 0x0, 0x0, 0x2400, 0x0, 0x0, 0x0, 0xdce6e6dce6e6dce6, 0xe6dce6dcdce6dcdc, 0xe6dce6dce6dce6e6, 0xe6e6dc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6e6000000, 0xe6dce6e6, 0x0, 0x0, 0x0, 0xe6e6000000000000, 0xe6e6e6e6e600e6e6, 0xe6e6e600e6e6e6e6, 0xe6e6e6e6e600, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdcdcdc00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6dce6e600000000, 0xdcdcdce6e6e6dce6, 0xe6dce6e6e61d1c1b, 0xe6e6e6e6dcdce6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x700000000, 0x0, 0x90000000000, 0xe6e6dce600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000000000, 0x5b540000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x96767, 0x0, 0x6b6b6b6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7676, 0x0, 0x7a7a7a7a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdcdc, 0x0, 0x0, 0xdc00dc0000000000, 0xd800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8400828100, 0x828282820000, 0xe6e60009e6e60082, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x700000000000000, 0x90900, 0x0, 0xdc0000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e60000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900000000, 0x0, 0x0, 0x0, 0x900000000, 0x0, 0x0, 0x0, 0x90000, 0xe60000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdce6de00, 0x0, 0x0, 0xe600000000000000, 0xdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0xe6e6e60000000000, 0xdc0000e6e6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x700000000, 0x0, 0x900000000, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6dce6000000, 0xe6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9090000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7000000000000, 0x0, 0x9090000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x700000000000000, 0x0, 0x0, 0x0, 0xdcdcdc0100e6e6e6, 0xdcdcdcdce6e6dcdc, 0x1010101010100e6, 0xdc0000000001, 0xe600000000, 0x0, 0xe6e6e6e6e6dce6e6, 0xdcd6eae6e6dce6e6, 0xe6e6e6e6e6e6e6ca, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6, 0x0, 0x0, 0xdce6dce900000000, 0x0, 0x0, 0xe6e6e6e60101e6e6, 0xe6e6010101, 0xe60101000000e600, 0xdcdcdcdc0101e6dc, 0xe6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe600000000000000, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900000000000000, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0e0dee8e4da0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe600000000000000, 0xe6e6e6e600000000, 0xe6e6e6e6e6e6, 0x0, 0x0, 0x0, 0xe600000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6, 0x0, 0x9000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900000000, 0x0, 0x0, 0x0, 0xe6e6e6e6e6e6e6e6, 0xe6e6e6e6e6e6e6e6, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdcdcdc000000, 0x0, 0x0, 0x0, 0x0, 0x9000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7000000, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe60000dce6e600e6, 0xe6e60000000000e6, 0xe600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc0000000000, 0x0, 0xe600dc0000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900000000dc01e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x70900, 0xe6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x909000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x709000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1d8d80000000000, 0xd8d8e20000000101, 0xd8d8d8, 0xdcdcdcdcdc000000, 0xe6e6e60000dcdcdc, 0xdcdce6e6, 0x0, 0x0, 0x0, 0xe6e6e6e60000, 0x0, 0x0, 0xe6e6e60000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
enum composeIdxMask = (1<<11)-1, composeCntShift = 11;
@@ -18,7 +18,7 @@ return t;
}
-static if(size_t.sizeof == 4) {
+static if (size_t.sizeof == 4) {
//6976 bytes
enum combiningClassTrieEntries = TrieEntry!(ubyte, 8, 7, 6)([ 0x0, 0x40, 0x240], [ 0x100, 0x400, 0x1240], [ 0x2020100, 0x4020302, 0x2020205, 0x2060202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20001, 0x0, 0x0, 0x3, 0x0, 0x50004, 0x70006, 0x80000, 0xa0009, 0xb0000, 0xd000c, 0xe0000, 0x10000f, 0x11000f, 0x11000f, 0x11000f, 0x11000f, 0x110000, 0x120000, 0x11000f, 0x110000, 0x130000, 0x150014, 0x170016, 0x190018, 0x1b001a, 0x1c, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x1e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x200000, 0x0, 0x21, 0x22, 0x0, 0x240023, 0x0, 0x260025, 0x280027, 0x29, 0x2a0000, 0x0, 0x2b0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2d0000, 0x2e0000, 0x2f0000, 0x0, 0x0, 0x0, 0x0, 0x30, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x320000, 0x340033, 0x0, 0x0, 0x35, 0x360000, 0x380037, 0x3a0039, 0x0, 0x3c003b, 0x0, 0x3d0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x350000, 0x42, 0x43, 0x3a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x450000, 0x46, 0x470000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xdcdce8e6, 0xd8e8dcdc, 0xdcdcdcdc, 0xdccacadc, 0xcadcdcdc, 0xdcdcdcca, 0xdcdcdcdc, 0xdcdcdcdc, 0x1010101, 0xdcdcdc01, 0xe6e6e6dc, 0xe6e6e6e6, 0xdce6f0e6, 0xe6e6dcdc, 0xdcdce6, 0xdce6e6e6, 0xe6dcdcdc, 0xe6dcdce8, 0xe9eaeae9, 0xe6e9eaea, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0xe6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6dc00, 0xe6dce6e6, 0xdcdee6e6, 0xe6e6e6e6, 0xdcdce6e6, 0xdcdcdcdc, 0xe6dce6e6, 0xe6e4dee6, 0xd0c0b0a, 0x11100f0e, 0x14131312, 0x17001615, 0x191800, 0x1200dce6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6, 0xe6e6e6e6, 0x201f1e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b000000, 0x1f1e1d1c, 0xe6222120, 0xe6dcdce6, 0xe6e6e6e6, 0xdce6e6dc, 0x0, 0x0, 0x0, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e60000, 0xe6e6e6e6, 0xe60000e6, 0xdce6e6e6, 0xe60000e6, 0xe6dc00e6, 0xdce6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6dce6, 0xdce6e6dc, 0xdce6dcdc, 0xe6dce6dc, 0xe6dce6e6, 0xe6dce6dc, 0xe6e6dc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0xe6e6e6e6, 0xe6dce6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e60000, 0xe600e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e600, 0xe6e6e600, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdcdcdc00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6dce6e6, 0xe6e6dce6, 0xdcdcdce6, 0xe61d1c1b, 0xe6dce6e6, 0xe6dcdce6, 0xe6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x900, 0xe6dce600, 0xe6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900, 0x0, 0x5b5400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x96767, 0x0, 0x0, 0x0, 0x6b6b6b6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7676, 0x0, 0x0, 0x0, 0x7a7a7a7a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdcdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc00dc00, 0xd800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x828100, 0x84, 0x82820000, 0x8282, 0xe6e60082, 0xe6e60009, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7000000, 0x90900, 0x0, 0x0, 0x0, 0x0, 0xdc00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000, 0x0, 0x0, 0xe600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdce6de00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0xdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0xe6e6e600, 0xe6e6e6e6, 0xdc0000e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0xe6e6e6dc, 0xe6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9090000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x70000, 0x0, 0x0, 0x9090000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6, 0xdcdcdc01, 0xe6e6dcdc, 0xdcdcdcdc, 0x10100e6, 0x1010101, 0x1, 0xdc00, 0x0, 0xe6, 0x0, 0x0, 0xe6dce6e6, 0xe6e6e6e6, 0xe6dce6e6, 0xdcd6eae6, 0xe6e6e6ca, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdce6dce9, 0x0, 0x0, 0x0, 0x0, 0x101e6e6, 0xe6e6e6e6, 0xe6010101, 0xe6, 0xe600, 0xe6010100, 0x101e6dc, 0xdcdcdcdc, 0xe6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe4da0000, 0xe0e0dee8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0x0, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x90000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6e6e6, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc000000, 0xdcdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7000000, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e600e6, 0xe60000dc, 0xe6, 0xe6e60000, 0xe600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x90000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x900, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e6e6e6, 0xe6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc00, 0x0, 0x0, 0x0, 0xe600dc00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc01e6, 0x9000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x70900, 0x0, 0xe6e6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9000000, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7090000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1d8d800, 0x101, 0xd8d8e200, 0xd8d8d8, 0x0, 0xdc000000, 0xdcdcdcdc, 0xdcdcdc, 0xe6e6e600, 0xdcdce6e6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe6e60000, 0xe6e6, 0x0, 0x0, 0x0, 0x0, 0xe6e60000, 0xe6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
enum composeIdxMask = (1<<11)-1, composeCntShift = 11;
diff --git a/std/internal/unicode_decomp.d b/std/internal/unicode_decomp.d
index bfe665b7b..a12183260 100644
--- a/std/internal/unicode_decomp.d
+++ b/std/internal/unicode_decomp.d
@@ -3,7 +3,7 @@ import std.internal.unicode_tables;
@safe pure nothrow @nogc:
-static if(size_t.sizeof == 8) {
+static if (size_t.sizeof == 8) {
//22656 bytes
enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)([ 0x0, 0x20, 0x2a0], [ 0x100, 0xa00, 0x21c0], [ 0x402030202020100, 0x706020202020205, 0x802020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x0, 0x3000200010000, 0x7000600050004, 0xa000900080000, 0xc000b, 0xf000e000d0000, 0x11001000000000, 0x15001400130012, 0x19001800170016, 0x1b001a00000000, 0x0, 0x1c, 0x1e0000001d0000, 0x1f00000000, 0x0, 0x0, 0x0, 0x0, 0x2100200000, 0x2200000000, 0x2400230000, 0x0, 0x2500000000, 0x2700000026, 0x2800000000, 0x2900000000, 0x2a00000000, 0x2b00000000, 0x2c0000, 0x2e002d0000, 0x3100300000002f, 0x330032, 0x340000, 0x35000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3800370036, 0x0, 0x0, 0x0, 0x3b003a00390000, 0x3d003c, 0x410040003f003e, 0x45004400430042, 0x49004800470046, 0x4d004c004b004a, 0x510050004f004e, 0x530052, 0x57005600550054, 0x5a00590058, 0x5e005d005c005b, 0x6100000060005f, 0x620000, 0x0, 0x63000000000000, 0x67006600650064, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x69000000000068, 0x6a00000000, 0x0, 0x0, 0x6b000000000000, 0x0, 0x6c000000000000, 0x0, 0x0, 0x6e00000000006d, 0x7200710070006f, 0x7500740073, 0x79007800770076, 0x7d007c007b007a, 0x80007f007e0000, 0x81, 0x85008400830082, 0x89008800870086, 0x8d008c008b008a, 0x910090008f008e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x92000000000000, 0x93000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x97009600950094, 0x9b009a00990098, 0x9f009e009d009c, 0xa200a100a0, 0xa600a500a400a3, 0xaa00a900a800a7, 0xae00ad00ac00ab, 0xb200b100b000af, 0xb600b500b400b3, 0xba00b900b800b7, 0xbe00bd00bc00bb, 0xc200c100c000bf, 0xc600c500c400c3, 0xca00c900c800c7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcc00cb, 0xcd0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf00ce00000000, 0xd100d00000, 0x0, 0x0, 0x0, 0x0, 0xd500d400d300d2, 0xd900d800d700d6, 0xdd00dc00db00da, 0xdf00d300d200de, 0xe200e100e000d5, 0xe500e400e300d9, 0xe900e800e700e6, 0xed00ec00eb00ea, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf100f000ef00ee, 0xf300f2, 0x0, 0x0, 0x0, 0x0, 0xf700f600f500f4, 0xf8, 0xfb00fa00f9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff00fe00fd00fc, 0x103010201010100, 0x107010601050104, 0x10b010a01090108, 0x10c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x69200000015, 0x9000000000000, 0x30f034300000000, 0x11b20003, 0x78703140048, 0x49403c603ce, 0x58605730570056d, 0x5f8000005b005a6, 0x6580631062e062b, 0x6f906ea06e706e4, 0x7a907a6078f0000, 0x7e307bf07ac, 0x8b708b408b10000, 0x95f08cb, 0x9c209af09ac09a9, 0xa47000009ec09e2, 0xab30a8c0a890a86, 0xb550b490b460b43, 0xc5e0c5b0c410000, 0xc980c740c61, 0xd6e0d6b0d680000, 0xe1b00000e0c0d82, 0x9c8058c09c50589, 0xa3b05ec0a0a05ce, 0xa4105f20a3e05ef, 0xa6e061a0a4405f5, 0xaa2064700000000, 0xab006550aad0652, 0xab9065e0ad00675, 0xb0106a00afb069a, 0xb0a06a90b0406a3, 0xb1606ba, 0xb4f06f00b4c06ed, 0xb6b070f0b5206f3, 0xb3706d8000006f6, 0xbae072e0b730717, 0x7500bcc07430000, 0x7400bcf07460bd9, 0x78c000000000bc9, 0x7950c4d079b0c3e, 0xed70c47, 0xc8e07d90c8307ce, 0xca207ed, 0xd1d08580d070842, 0xd2b086c0d0d0848, 0xd49088a0d320873, 0xd5d08a60d380879, 0xd54089d, 0xd7808c10d7108ba, 0xd9808e10d7f08c8, 0xdc4090d0d9b08e4, 0xe0f09620de9093f, 0x97f0e290979096e, 0x8400614060d0e2f, 0xcae07f9, 0x0, 0x0, 0x8f0000000000000, 0xda7, 0x0, 0x0, 0x0, 0x0, 0x7360a670613060c, 0x78307800bb9073d, 0x70309f305b70c32, 0x8e70ca507f00b5f, 0x8d20d8d08d60d9e, 0x8ce0d9108da0d89, 0x9e505a900000d85, 0xe630e5a09de05a2, 0xb0706a600000000, 0xccc08170ba80728, 0xecc0e7b0ccf081a, 0xa64061006090b76, 0xaf80697, 0x9ef05b30c3b0789, 0xe680e5d0e600e57, 0x9f905bd09f605ba, 0xabf06640abc0661, 0xb6507090b620706, 0xcab07f60ca807f3, 0xd13084e0d10084b, 0xda408ed0da108ea, 0xd5a08a30d460887, 0xb1f06c300000000, 0x0, 0x9db059f00000000, 0xc9b07e60ac9066e, 0xc9107dc0c7b07c6, 0xe1509680c9407df, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa11073e0e9a0b0d, 0xde10eb80eb60eb4, 0x695, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4b00240012000f, 0x270006, 0xb4108400a280e96, 0xecf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b00000004001a, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xed5, 0x5400000000, 0x54600000000, 0x0, 0x7410ee8001c0003, 0xfb40f630f43, 0x103c101600000fed, 0x1185, 0x0, 0x0, 0x0, 0x0, 0x0, 0x101f0fbd00000000, 0x1175111910f5108f, 0x1213, 0x0, 0x0, 0x0, 0x0, 0x0, 0x120c117e00000000, 0x124b120311d5, 0x10161011116e10ea, 0x11ee123c101f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11f811f011ae, 0x10f00fad, 0x100d0000, 0x0, 0x12ad000012b612b0, 0x12a4000000000000, 0x0, 0x12d712c212ce, 0x0, 0x0, 0x12c80000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x130a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12ef000012f812f2, 0x132d000000000000, 0x0, 0x131b13041310, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1333133000000000, 0x0, 0x0, 0x12fb12b90000, 0x0, 0x0, 0x0, 0x12ec12aa12e912a7, 0x12f512b300000000, 0x1339133600000000, 0x130112bf12fe12bc, 0x130712c500000000, 0x131512d1130d12cb, 0x133f133c00000000, 0x131812d4132a12e6, 0x132112dd131e12da, 0x132412e0, 0x132712e3, 0x0, 0x0, 0x1342000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13e913e600000000, 0x17ca13ec178f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x185b179213ef0000, 0x1811, 0x0, 0x18520000186d, 0x0, 0x0, 0x0, 0x186a000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18820000, 0x0, 0x188b0000, 0x188e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1879187618731870, 0x18881885187f187c, 0x0, 0x0, 0x189a000000000000, 0x189d, 0x0, 0x0, 0x0, 0x1897000018941891, 0x0, 0x0, 0x0, 0x0, 0x18ac000000000000, 0x18af00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18a618a318a00000, 0x18a900000000, 0x0, 0x0, 0x18b80000000018bb, 0x18be, 0x0, 0x0, 0x0, 0x18b518b2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18c1, 0x0, 0x0, 0x0, 0x0, 0x18ca18c400000000, 0x18c7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18cd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18d0, 0x18da000000000000, 0x18d618d3000018dd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18e618e000000000, 0x18e3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18e900000000, 0x18f318ef18ec, 0x0, 0x0, 0x0, 0x0, 0x18f6000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18ff000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18fc18f9, 0x0, 0x0, 0x0, 0x1902, 0x0, 0x0, 0x0, 0x0, 0x1907000000000000, 0x0, 0x0, 0x190a0000, 0x190d00000000, 0x1910000000000000, 0x0, 0x1913, 0x0, 0x0, 0x19040000, 0x0, 0x1916000000000000, 0x1931193519190000, 0x1938193c, 0x0, 0x191c0000, 0x0, 0x0, 0x0, 0x1922000000000000, 0x0, 0x0, 0x19250000, 0x192800000000, 0x192b000000000000, 0x0, 0x192e, 0x0, 0x0, 0x191f0000, 0x0, 0x0, 0x193f00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1942, 0x0, 0x1a3800000000, 0x1a3e00001a3b, 0x1a4400001a41, 0x1a4700000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a4a000000000000, 0x1a4d0000, 0x1a5600001a531a50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5d50e550568, 0x6870e75062905e6, 0x71a060706cf06ac, 0x77e07230734, 0x82c06af0e7e07a4, 0x6920770056b088d, 0x9371a590e840e82, 0xe8e0e8c0a7d0a2e, 0xb79000006020e90, 0xe8807870e7105d3, 0xba30cd31a5d1a5b, 0x86a0ea41a610a24, 0x10ee10ec10ea1a63, 0xa110ae0123e123c, 0x10ec10ea086a0a24, 0x123e123c11f0, 0x0, 0x0, 0x0, 0x1313, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe86000000000000, 0xe900e660e8a09a0, 0xe980e940e920ad9, 0x1a650ea00e9e0e9c, 0xed31a670ea20ed1, 0xeac0eaa0ea60ea8, 0xeba0eb20eb00eae, 0xec00ebe0e790ebc, 0x6110ec40ec21a5f, 0x116e0eca0ec80ec6, 0xa1305da0a0705cb, 0xa1905e00a1605dd, 0xa6b06170a4a05fb, 0xa7a06260a71061d, 0xa7706230a740620, 0xaa9064e0aa5064a, 0xad6067b0ad30678, 0xaef06840acc0671, 0xb1906bd0afe069d, 0xb1c06c00b2206c6, 0xb2806cc0b2506c9, 0xb5806fc0b6e0712, 0xbab072b0ba50725, 0xbd207490bb10731, 0xbdf07560bd5074c, 0xc1207720bdc0753, 0xc1807780c150775, 0xc4a07980c440792, 0xc50079e0c5307a1, 0xc7f07ca0c7707c2, 0xc8a07d50c8607d1, 0xcef08380cec0835, 0xd1608510d0a0845, 0xd20085b0d190854, 0xd3f08800d350876, 0xd3b087c0d2e086f, 0xd4e089a0d420883, 0xd6308ac0d5708a0, 0xdc1090a0d6008a9, 0xdc709100dca0913, 0xd7b08c40d7408bd, 0xdde09270ddb0924, 0xde6093c0de30939, 0xdec09420def0945, 0xe0109540df50948, 0xe18096b0e040957, 0xe3509850e2c097c, 0xd510b2b0e380988, 0xd3509a60e210df2, 0x0, 0x9e905ad09fc05c0, 0x9b2057609b6057a, 0x9ba057e09be0582, 0x9cf059309ff05c3, 0x9d7059b09cb058f, 0xa0305c709d30597, 0xab6065b0ac20667, 0xa9306380a9f0644, 0xa9b06400a8f0634, 0xac5066a0a97063c, 0xb68070c0b5c0700, 0xc9f07ea0cc50810, 0xc6407af0c6807b3, 0xc6c07b70c7007bb, 0xcb508000cc80813, 0xcbd08080cb107fc, 0xcc1080c0cb90804, 0xd9508de0dbe0907, 0xdaa08f30dae08f7, 0xdb208fb0db608ff, 0xe09095c0dba0903, 0xe1e09710e240974, 0xe120965, 0x0, 0x10c1109f10be109c, 0x10d310b110ca10a8, 0xf160ef40f130ef1, 0xf280f060f1f0efd, 0x110610fb110310f8, 0x110a10ff, 0xf540f490f510f46, 0xf580f4d, 0x1145112311421120, 0x11571135114e112c, 0xf8b0f690f880f66, 0xf9d0f7b0f940f72, 0x119f1190119c118d, 0x11a7119811a31194, 0xfd20fc30fcf0fc0, 0xfda0fcb0fd60fc7, 0x11e611db11e311d8, 0x11ea11df, 0xffe0ff30ffb0ff0, 0x10020ff7, 0x122d121e122a121b, 0x1235122612311222, 0x1025000010220000, 0x102d000010290000, 0x1277125512741252, 0x128912671280125e, 0x106410421061103f, 0x10761054106d104b, 0x10f510f2108f1088, 0x1175117211191112, 0x1203120011d511d2, 0x124b1244, 0x10c510a310dc10ba, 0x10d710b510ce10ac, 0xf1a0ef80f310f0f, 0xf2c0f0a0f230f01, 0x114911271160113e, 0x115b113911521130, 0xf8f0f6d0fa60f84, 0xfa10f7f0f980f76, 0x127b125912921270, 0x128d126b12841262, 0x10681046107f105d, 0x107a10581071104f, 0x10e7108b10961099, 0x10e310e000001092, 0xee80ee50eeb0eee, 0x2a1170002a0f35, 0x116b111500200051, 0x116711640000111c, 0xf630f600f430f40, 0x350031002d0faa, 0x118511811178117b, 0x118911ab00000000, 0xfb40fb10fb70fba, 0x440040003c0000, 0x1213120f12061209, 0x1217123911f511f2, 0x101610131019101c, 0x995001c0018100a, 0x129d124700000000, 0x129912960000124e, 0x103c10390fed0fea, 0x3900031083, 0x1000100010001, 0x1000100010001, 0x100010001, 0x0, 0x1a690000, 0x4e000000000000, 0x0, 0x0, 0x0, 0x2ff02fc02fa, 0x0, 0x1000000000000, 0x1a6f000000000000, 0x1a7e1a7b00001a72, 0x0, 0xc0000008f, 0x0, 0x563000000000000, 0x920560, 0x0, 0x0, 0x1a76000000000000, 0x0, 0x1000000000000, 0x0, 0x0, 0x0, 0x0, 0xae00305, 0x392038303740365, 0x1aad02f403b003a1, 0xb3b00a500a10544, 0x30f034303140305, 0x392038303740365, 0x1aad02f403b003a1, 0xa500a10544, 0xb4107870a7d0692, 0xa280b790b0d0e8c, 0x8400cd30b3b05d3, 0xba3, 0x0, 0x0, 0x83f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe4d05e309a2099e, 0xe770a220a1e0000, 0x6ac06020e500000, 0xe6d0b0d06ac06ac, 0xa28073406cf06cf, 0x786077e0000, 0x82c083b06af0000, 0x82c082c, 0x897088f0863, 0x77c0000060a, 0x5b0071a0000060a, 0xa7d000005e305d5, 0x7230000067e0629, 0x136a136213540787, 0x68000000ae0136f, 0x10060f3a10ec11ee, 0x1aab, 0xa7d0a2e05e60000, 0x73e0ae0, 0x0, 0x3ca03c103e203da, 0x498045903d20455, 0x3de04e703d604cf, 0x3be051104eb049c, 0x6de06d406d106cf, 0x91f091b091806b2, 0x950094d068206e1, 0x72305e605e30734, 0xb3d0b330b300ae0, 0xdd60dd20dcf086a, 0xdfd0dfa0b410b40, 0x5d30a2e09a00a28, 0x0, 0x0, 0x30d0000, 0x0, 0x0, 0x0, 0x1a8d1a8600000000, 0x0, 0x0, 0x0, 0x0, 0x1a9200000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a981a9b1a950000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1aa0, 0x1aa50000, 0x1aa8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ab200001aaf, 0x0, 0x1ac100001ab81ab5, 0x1ac4, 0x0, 0x0, 0x0, 0x1ac80000, 0x1ace000000001acb, 0x1ad10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ad700000556, 0x0, 0x0, 0x55b054a1ad40000, 0x1add1ada, 0x1ae31ae0, 0x1ae91ae6, 0x0, 0x1aef1aec, 0x1afb1af8, 0x1b011afe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b131b101b0d1b0a, 0x0, 0x0, 0x0, 0x0, 0x1b071b041af51af2, 0x0, 0x1b191b1600000000, 0x1b1f1b1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b371b350000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x365030f03430314, 0x3a1039203830374, 0x342032f031c03b0, 0x382037303640355, 0x3f703af03a00391, 0xe600e200d900a3, 0xf600f200ee00ea, 0xb100ac00a700fa, 0xc500c000bb00b6, 0xdd00d400cf00ca, 0x368035903460319, 0x3a4039503860377, 0x3450332031f03b3, 0x385037603670358, 0x3fa03b203a30394, 0x172016e016a0166, 0x182017e017a0176, 0x192018e018a0186, 0x1a2019e019a0196, 0x1b201ae01aa01a6, 0x1c201be01ba01b6, 0x5d5056801ca01c6, 0x67e062905e605e3, 0x60706cf06ac0687, 0x77e07230734071a, 0x82c083b06af07a4, 0x6b2056b088d085e, 0x60a095a06820770, 0xa2e09a009370692, 0xb0d06020ad90a7d, 0xa280b79073e0ae0, 0xcd307870b3b05d3, 0xba308400a1105d8, 0xb410de1086a0a24, 0x30506110695, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1abc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x552054f0542, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b2c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b2073e, 0x0, 0x0, 0x0, 0x1b2f000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x227c000000000000, 0x0, 0x0, 0x0, 0x0, 0x26b0000000000000, 0x0, 0x0, 0x0, 0x1f091f011efb1ee9, 0x1f1b1f171f131f0d, 0x1f5f1f571f4b1f21, 0x1f871f771f6f1f67, 0x1fb91fa51f8b1f89, 0x1fcd1fc71fc51fc1, 0x1feb1fe91fdd1fdb, 0x204f20451ff71fef, 0x207f207d2079206f, 0x20b420ae20982087, 0x20ce20cc20ca20c4, 0x20f820f220dc20da, 0x210f2108210020fc, 0x212f212b21292113, 0x2141213921352131, 0x21972195218b214f, 0x21e521e321d921d7, 0x32521f121ed21e9, 0x2260222303292211, 0x227a2274226e2266, 0x228422822280227e, 0x230c230622e22286, 0x231623122310230e, 0x2334233023222318, 0x235c235a23562354, 0x2376237423622360, 0x238a238823862384, 0x23aa23a823a62394, 0x23ee23de23dc23bc, 0x241c240a23fa23f6, 0x2452244c2442243e, 0x245e245c245a2456, 0x247e247a246c246a, 0x248e248a24842482, 0x2498249624922490, 0x250e250c24f224e8, 0x2530252c25282512, 0x2558255425522534, 0x25742572255c255a, 0x2592258425822578, 0x25ba25aa25982596, 0x25de25c825c425c2, 0x260025fa25e825e0, 0x261a261826142608, 0x26262624261e261c, 0x263c263a2638262a, 0x2658264e264a2648, 0x26622660265c265a, 0x2670266826662664, 0x26862684267e267c, 0x2690268e268a2688, 0x26a0269c26982692, 0x26aa26a826a626a2, 0x26b226ae, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b4900000000, 0x1fd11fcf1fcd, 0x0, 0x0, 0x0, 0x0, 0x1b8100001b7e, 0x1b8700001b84, 0x1b8d00001b8a, 0x1b9300001b90, 0x1b9900001b96, 0x1b9f00001b9c, 0x1ba500001ba20000, 0x1ba80000, 0x0, 0x1bb100001bae1bab, 0x1bba1bb700001bb4, 0x1bc01bbd0000, 0x1bc91bc6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b7b, 0x87000000000000, 0x1bcc1bd30000008a, 0x0, 0x0, 0x0, 0x1c4300001c26, 0x1c9200001bf6, 0x1caf00001c9b, 0x1cca00001cbf, 0x1cdc00001ccf, 0x1ceb00001ce1, 0x1cf700001cf20000, 0x1c100000, 0x0, 0x1d3b00001d261d1d, 0x1d611d5700001d42, 0x1d7e1d760000, 0x1caa1da1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1e44000000001c01, 0x1e571e521e4d, 0x1ca11e6000000000, 0x0, 0x0, 0x0, 0x0, 0x1a10194919440000, 0x19501a141a12194b, 0x1a181a1619571955, 0x1a201a1e1a1c1a1a, 0x19661961195c19a6, 0x196f196d196819b0, 0x198e198319811977, 0x1947199d19981993, 0x19de19dc19da19d8, 0x198c19e419e219e0, 0x19ee19ec19ea19e8, 0x19f619f419f21975, 0x19fe197f19fa19f8, 0x1a2219a419a219d4, 0x1a2a1a281a261a24, 0x1a3019a81a2e1a2c, 0x19ae19ac19aa1a32, 0x19b819b619b419b2, 0x19c019be19bc19ba, 0x19c819c619c419c2, 0x1a361a3419cc19ca, 0x1a0019d219d019ce, 0x1a081a061a041a02, 0x1a0e1a0c1a0a, 0x1f171ee900000000, 0x1efd1ef120471eef, 0x1ef71f0d23641ef3, 0x1f212051208c1eeb, 0x1e901e001d701ce, 0x20d020401fb01f2, 0x245023c02330225, 0x1db01d20257024e, 0x1ff01f601ed01e4, 0x237022902110208, 0x25b025202490240, 0x21e0216022e, 0x2a0026802700260, 0x284026402880274, 0x2c402b00290026c, 0x2a402ec02b802c0, 0x2d002b402bc02ac, 0x2d402e402c80298, 0x2a8029c0278028c, 0x29402e8027c02cc, 0x2e002dc028002d8, 0x23fe21e321112021, 0x0, 0x0, 0x41c04110406082e, 0x440043904320427, 0x475046e044e0447, 0x4850482047f047c, 0x19571950194b1944, 0x196f19681961195c, 0x1993198e19831977, 0x194d1946199d1998, 0x1963195e19591952, 0x198519791971196a, 0x199f199a19951990, 0x1974197c1988, 0x20471eef1f171ee9, 0x1f5f1eed1f611f19, 0x22e203291fcd1f0f, 0x204f25c822232286, 0x2240221b223b0325, 0x23ca255e231c2007, 0x2098236823e21fab, 0x22961fdf1f4925a2, 0x208a1f731f2b262c, 0x20fa1ef31efd1ef1, 0x20b220b81fc92001, 0x1fd725681f292390, 0x48e048b04882083, 0x4b704b404b10491, 0x4c304c004bd04ba, 0x4e404cc04c904c6, 0x4d604a3034e033b, 0x5290518050304f2, 0x34d033a0327053a, 0x7390a7f0a8206b4, 0x1c0a1bff1bf11bd8, 0x1c731c411c241c1a, 0x1cbd1cad1c991c90, 0x1cdf1cda1ccd1c1e, 0x1bde1cf51cf01bfb, 0x1c8e1d111d0f1ca6, 0x1d551d391d1b1d0d, 0x1ddc1c311d9f1d74, 0x1e041e001def1c22, 0x1c351e1b1e191e11, 0x1e421c5d1e341bed, 0x1e551e501e4b, 0x1beb1be51be01bda, 0x1c0c1c041bf91bf3, 0x1c331c201c1c1c13, 0x1c2e1c291c3c1c37, 0x1c501c571c4b1c46, 0x1c6d1c661c5f1c5c, 0x1c8b1c841c7d1c61, 0x1cb21ca81ca41c95, 0x1cd61cd21cc21cb7, 0x1c811d031cfa1ce4, 0x1d291d351d171d0c, 0x1d4c1d451d201d30, 0x1d6b1d641d3e1d51, 0x1d811d951d701d5a, 0x1d8f1d8a1d9b1d85, 0x1db81da41dac1d79, 0x1dc51dbf1dbb1db2, 0x1dd61dd21dce1dca, 0x1df11de61de31dde, 0x1e0b1e061c681df5, 0x1e291e241e1f1e13, 0x1c6f1e391e361e2e, 0x3610352033f0311, 0x39d038e037f0370, 0x33e032b03bb03ac, 0x37e036f03600351, 0x3ba03ab039c038d, 0x4230418040d0402, 0x56a0a530b0f042e, 0xa590ce60c580a0f, 0x210a06db0a600a5c, 0x223d21f920892200, 0xbea11b40c260cda, 0x689075b071c0b7b, 0xc290cdd0b8c0a26, 0x6010bf611c011b7, 0x68c07640b7e068d, 0xa560bfd11c30893, 0x11c60c350aec0b94, 0xc030b970a300c00, 0xc070b9a0a340a33, 0xc1b0b9e0a380a37, 0x7680b8206910c1f, 0xd000cfa0cf60690, 0xc0f11c90c380ce9, 0xbed11ba0c2c0ce0, 0xc2f0ce3076c0b86, 0x76f0b890bf011bd, 0x5d70999077b0bb4, 0x5e805ff0a2d0a2a, 0x6ae0b1306940a50, 0xba20722071f0b3a, 0xbc60bc20bbf0bbc, 0x8200c0b0bf90bf3, 0xd25082b08230cd5, 0x5d1092a09360869, 0x36c035d034a0337, 0x3a80399038a037b, 0x3490336032303b7, 0x389037a036b035c, 0x3fe03b603a70398, 0x42a041f04140409, 0x44a0443043c0435, 0xaf4047804710451, 0x0, 0x0, 0x0, 0x0, 0x26b4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe730e6b, 0x0, 0x256a258422132556, 0x26ae1ff91eff22c6, 0x202b25c8209226ae, 0x244a238221872090, 0x25a8251e250424e6, 0x233c22f0229a2254, 0x1f11265225bc24ca, 0x24e42302225e1fe3, 0x24dc22d620e6267a, 0x250a247821a12526, 0x232822a6221d211f, 0x1fb31f7d1f3125ae, 0x23922300225a21d5, 0x257e24ec24e02456, 0x23b02678266a2610, 0x25d624bc242c23d0, 0x212d206d2540267e, 0x23b4231a24682408, 0x20d4206b260c2566, 0x242422ca22b02256, 0x246e1fb125ec2438, 0x242e23e61f811f83, 0x21a3254e25f024c8, 0x20be1f0525462254, 0x1fc3237223322159, 0x1ef5214b1f3923b8, 0x1fed242221e12290, 0x253824cc23982063, 0x21ab228c25962276, 0x1f1f237021bb24a8, 0x241822441f7f1f5d, 0x1fb725c6253e2494, 0x21ef212720982011, 0x265625e423ba22d8, 0x220f1fa5268c2680, 0x217b210d2590226c, 0x22f622d021d12189, 0x2464243223e0234e, 0x25d8259c24d02588, 0x22ee201b1fa71f91, 0x2155211d25382514, 0x232c2406227221b7, 0x20f020be20491f27, 0x24502348233a215b, 0x2612260a25ca2460, 0x25c023da1f332630, 0x1f451f15216725fe, 0x225421e720d020c0, 0x25a624d6238022fc, 0x1fa325ea220726aa, 0x22be22a22233222d, 0x242023ae236e2340, 0x25f221911f612636, 0x258a22b220e21f3d, 0x23322237216b2143, 0x20d820091f9525f6, 0x2294224a222521fc, 0x251624462378233e, 0x1fcb260425c4251c, 0x235022fe200b22c0, 0x2682266e25f824de, 0x23f6247c22ae2231, 0x22ea2326240e23fc, 0x1f9724b01f23254c, 0x241421a521151f8f, 0x258e220d229c20b6, 0x2123252c25ee250e, 0x20371f4d, 0x220500002061, 0x238c232a1f850000, 0x23d823ce23cc23be, 0x245224102616, 0x2544000024e2, 0x25b4259e0000, 0x2642264000000000, 0x25fc25b026762644, 0x1faf1f511f471f35, 0x203d202f1fd51fb5, 0x20d62065205f2041, 0x21792175216120da, 0x220921f321db2185, 0x22ce22b622a82246, 0x23b22342230822f8, 0x23c623c223c42240, 0x23d623d423ca23c8, 0x2432240023f223e8, 0x24582444243a2436, 0x24ce249a249a2480, 0x254a2548252e2522, 0x259e259a256e256c, 0x215d263426282606, 0x248c274b, 0x1f2f1f5b1f7b1ef9, 0x1fbb1fad1f651f4f, 0x203b202d2025202f, 0x2094208e20692061, 0x2125212120aa20a2, 0x21712165214d213d, 0x2185217321792169, 0x21c921c521bf2193, 0x221f221d220521dd, 0x22a22276226e2229, 0x22dc22ce22c422c8, 0x2324230a23a422f8, 0x236a2358234a232a, 0x238e238c237e237c, 0x23b6239e23a02396, 0x2428240c240023f4, 0x24b2245824402432, 0x252a2524250024c6, 0x253c2544253a252e, 0x254a254225462548, 0x25a4258c256e2550, 0x260625f425ce25be, 0x262e262826202616, 0x272126ae265e2634, 0x1ea11e8d2733271f, 0x27a9277927671ea3, 0x26ac26a4, 0x0, 0xade0ae30adf0adb, 0xd280d280ae2, 0x0, 0x0, 0x134e000000000000, 0x134b135113481345, 0x0, 0x13d2000013850000, 0x1374136f135413a6, 0x13b7139b1360138e, 0x13ca13c702f413cd, 0x1359135613c313bf, 0x1371136c1364135c, 0x137f137c1376, 0x1390138b13881382, 0x139d00001398, 0x13a8000013a313a0, 0x13b413b1000013ab, 0x137913cf13bc13b9, 0x135f13ae13931367, 0x181e181e18181818, 0x18201820181e181e, 0x1824182418201820, 0x181c181c18241824, 0x18221822181c181c, 0x181a181a18221822, 0x183c183c181a181a, 0x183e183e183c183c, 0x18281828183e183e, 0x1826182618281828, 0x182a182a18261826, 0x182c182c182a182a, 0x18321832182c182c, 0x1834183418301830, 0x18381838182e182e, 0x1840184018361836, 0x1844184418401840, 0x1848184818441844, 0x1846184618481848, 0x184a184a18461846, 0x184c184c184c184c, 0x18501850186d186d, 0x184e184e18501850, 0x15911591184e184e, 0x186a186a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1842000000000000, 0x1803184218421842, 0x180717ff17ff1803, 0x18621862185b1807, 0x1860186018551855, 0x180b180b180b180b, 0x17cd17cd14151415, 0x17f117f1180d180d, 0x17fd17fd18011801, 0x1809180918051805, 0x17f517f517f51809, 0x1864186418641864, 0x17f517e517d517d1, 0x13fe13f713f417f9, 0x141e14171414140b, 0x146a144d1438142d, 0x1484147b1472146d, 0x14311422148c1487, 0x143c14d414d11435, 0x151a150c150514fa, 0x15a515a215931562, 0x15c815c515ba15b0, 0x1607157515e415df, 0x16451642163f160a, 0x165b16561653164c, 0x1679167416711662, 0x16851682167f167c, 0x16aa169616931688, 0x1579158c16c816b9, 0x14591455145116e0, 0x172d1461145d1526, 0x17691758174f1740, 0x177f17741771176c, 0x17aa17a3179c1782, 0x14e417c717c417b3, 0x64005d179714ee, 0x8000790072006b, 0x17e917e517e117dd, 0x140813db17f917f5, 0x14171414140e140b, 0x1464144d144a1447, 0x14781475146d146a, 0x14871484147e147b, 0x1674167116561653, 0x1693168816851679, 0x16e01579158c1696, 0x17551752152616e5, 0x176c176917631758, 0x17b317b017ad1797, 0x17d117c717c417be, 0x17ed17e517d917d5, 0x140b13fe13f713f4, 0x1438142d141e1411, 0x148c147b1467144d, 0x14d1143514311422, 0x150c150514fa143c, 0x1593156d1562151a, 0x15ba15b015a515a2, 0x157515e415df15c5, 0x1642163f160a1607, 0x1662165b164c1645, 0x16851682167f167c, 0x16c816b916aa1688, 0x1455145113e0158c, 0x1740172d15261459, 0x177117661758174f, 0x17a3179c17851774, 0x17e515ed17b317aa, 0x144d1411140b17ed, 0x151a1481147b1467, 0x16851557154c1529, 0x17661758158c1688, 0x162c162515ed17b3, 0x15ff15da15d71633, 0x152c161c16191602, 0x1490155d155a152f, 0x1440142a142613fb, 0x15bd159d159a1402, 0x1546153b153415c0, 0x157015171549154c, 0x15ff15da15d715b7, 0x152c161c16191602, 0x1490155d155a152f, 0x1440142a142613fb, 0x15bd159d159a1402, 0x1546153b153415c0, 0x157015171549154c, 0x1546153b153415b7, 0x15c815571529154c, 0x1534150c150514fa, 0x15df15c81546153b, 0x13e313e3, 0x0, 0x0, 0x0, 0x0, 0x1434143014301421, 0x145814541450143b, 0x14c114c514a314a3, 0x1521150114fd1508, 0x15251525151d1521, 0x153e159615651565, 0x154f154f1537153e, 0x15b315a815531553, 0x15cf15cb15cb15b3, 0x15f315f315e715d3, 0x16111615160d15f7, 0x1669166516481648, 0x16ad16c016c416bc, 0x16d216cb16cb16ad, 0x170b170216fe16d2, 0x1716171216f316eb, 0x177716ef00000000, 0x173417471743177b, 0x175b175f17381734, 0x1429140117b617b6, 0x1460143f14431425, 0x14a7148f14ab145c, 0x15ac15421569150f, 0x179f17a616d616b5, 0x174b166d172117ba, 0x168f15fb16bc1665, 0x168b16b1171a1730, 0x14ba1493173016b1, 0x168b13fa164f16f7, 0x173c1513159615e7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13d913de165e158f, 0x15eb14e915731706, 0x1497157c1578158a, 0x14f1, 0x0, 0x0, 0x0, 0x0, 0x5401b331b3102f6, 0x1b770093008d0546, 0x2ff1b79, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9931a6b1a6d02fc, 0xe3b00a500a10993, 0x1b451b4f1b4b0e3f, 0x1b351b3b1b391b47, 0x1b411b3f1b3d1b37, 0x98b000000001b43, 0xc000c000c098f, 0x99309930993000c, 0x2fa1b3102f6, 0x8d009305400546, 0xe3b00a500a11a6d, 0x971b4f1b4b0e3f, 0x2f802f402f2009d, 0x54405590548, 0x566009b0099098d, 0x0, 0x5a161f0057, 0x1622006800000061, 0x163000761629006f, 0x163a00841637007d, 0x13e913e613e613d5, 0x13ec178f178f13e9, 0x17ca17ca17ca13ec, 0x13f213d713d717ca, 0x141a13f213f213f2, 0x141c141c141c141a, 0x147014701470141c, 0x13f513f513f51470, 0x13f813f813f813f5, 0x13ff13ff13ff13f8, 0x14e214e014e013ff, 0x140913dc13dc14e2, 0x14f814f814f81409, 0x15321532153214f8, 0x1560156015601532, 0x15a015a015a01560, 0x15c315c315c315a0, 0x15dd15dd15dd15c3, 0x15e215e215e215dd, 0x16051605160515e2, 0x163d163d163d1605, 0x165916591659163d, 0x1677167716771659, 0x14ec14ec14ec1677, 0x140c140c140c14ec, 0x140f140f140f140c, 0x13e113e113e1140f, 0x14151788178813e1, 0x13fc13fc13fc1415, 0x16a2169e169e13fc, 0x169b16a616a616a2, 0x169b, 0x970095008d0000, 0x9f009d009b0099, 0x2f402f200a500a1, 0x30302fa02f802f6, 0x30f034303140305, 0x392038303740365, 0x546054003b003a1, 0x93055905440548, 0x5e305d505680566, 0x687067e062905e6, 0x71a060706cf06ac, 0x7a4077e07230734, 0x85e082c083b06af, 0x77006b2056b088d, 0x98b060a095a0682, 0x9930991098f098d, 0x9a0093706920995, 0x6020ad90a7d0a2e, 0xb79073e0ae00b0d, 0x7870b3b05d30a28, 0x8400a1105d80cd3, 0xde1086a0a240ba3, 0xe3b061106950b41, 0x1b280e410e3f0e3d, 0x1b3f1b3d1b331b2a, 0x1bd61e551e5c1b31, 0x1c181c081bfd1bef, 0x1cee1e171e0f1e02, 0x1bff1bf11bd81c16, 0x1c411c241c1a1c0a, 0x1cad1c991c901c73, 0x1cda1ccd1c1e1cbd, 0x1cf51cf01bfb1cdf, 0x1d111d0f1ca61bde, 0x1d391d1b1d0d1c8e, 0x1c311d9f1d741d55, 0x1e001def1c221ddc, 0x1e1b1e191e111e04, 0x1c5d1e341bed1c35, 0x8b00881c061e42, 0x1a101949194419d4, 0x19501a141a12194b, 0x1a181a1619571955, 0x1a201a1e1a1c1a1a, 0x19661961195c19a6, 0x196f196d196819b0, 0x198e198319811977, 0x199d19981993, 0x19d8194700000000, 0x19e019de19dc19da, 0x19e419e200000000, 0x19ec19ea19e8198c, 0x197519ee00000000, 0x19f819f619f419f2, 0x197f19fa00000000, 0x19fe, 0x90e4b0e450e43, 0x1a820e470e49, 0x1a8b1a891a841b22, 0x1b261b241a90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26b600000000, 0x26b9, 0x0, 0x0, 0x26bc000000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26c226bf00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26c826c500000000, 0x26d726d326cf26cb, 0x26db, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26df000000000000, 0x26e626ed26e226ea, 0x26f1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae000000602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e300000568, 0x68700000000, 0x71a06070000, 0x6af07a4077e0000, 0x88d085e0000083b, 0x682077006b2056b, 0x9370692060a095a, 0xad900000a2e09a0, 0x73e0ae00b0d0000, 0xb3b05d30a280b79, 0xa1105d80cd30000, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e6000005d50568, 0x687067e0629, 0x734071a06070000, 0x6af07a4077e0723, 0x88d085e0000083b, 0x682077006b2056b, 0x93706920000095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e6000005d50568, 0x687067e0629, 0x734071a060706cf, 0x7a400000723, 0x88d085e00000000, 0x682077006b2056b, 0x93706920000095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x9370692060a095a, 0xad90a7d0a2e09a0, 0x73e0ae00b0d0602, 0xb3b05d30a280b79, 0xa1105d80cd30787, 0x86a0a240ba30840, 0x61106950b410de1, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x61106950b410de1, 0xe800e6f, 0xf3c0f3a0f380ee3, 0xfad0f5e0f5c0f3e, 0xfe20fe00fde0faf, 0x10060fe80fe60fe4, 0x100f100d0fad1008, 0x1035103310311011, 0x10ea10861aa3077c, 0x110e10f010ee10ec, 0x11ae1170116e1110, 0x11ce11cc11b211b0, 0x11f811f011ee11d0, 0x123c11fe11fc11fa, 0x1a9e12421240123e, 0x123c11ae116e10f0, 0xf380ee311ee11f0, 0xf5c0f3e0f3c0f3a, 0xfde0faf0fad0f5e, 0xfe60fe40fe20fe0, 0xfad100810060fe8, 0x10311011100f100d, 0x1aa3077c10351033, 0x10ee10ec10ea1086, 0x116e1110110e10f0, 0x11b211b011ae1170, 0x11ee11d011ce11cc, 0x11fc11fa11f811f0, 0x1240123e123c11fe, 0x116e10f01a9e1242, 0x11ee11f0123c11ae, 0xf3c0f3a0f380ee3, 0xfad0f5e0f5c0f3e, 0xfe20fe00fde0faf, 0x10060fe80fe60fe4, 0x100f100d0fad1008, 0x1035103310311011, 0x10ea10861aa3077c, 0x110e10f010ee10ec, 0x11ae1170116e1110, 0x11ce11cc11b211b0, 0x11f811f011ee11d0, 0x123c11fe11fc11fa, 0x1a9e12421240123e, 0x123c11ae116e10f0, 0xf380ee311ee11f0, 0xf5c0f3e0f3c0f3a, 0xfde0faf0fad0f5e, 0xfe60fe40fe20fe0, 0xfad100810060fe8, 0x10311011100f100d, 0x1aa3077c10351033, 0x10ee10ec10ea1086, 0x116e1110110e10f0, 0x11b211b011ae1170, 0x11ee11d011ce11cc, 0x11fc11fa11f811f0, 0x1240123e123c11fe, 0x116e10f01a9e1242, 0x11ee11f0123c11ae, 0xf3c0f3a0f380ee3, 0xfad0f5e0f5c0f3e, 0xfe20fe00fde0faf, 0x10060fe80fe60fe4, 0x100f100d0fad1008, 0x1035103310311011, 0x10ea10861aa3077c, 0x110e10f010ee10ec, 0x11ae1170116e1110, 0x11ce11cc11b211b0, 0x11f811f011ee11d0, 0x123c11fe11fc11fa, 0x1a9e12421240123e, 0x123c11ae116e10f0, 0x12a212a011ee11f0, 0x314030500000000, 0x3740365030f0343, 0x3b003a103920383, 0x30f034303140305, 0x392038303740365, 0x314030503b003a1, 0x3740365030f0343, 0x3b003a103920383, 0x30f034303140305, 0x392038303740365, 0x314030503b003a1, 0x3740365030f0343, 0x3b003a103920383, 0x14e013f513f213d7, 0x13f8140917880000, 0x14ec167713fc15c3, 0x15e214f8140f140c, 0x13dc16591560163d, 0x13ff1470141c1532, 0x160515dd15a014e2, 0x1816183a184a1814, 0x13f513f20000, 0x13f80000000013e1, 0x14ec167713fc0000, 0x15e214f8140f140c, 0x16591560163d, 0x13ff1470141c1532, 0x1605000015a00000, 0x0, 0x13f500000000, 0x13f8000000000000, 0x14ec000013fc0000, 0x15e214f8140f0000, 0x165915600000, 0x13ff000000001532, 0x1605000015a00000, 0x18160000184a0000, 0x13f513f20000, 0x13f80000000013e1, 0x167713fc15c3, 0x15e214f8140f140c, 0x16591560163d, 0x13ff1470141c1532, 0x160515dd15a00000, 0x183a00001814, 0x14e013f513f213d7, 0x13f81409178813e1, 0x14ec000013fc15c3, 0x15e214f8140f140c, 0x13dc16591560163d, 0x13ff1470141c1532, 0x160515dd15a014e2, 0x0, 0x14e013f513f20000, 0x13f8140917880000, 0x14ec000013fc15c3, 0x15e214f8140f140c, 0x13dc16591560163d, 0x13ff1470141c1532, 0x160515dd15a014e2, 0x0, 0x3f103160307030a, 0x4fa04de04ab0468, 0x5310520050b, 0x0, 0x10a0106010200fe, 0x11a01160112010e, 0x12a01260122011e, 0x13a01360132012e, 0x14a01460142013e, 0x15a01560152014e, 0x5e31b4d0162015e, 0x93305e5082c, 0x5e605e305d50568, 0x6ac0687067e0629, 0x734071a060706cf, 0x6af07a4077e0723, 0x88d085e082c083b, 0x682077006b2056b, 0x76c06b1060a095a, 0x930082708660860, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x761075e00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x606, 0x0, 0x0, 0x0, 0x1cad1c9e1bc3, 0x0, 0x0, 0x0, 0x1cf71ff320b02197, 0x208c253220811f17, 0x21e722f221fe1f1d, 0x21eb1f6921451f9d, 0x2560235c24261f93, 0x219d22cc200f2073, 0x25a01eef1ee921b3, 0x21ad20011efd20fa, 0x23f023d221992574, 0x329221b22bc2005, 0x20351f9f2366, 0x0, 0x1b5d1b551b511b69, 0x1b591b711b611b6d, 0x1b65, 0x0, 0x1ffd2147, 0x0, 0x0, 0x0, 0x26f51f0b1f031f07, 0x1f3b1f371f351f2d, 0x1f431f471f411f3f, 0x1f531f5126fd1e63, 0x1e6526f71f631f55, 0x1f7126fb1f691f59, 0x1f7b1f791f251f75, 0x1e691f8d1f8927b9, 0x1fa11f9f1f9b1f99, 0x1fb51faf1fad1e6b, 0x1fc31fbf1fbd1fbb, 0x1fe11fd91fd51fd3, 0x1fe71fe71fe71fe5, 0x1ff51ff122e42703, 0x20031fff1ffb2705, 0x20152013200d2017, 0x2023201f201d2019, 0x202d202920292027, 0x204b203920332031, 0x2043203f204d203d, 0x2057205520711f8f, 0x205b205d20532059, 0x2077207527072067, 0x209620852081207b, 0x209e209c270b2709, 0x1e6d20a4209a20a0, 0x20ac20ac20a81e6f, 0x20be20bc20ba270d, 0x20c820c6270f20c2, 0x20d21e7120cc2137, 0x271320de20e020da, 0x20e820ea271520e4, 0x1e7320f620f420ec, 0x21062104210220fe, 0x21171e7727171e75, 0x27cd211f211b2119, 0x2486271b271b212b, 0x27291e7921332133, 0x1e7b213f213b277d, 0x2157215321512149, 0x21611e7d1e7f215f, 0x216f216d2163271d, 0x21792177216f2171, 0x2183217f217d2181, 0x218f210b21872185, 0x21b121a7219f219b, 0x21b521a921af2723, 0x21c7272521c321b9, 0x21cb1e8121bd21c1, 0x1e8321cd21d321cf, 0x21f5272721df21db, 0x22091e8922032215, 0x1f6d1f6b1e851e87, 0x1ebb2470220b2217, 0x222b2221221f221d, 0x22351e8b27312227, 0x273522462242222f, 0x1e8d224c22392248, 0x225822522250224e, 0x22621e8f225c2737, 0x226a1e9122642739, 0x273b227822762270, 0x273f2288273d2711, 0x2298228a2292228e, 0x22a422a222a822a0, 0x229e274122ac22aa, 0x22c41e9322ba22b8, 0x22d222b4274322c2, 0x22de22d427472745, 0x22e01e9522da22dc, 0x26f922ec22e622e8, 0x274d22fa274922f4, 0x274f2314230a2304, 0x275327512320231e, 0x23381e972336232e, 0x234623441e991e99, 0x1e9b2352234c234a, 0x2757236c2755235e, 0x2759237a27192372, 0x1e9f1e9d275d275b, 0x2763275f27612396, 0x239c239c239a2765, 0x1ea523a21ea323a0, 0x23b023ac27691ea7, 0x23c8276b1ea923b6, 0x23e423d8276f276d, 0x23ec23ea23e81eab, 0x23f8277327732771, 0x2404240227751ead, 0x1eb1241227771eaf, 0x277b241e2416241a, 0x243424301eb3242a, 0x2781277f1eb5243c, 0x2785244827831eb7, 0x278724582454244e, 0x2466278b24622789, 0x247424721eb9272b, 0x278d20a624761ebd, 0x2486272f272d278f, 0x249e1ebf25942488, 0x24a21fa924a0249c, 0x279124aa24a624a4, 0x24b824b624ac24a8, 0x24ce24c424ba24ae, 0x24c224c024be24b4, 0x1ec1279527972793, 0x279f24d824d424d2, 0x1ec51ec3279924da, 0x24ea1ec7279d279b, 0x24f624f024ee24ec, 0x250024f824fa24f4, 0x1ec9250224fe24fc, 0x25101ecb25082506, 0x251a251827a12512, 0x27a31e6725201ecd, 0x25361ed11ecf27a5, 0x27a7255825502542, 0x2576257025642562, 0x257a257c26ff27ab, 0x258c258627012580, 0x25b225ac27af27ad, 0x25cc25b827b125b6, 0x25da25d025d425d2, 0x1ed325e227b325dc, 0x26021ed527b525e6, 0x27bb27b7260e20ee, 0x27bd26221ed91ed7, 0x262e262e27bf1edb, 0x1edd263e27c12632, 0x26542650264c2646, 0x266c265e27c31edf, 0x26741ee31ee12672, 0x27c927c71ee527c5, 0x26901ee7268627cb, 0x269e269a26962694, 0x27cf26a2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//12288 bytes
@@ -18,7 +18,7 @@ _IDCA decompCompatTable() { static _IDCA t = [ 0x0, 0x20, 0x0, 0x20, 0x301,
}
-static if(size_t.sizeof == 4) {
+static if (size_t.sizeof == 4) {
//22656 bytes
enum compatMappingTrieEntries = TrieEntry!(ushort, 8, 8, 5)([ 0x0, 0x40, 0x540], [ 0x100, 0xa00, 0x21c0], [ 0x2020100, 0x4020302, 0x2020205, 0x7060202, 0x2020202, 0x8020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x0, 0x0, 0x10000, 0x30002, 0x50004, 0x70006, 0x80000, 0xa0009, 0xc000b, 0x0, 0xd0000, 0xf000e, 0x0, 0x110010, 0x130012, 0x150014, 0x170016, 0x190018, 0x0, 0x1b001a, 0x0, 0x0, 0x1c, 0x0, 0x1d0000, 0x1e0000, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x21, 0x0, 0x22, 0x230000, 0x24, 0x0, 0x0, 0x0, 0x25, 0x26, 0x27, 0x0, 0x28, 0x0, 0x29, 0x0, 0x2a, 0x0, 0x2b, 0x2c0000, 0x0, 0x2d0000, 0x2e, 0x2f, 0x310030, 0x330032, 0x0, 0x340000, 0x0, 0x0, 0x350000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x370036, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x390000, 0x3b003a, 0x3d003c, 0x0, 0x3f003e, 0x410040, 0x430042, 0x450044, 0x470046, 0x490048, 0x4b004a, 0x4d004c, 0x4f004e, 0x510050, 0x530052, 0x0, 0x550054, 0x570056, 0x590058, 0x5a, 0x5c005b, 0x5e005d, 0x60005f, 0x610000, 0x620000, 0x0, 0x0, 0x0, 0x0, 0x630000, 0x650064, 0x670066, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x690000, 0x0, 0x6a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b0000, 0x0, 0x0, 0x0, 0x6c0000, 0x0, 0x0, 0x0, 0x0, 0x6d, 0x6e0000, 0x70006f, 0x720071, 0x740073, 0x75, 0x770076, 0x790078, 0x7b007a, 0x7d007c, 0x7e0000, 0x80007f, 0x81, 0x0, 0x830082, 0x850084, 0x870086, 0x890088, 0x8b008a, 0x8d008c, 0x8f008e, 0x910090, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x920000, 0x0, 0x930000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x950094, 0x970096, 0x990098, 0x9b009a, 0x9d009c, 0x9f009e, 0xa100a0, 0xa2, 0xa400a3, 0xa600a5, 0xa800a7, 0xaa00a9, 0xac00ab, 0xae00ad, 0xb000af, 0xb200b1, 0xb400b3, 0xb600b5, 0xb800b7, 0xba00b9, 0xbc00bb, 0xbe00bd, 0xc000bf, 0xc200c1, 0xc400c3, 0xc600c5, 0xc800c7, 0xca00c9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcc00cb, 0x0, 0xcd0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf00ce, 0xd00000, 0xd1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd300d2, 0xd500d4, 0xd700d6, 0xd900d8, 0xdb00da, 0xdd00dc, 0xd200de, 0xdf00d3, 0xe000d5, 0xe200e1, 0xe300d9, 0xe500e4, 0xe700e6, 0xe900e8, 0xeb00ea, 0xed00ec, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xef00ee, 0xf100f0, 0xf300f2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf500f4, 0xf700f6, 0xf8, 0x0, 0xfa00f9, 0xfb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfd00fc, 0xff00fe, 0x1010100, 0x1030102, 0x1050104, 0x1070106, 0x1090108, 0x10b010a, 0x10c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x15, 0x692, 0x0, 0x90000, 0x0, 0x30f0343, 0x11b20003, 0x0, 0x3140048, 0x787, 0x3c603ce, 0x494, 0x570056d, 0x5860573, 0x5b005a6, 0x5f80000, 0x62e062b, 0x6580631, 0x6e706e4, 0x6f906ea, 0x78f0000, 0x7a907a6, 0x7bf07ac, 0x7e3, 0x8b10000, 0x8b708b4, 0x95f08cb, 0x0, 0x9ac09a9, 0x9c209af, 0x9ec09e2, 0xa470000, 0xa890a86, 0xab30a8c, 0xb460b43, 0xb550b49, 0xc410000, 0xc5e0c5b, 0xc740c61, 0xc98, 0xd680000, 0xd6e0d6b, 0xe0c0d82, 0xe1b0000, 0x9c50589, 0x9c8058c, 0xa0a05ce, 0xa3b05ec, 0xa3e05ef, 0xa4105f2, 0xa4405f5, 0xa6e061a, 0x0, 0xaa20647, 0xaad0652, 0xab00655, 0xad00675, 0xab9065e, 0xafb069a, 0xb0106a0, 0xb0406a3, 0xb0a06a9, 0xb1606ba, 0x0, 0xb4c06ed, 0xb4f06f0, 0xb5206f3, 0xb6b070f, 0x6f6, 0xb3706d8, 0xb730717, 0xbae072e, 0x7430000, 0x7500bcc, 0x7460bd9, 0x7400bcf, 0xbc9, 0x78c0000, 0x79b0c3e, 0x7950c4d, 0xed70c47, 0x0, 0xc8307ce, 0xc8e07d9, 0xca207ed, 0x0, 0xd070842, 0xd1d0858, 0xd0d0848, 0xd2b086c, 0xd320873, 0xd49088a, 0xd380879, 0xd5d08a6, 0xd54089d, 0x0, 0xd7108ba, 0xd7808c1, 0xd7f08c8, 0xd9808e1, 0xd9b08e4, 0xdc4090d, 0xde9093f, 0xe0f0962, 0x979096e, 0x97f0e29, 0x60d0e2f, 0x8400614, 0xcae07f9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f00000, 0xda7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x613060c, 0x7360a67, 0xbb9073d, 0x7830780, 0x5b70c32, 0x70309f3, 0x7f00b5f, 0x8e70ca5, 0x8d60d9e, 0x8d20d8d, 0x8da0d89, 0x8ce0d91, 0xd85, 0x9e505a9, 0x9de05a2, 0xe630e5a, 0x0, 0xb0706a6, 0xba80728, 0xccc0817, 0xccf081a, 0xecc0e7b, 0x6090b76, 0xa640610, 0xaf80697, 0x0, 0xc3b0789, 0x9ef05b3, 0xe600e57, 0xe680e5d, 0x9f605ba, 0x9f905bd, 0xabc0661, 0xabf0664, 0xb620706, 0xb650709, 0xca807f3, 0xcab07f6, 0xd10084b, 0xd13084e, 0xda108ea, 0xda408ed, 0xd460887, 0xd5a08a3, 0x0, 0xb1f06c3, 0x0, 0x0, 0x0, 0x9db059f, 0xac9066e, 0xc9b07e6, 0xc7b07c6, 0xc9107dc, 0xc9407df, 0xe150968, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe9a0b0d, 0xa11073e, 0xeb60eb4, 0xde10eb8, 0x695, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12000f, 0x4b0024, 0x270006, 0x0, 0xa280e96, 0xb410840, 0xecf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4001a, 0x2b0000, 0x1d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xed5, 0x0, 0x0, 0x54, 0x0, 0x546, 0x0, 0x0, 0x1c0003, 0x7410ee8, 0xf630f43, 0xfb4, 0xfed, 0x103c1016, 0x1185, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x101f0fbd, 0x10f5108f, 0x11751119, 0x1213, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x120c117e, 0x120311d5, 0x124b, 0x116e10ea, 0x10161011, 0x123c101f, 0x11ee, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11f011ae, 0x11f8, 0x10f00fad, 0x0, 0x100d0000, 0x0, 0x0, 0x0, 0x12b612b0, 0x12ad0000, 0x0, 0x12a40000, 0x0, 0x0, 0x12c212ce, 0x12d7, 0x0, 0x0, 0x0, 0x0, 0x12c80000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x130a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12f812f2, 0x12ef0000, 0x0, 0x132d0000, 0x0, 0x0, 0x13041310, 0x131b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13331330, 0x0, 0x0, 0x0, 0x0, 0x12b90000, 0x12fb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12e912a7, 0x12ec12aa, 0x0, 0x12f512b3, 0x0, 0x13391336, 0x12fe12bc, 0x130112bf, 0x0, 0x130712c5, 0x130d12cb, 0x131512d1, 0x0, 0x133f133c, 0x132a12e6, 0x131812d4, 0x131e12da, 0x132112dd, 0x132412e0, 0x0, 0x132712e3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13420000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13e913e6, 0x13ec178f, 0x17ca, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13ef0000, 0x185b1792, 0x1811, 0x0, 0x0, 0x0, 0x186d, 0x1852, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x186a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18820000, 0x0, 0x0, 0x0, 0x188b0000, 0x0, 0x188e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18731870, 0x18791876, 0x187f187c, 0x18881885, 0x0, 0x0, 0x0, 0x0, 0x0, 0x189a0000, 0x189d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18941891, 0x18970000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18ac0000, 0x0, 0x18af, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18a00000, 0x18a618a3, 0x0, 0x18a9, 0x0, 0x0, 0x0, 0x0, 0x18bb, 0x18b80000, 0x18be, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18b518b2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18c1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18ca18c4, 0x18c7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18cd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18d0, 0x0, 0x0, 0x18da0000, 0x18dd, 0x18d618d3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18e618e0, 0x18e3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18e9, 0x18ef18ec, 0x18f3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18f60000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18ff0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18fc18f9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1902, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19070000, 0x0, 0x0, 0x0, 0x0, 0x190a0000, 0x0, 0x0, 0x190d, 0x0, 0x19100000, 0x0, 0x0, 0x1913, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19040000, 0x0, 0x0, 0x0, 0x0, 0x19160000, 0x19190000, 0x19311935, 0x1938193c, 0x0, 0x0, 0x0, 0x191c0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19220000, 0x0, 0x0, 0x0, 0x0, 0x19250000, 0x0, 0x0, 0x1928, 0x0, 0x192b0000, 0x0, 0x0, 0x192e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x191f0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x193f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1942, 0x0, 0x0, 0x0, 0x0, 0x1a38, 0x1a3b, 0x1a3e, 0x1a41, 0x1a44, 0x0, 0x1a47, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a4a0000, 0x1a4d0000, 0x0, 0x1a531a50, 0x1a560000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe550568, 0x5d5, 0x62905e6, 0x6870e75, 0x6cf06ac, 0x71a0607, 0x7230734, 0x77e, 0xe7e07a4, 0x82c06af, 0x56b088d, 0x6920770, 0xe840e82, 0x9371a59, 0xa7d0a2e, 0xe8e0e8c, 0x6020e90, 0xb790000, 0xe7105d3, 0xe880787, 0x1a5d1a5b, 0xba30cd3, 0x1a610a24, 0x86a0ea4, 0x10ea1a63, 0x10ee10ec, 0x123e123c, 0xa110ae0, 0x86a0a24, 0x10ec10ea, 0x123c11f0, 0x123e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1313, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe860000, 0xe8a09a0, 0xe900e66, 0xe920ad9, 0xe980e94, 0xe9e0e9c, 0x1a650ea0, 0xea20ed1, 0xed31a67, 0xea60ea8, 0xeac0eaa, 0xeb00eae, 0xeba0eb2, 0xe790ebc, 0xec00ebe, 0xec21a5f, 0x6110ec4, 0xec80ec6, 0x116e0eca, 0xa0705cb, 0xa1305da, 0xa1605dd, 0xa1905e0, 0xa4a05fb, 0xa6b0617, 0xa71061d, 0xa7a0626, 0xa740620, 0xa770623, 0xaa5064a, 0xaa9064e, 0xad30678, 0xad6067b, 0xacc0671, 0xaef0684, 0xafe069d, 0xb1906bd, 0xb2206c6, 0xb1c06c0, 0xb2506c9, 0xb2806cc, 0xb6e0712, 0xb5806fc, 0xba50725, 0xbab072b, 0xbb10731, 0xbd20749, 0xbd5074c, 0xbdf0756, 0xbdc0753, 0xc120772, 0xc150775, 0xc180778, 0xc440792, 0xc4a0798, 0xc5307a1, 0xc50079e, 0xc7707c2, 0xc7f07ca, 0xc8607d1, 0xc8a07d5, 0xcec0835, 0xcef0838, 0xd0a0845, 0xd160851, 0xd190854, 0xd20085b, 0xd350876, 0xd3f0880, 0xd2e086f, 0xd3b087c, 0xd420883, 0xd4e089a, 0xd5708a0, 0xd6308ac, 0xd6008a9, 0xdc1090a, 0xdca0913, 0xdc70910, 0xd7408bd, 0xd7b08c4, 0xddb0924, 0xdde0927, 0xde30939, 0xde6093c, 0xdef0945, 0xdec0942, 0xdf50948, 0xe010954, 0xe040957, 0xe18096b, 0xe2c097c, 0xe350985, 0xe380988, 0xd510b2b, 0xe210df2, 0xd3509a6, 0x0, 0x0, 0x9fc05c0, 0x9e905ad, 0x9b6057a, 0x9b20576, 0x9be0582, 0x9ba057e, 0x9ff05c3, 0x9cf0593, 0x9cb058f, 0x9d7059b, 0x9d30597, 0xa0305c7, 0xac20667, 0xab6065b, 0xa9f0644, 0xa930638, 0xa8f0634, 0xa9b0640, 0xa97063c, 0xac5066a, 0xb5c0700, 0xb68070c, 0xcc50810, 0xc9f07ea, 0xc6807b3, 0xc6407af, 0xc7007bb, 0xc6c07b7, 0xcc80813, 0xcb50800, 0xcb107fc, 0xcbd0808, 0xcb90804, 0xcc1080c, 0xdbe0907, 0xd9508de, 0xdae08f7, 0xdaa08f3, 0xdb608ff, 0xdb208fb, 0xdba0903, 0xe09095c, 0xe240974, 0xe1e0971, 0xe120965, 0x0, 0x0, 0x0, 0x10be109c, 0x10c1109f, 0x10ca10a8, 0x10d310b1, 0xf130ef1, 0xf160ef4, 0xf1f0efd, 0xf280f06, 0x110310f8, 0x110610fb, 0x110a10ff, 0x0, 0xf510f46, 0xf540f49, 0xf580f4d, 0x0, 0x11421120, 0x11451123, 0x114e112c, 0x11571135, 0xf880f66, 0xf8b0f69, 0xf940f72, 0xf9d0f7b, 0x119c118d, 0x119f1190, 0x11a31194, 0x11a71198, 0xfcf0fc0, 0xfd20fc3, 0xfd60fc7, 0xfda0fcb, 0x11e311d8, 0x11e611db, 0x11ea11df, 0x0, 0xffb0ff0, 0xffe0ff3, 0x10020ff7, 0x0, 0x122a121b, 0x122d121e, 0x12311222, 0x12351226, 0x10220000, 0x10250000, 0x10290000, 0x102d0000, 0x12741252, 0x12771255, 0x1280125e, 0x12891267, 0x1061103f, 0x10641042, 0x106d104b, 0x10761054, 0x108f1088, 0x10f510f2, 0x11191112, 0x11751172, 0x11d511d2, 0x12031200, 0x124b1244, 0x0, 0x10dc10ba, 0x10c510a3, 0x10ce10ac, 0x10d710b5, 0xf310f0f, 0xf1a0ef8, 0xf230f01, 0xf2c0f0a, 0x1160113e, 0x11491127, 0x11521130, 0x115b1139, 0xfa60f84, 0xf8f0f6d, 0xf980f76, 0xfa10f7f, 0x12921270, 0x127b1259, 0x12841262, 0x128d126b, 0x107f105d, 0x10681046, 0x1071104f, 0x107a1058, 0x10961099, 0x10e7108b, 0x1092, 0x10e310e0, 0xeeb0eee, 0xee80ee5, 0x2a0f35, 0x2a1170, 0x200051, 0x116b1115, 0x111c, 0x11671164, 0xf430f40, 0xf630f60, 0x2d0faa, 0x350031, 0x1178117b, 0x11851181, 0x0, 0x118911ab, 0xfb70fba, 0xfb40fb1, 0x3c0000, 0x440040, 0x12061209, 0x1213120f, 0x11f511f2, 0x12171239, 0x1019101c, 0x10161013, 0x18100a, 0x995001c, 0x0, 0x129d1247, 0x124e, 0x12991296, 0xfed0fea, 0x103c1039, 0x31083, 0x39, 0x10001, 0x10001, 0x10001, 0x10001, 0x10001, 0x1, 0x0, 0x0, 0x1a690000, 0x0, 0x0, 0x4e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2fc02fa, 0x2ff, 0x0, 0x0, 0x0, 0x10000, 0x0, 0x1a6f0000, 0x1a72, 0x1a7e1a7b, 0x0, 0x0, 0x8f, 0xc, 0x0, 0x0, 0x0, 0x5630000, 0x920560, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a760000, 0x0, 0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xae00305, 0x0, 0x3740365, 0x3920383, 0x3b003a1, 0x1aad02f4, 0xa10544, 0xb3b00a5, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x1aad02f4, 0xa10544, 0xa5, 0xa7d0692, 0xb410787, 0xb0d0e8c, 0xa280b79, 0xb3b05d3, 0x8400cd3, 0xba3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x83f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9a2099e, 0xe4d05e3, 0xa1e0000, 0xe770a22, 0xe500000, 0x6ac0602, 0x6ac06ac, 0xe6d0b0d, 0x6cf06cf, 0xa280734, 0x77e0000, 0x786, 0x6af0000, 0x82c083b, 0x82c082c, 0x0, 0x88f0863, 0x897, 0x60a, 0x77c, 0x60a, 0x5b0071a, 0x5e305d5, 0xa7d0000, 0x67e0629, 0x7230000, 0x13540787, 0x136a1362, 0xae0136f, 0x6800000, 0x10ec11ee, 0x10060f3a, 0x1aab, 0x0, 0x5e60000, 0xa7d0a2e, 0x73e0ae0, 0x0, 0x0, 0x0, 0x3e203da, 0x3ca03c1, 0x3d20455, 0x4980459, 0x3d604cf, 0x3de04e7, 0x4eb049c, 0x3be0511, 0x6d106cf, 0x6de06d4, 0x91806b2, 0x91f091b, 0x68206e1, 0x950094d, 0x5e30734, 0x72305e6, 0xb300ae0, 0xb3d0b33, 0xdcf086a, 0xdd60dd2, 0xb410b40, 0xdfd0dfa, 0x9a00a28, 0x5d30a2e, 0x0, 0x0, 0x0, 0x0, 0x30d0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a8d1a86, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a92, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a950000, 0x1a981a9b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1aa0, 0x0, 0x1aa50000, 0x0, 0x1aa8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1aaf, 0x1ab2, 0x0, 0x0, 0x1ab81ab5, 0x1ac10000, 0x1ac4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ac80000, 0x0, 0x1acb, 0x1ace0000, 0x1ad10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x556, 0x1ad7, 0x0, 0x0, 0x0, 0x0, 0x1ad40000, 0x55b054a, 0x1add1ada, 0x0, 0x1ae31ae0, 0x0, 0x1ae91ae6, 0x0, 0x0, 0x0, 0x1aef1aec, 0x0, 0x1afb1af8, 0x0, 0x1b011afe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b0d1b0a, 0x1b131b10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1af51af2, 0x1b071b04, 0x0, 0x0, 0x0, 0x1b191b16, 0x1b1f1b1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b350000, 0x1b37, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3430314, 0x365030f, 0x3830374, 0x3a10392, 0x31c03b0, 0x342032f, 0x3640355, 0x3820373, 0x3a00391, 0x3f703af, 0xd900a3, 0xe600e2, 0xee00ea, 0xf600f2, 0xa700fa, 0xb100ac, 0xbb00b6, 0xc500c0, 0xcf00ca, 0xdd00d4, 0x3460319, 0x3680359, 0x3860377, 0x3a40395, 0x31f03b3, 0x3450332, 0x3670358, 0x3850376, 0x3a30394, 0x3fa03b2, 0x16a0166, 0x172016e, 0x17a0176, 0x182017e, 0x18a0186, 0x192018e, 0x19a0196, 0x1a2019e, 0x1aa01a6, 0x1b201ae, 0x1ba01b6, 0x1c201be, 0x1ca01c6, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x305, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1abc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54f0542, 0x552, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b2c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b2073e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b2f0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x227c0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26b00000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1efb1ee9, 0x1f091f01, 0x1f131f0d, 0x1f1b1f17, 0x1f4b1f21, 0x1f5f1f57, 0x1f6f1f67, 0x1f871f77, 0x1f8b1f89, 0x1fb91fa5, 0x1fc51fc1, 0x1fcd1fc7, 0x1fdd1fdb, 0x1feb1fe9, 0x1ff71fef, 0x204f2045, 0x2079206f, 0x207f207d, 0x20982087, 0x20b420ae, 0x20ca20c4, 0x20ce20cc, 0x20dc20da, 0x20f820f2, 0x210020fc, 0x210f2108, 0x21292113, 0x212f212b, 0x21352131, 0x21412139, 0x218b214f, 0x21972195, 0x21d921d7, 0x21e521e3, 0x21ed21e9, 0x32521f1, 0x3292211, 0x22602223, 0x226e2266, 0x227a2274, 0x2280227e, 0x22842282, 0x22e22286, 0x230c2306, 0x2310230e, 0x23162312, 0x23222318, 0x23342330, 0x23562354, 0x235c235a, 0x23622360, 0x23762374, 0x23862384, 0x238a2388, 0x23a62394, 0x23aa23a8, 0x23dc23bc, 0x23ee23de, 0x23fa23f6, 0x241c240a, 0x2442243e, 0x2452244c, 0x245a2456, 0x245e245c, 0x246c246a, 0x247e247a, 0x24842482, 0x248e248a, 0x24922490, 0x24982496, 0x24f224e8, 0x250e250c, 0x25282512, 0x2530252c, 0x25522534, 0x25582554, 0x255c255a, 0x25742572, 0x25822578, 0x25922584, 0x25982596, 0x25ba25aa, 0x25c425c2, 0x25de25c8, 0x25e825e0, 0x260025fa, 0x26142608, 0x261a2618, 0x261e261c, 0x26262624, 0x2638262a, 0x263c263a, 0x264a2648, 0x2658264e, 0x265c265a, 0x26622660, 0x26662664, 0x26702668, 0x267e267c, 0x26862684, 0x268a2688, 0x2690268e, 0x26982692, 0x26a0269c, 0x26a626a2, 0x26aa26a8, 0x26b226ae, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b49, 0x1fcf1fcd, 0x1fd1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b7e, 0x1b81, 0x1b84, 0x1b87, 0x1b8a, 0x1b8d, 0x1b90, 0x1b93, 0x1b96, 0x1b99, 0x1b9c, 0x1b9f, 0x1ba20000, 0x1ba50000, 0x1ba80000, 0x0, 0x0, 0x0, 0x1bae1bab, 0x1bb10000, 0x1bb4, 0x1bba1bb7, 0x1bbd0000, 0x1bc0, 0x1bc91bc6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b7b, 0x0, 0x0, 0x870000, 0x8a, 0x1bcc1bd3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c26, 0x1c43, 0x1bf6, 0x1c92, 0x1c9b, 0x1caf, 0x1cbf, 0x1cca, 0x1ccf, 0x1cdc, 0x1ce1, 0x1ceb, 0x1cf20000, 0x1cf70000, 0x1c100000, 0x0, 0x0, 0x0, 0x1d261d1d, 0x1d3b0000, 0x1d42, 0x1d611d57, 0x1d760000, 0x1d7e, 0x1caa1da1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c01, 0x1e440000, 0x1e521e4d, 0x1e57, 0x0, 0x1ca11e60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19440000, 0x1a101949, 0x1a12194b, 0x19501a14, 0x19571955, 0x1a181a16, 0x1a1c1a1a, 0x1a201a1e, 0x195c19a6, 0x19661961, 0x196819b0, 0x196f196d, 0x19811977, 0x198e1983, 0x19981993, 0x1947199d, 0x19da19d8, 0x19de19dc, 0x19e219e0, 0x198c19e4, 0x19ea19e8, 0x19ee19ec, 0x19f21975, 0x19f619f4, 0x19fa19f8, 0x19fe197f, 0x19a219d4, 0x1a2219a4, 0x1a261a24, 0x1a2a1a28, 0x1a2e1a2c, 0x1a3019a8, 0x19aa1a32, 0x19ae19ac, 0x19b419b2, 0x19b819b6, 0x19bc19ba, 0x19c019be, 0x19c419c2, 0x19c819c6, 0x19cc19ca, 0x1a361a34, 0x19d019ce, 0x1a0019d2, 0x1a041a02, 0x1a081a06, 0x1a0c1a0a, 0x1a0e, 0x0, 0x1f171ee9, 0x20471eef, 0x1efd1ef1, 0x23641ef3, 0x1ef71f0d, 0x208c1eeb, 0x1f212051, 0x1d701ce, 0x1e901e0, 0x1fb01f2, 0x20d0204, 0x2330225, 0x245023c, 0x257024e, 0x1db01d2, 0x1ed01e4, 0x1ff01f6, 0x2110208, 0x2370229, 0x2490240, 0x25b0252, 0x216022e, 0x21e, 0x2700260, 0x2a00268, 0x2880274, 0x2840264, 0x290026c, 0x2c402b0, 0x2b802c0, 0x2a402ec, 0x2bc02ac, 0x2d002b4, 0x2c80298, 0x2d402e4, 0x278028c, 0x2a8029c, 0x27c02cc, 0x29402e8, 0x28002d8, 0x2e002dc, 0x21112021, 0x23fe21e3, 0x0, 0x0, 0x0, 0x0, 0x406082e, 0x41c0411, 0x4320427, 0x4400439, 0x44e0447, 0x475046e, 0x47f047c, 0x4850482, 0x194b1944, 0x19571950, 0x1961195c, 0x196f1968, 0x19831977, 0x1993198e, 0x199d1998, 0x194d1946, 0x19591952, 0x1963195e, 0x1971196a, 0x19851979, 0x19951990, 0x199f199a, 0x197c1988, 0x1974, 0x1f171ee9, 0x20471eef, 0x1f611f19, 0x1f5f1eed, 0x1fcd1f0f, 0x22e20329, 0x22232286, 0x204f25c8, 0x223b0325, 0x2240221b, 0x231c2007, 0x23ca255e, 0x23e21fab, 0x20982368, 0x1f4925a2, 0x22961fdf, 0x1f2b262c, 0x208a1f73, 0x1efd1ef1, 0x20fa1ef3, 0x1fc92001, 0x20b220b8, 0x1f292390, 0x1fd72568, 0x4882083, 0x48e048b, 0x4b10491, 0x4b704b4, 0x4bd04ba, 0x4c304c0, 0x4c904c6, 0x4e404cc, 0x34e033b, 0x4d604a3, 0x50304f2, 0x5290518, 0x327053a, 0x34d033a, 0xa8206b4, 0x7390a7f, 0x1bf11bd8, 0x1c0a1bff, 0x1c241c1a, 0x1c731c41, 0x1c991c90, 0x1cbd1cad, 0x1ccd1c1e, 0x1cdf1cda, 0x1cf01bfb, 0x1bde1cf5, 0x1d0f1ca6, 0x1c8e1d11, 0x1d1b1d0d, 0x1d551d39, 0x1d9f1d74, 0x1ddc1c31, 0x1def1c22, 0x1e041e00, 0x1e191e11, 0x1c351e1b, 0x1e341bed, 0x1e421c5d, 0x1e501e4b, 0x1e55, 0x1be01bda, 0x1beb1be5, 0x1bf91bf3, 0x1c0c1c04, 0x1c1c1c13, 0x1c331c20, 0x1c3c1c37, 0x1c2e1c29, 0x1c4b1c46, 0x1c501c57, 0x1c5f1c5c, 0x1c6d1c66, 0x1c7d1c61, 0x1c8b1c84, 0x1ca41c95, 0x1cb21ca8, 0x1cc21cb7, 0x1cd61cd2, 0x1cfa1ce4, 0x1c811d03, 0x1d171d0c, 0x1d291d35, 0x1d201d30, 0x1d4c1d45, 0x1d3e1d51, 0x1d6b1d64, 0x1d701d5a, 0x1d811d95, 0x1d9b1d85, 0x1d8f1d8a, 0x1dac1d79, 0x1db81da4, 0x1dbb1db2, 0x1dc51dbf, 0x1dce1dca, 0x1dd61dd2, 0x1de31dde, 0x1df11de6, 0x1c681df5, 0x1e0b1e06, 0x1e1f1e13, 0x1e291e24, 0x1e361e2e, 0x1c6f1e39, 0x33f0311, 0x3610352, 0x37f0370, 0x39d038e, 0x3bb03ac, 0x33e032b, 0x3600351, 0x37e036f, 0x39c038d, 0x3ba03ab, 0x40d0402, 0x4230418, 0xb0f042e, 0x56a0a53, 0xc580a0f, 0xa590ce6, 0xa600a5c, 0x210a06db, 0x20892200, 0x223d21f9, 0xc260cda, 0xbea11b4, 0x71c0b7b, 0x689075b, 0xb8c0a26, 0xc290cdd, 0x11c011b7, 0x6010bf6, 0xb7e068d, 0x68c0764, 0x11c30893, 0xa560bfd, 0xaec0b94, 0x11c60c35, 0xa300c00, 0xc030b97, 0xa340a33, 0xc070b9a, 0xa380a37, 0xc1b0b9e, 0x6910c1f, 0x7680b82, 0xcf60690, 0xd000cfa, 0xc380ce9, 0xc0f11c9, 0xc2c0ce0, 0xbed11ba, 0x76c0b86, 0xc2f0ce3, 0xbf011bd, 0x76f0b89, 0x77b0bb4, 0x5d70999, 0xa2d0a2a, 0x5e805ff, 0x6940a50, 0x6ae0b13, 0x71f0b3a, 0xba20722, 0xbbf0bbc, 0xbc60bc2, 0xbf90bf3, 0x8200c0b, 0x8230cd5, 0xd25082b, 0x9360869, 0x5d1092a, 0x34a0337, 0x36c035d, 0x38a037b, 0x3a80399, 0x32303b7, 0x3490336, 0x36b035c, 0x389037a, 0x3a70398, 0x3fe03b6, 0x4140409, 0x42a041f, 0x43c0435, 0x44a0443, 0x4710451, 0xaf40478, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26b4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe730e6b, 0x0, 0x0, 0x0, 0x22132556, 0x256a2584, 0x1eff22c6, 0x26ae1ff9, 0x209226ae, 0x202b25c8, 0x21872090, 0x244a2382, 0x250424e6, 0x25a8251e, 0x229a2254, 0x233c22f0, 0x25bc24ca, 0x1f112652, 0x225e1fe3, 0x24e42302, 0x20e6267a, 0x24dc22d6, 0x21a12526, 0x250a2478, 0x221d211f, 0x232822a6, 0x1f3125ae, 0x1fb31f7d, 0x225a21d5, 0x23922300, 0x24e02456, 0x257e24ec, 0x266a2610, 0x23b02678, 0x242c23d0, 0x25d624bc, 0x2540267e, 0x212d206d, 0x24682408, 0x23b4231a, 0x260c2566, 0x20d4206b, 0x22b02256, 0x242422ca, 0x25ec2438, 0x246e1fb1, 0x1f811f83, 0x242e23e6, 0x25f024c8, 0x21a3254e, 0x25462254, 0x20be1f05, 0x23322159, 0x1fc32372, 0x1f3923b8, 0x1ef5214b, 0x21e12290, 0x1fed2422, 0x23982063, 0x253824cc, 0x25962276, 0x21ab228c, 0x21bb24a8, 0x1f1f2370, 0x1f7f1f5d, 0x24182244, 0x253e2494, 0x1fb725c6, 0x20982011, 0x21ef2127, 0x23ba22d8, 0x265625e4, 0x268c2680, 0x220f1fa5, 0x2590226c, 0x217b210d, 0x21d12189, 0x22f622d0, 0x23e0234e, 0x24642432, 0x24d02588, 0x25d8259c, 0x1fa71f91, 0x22ee201b, 0x25382514, 0x2155211d, 0x227221b7, 0x232c2406, 0x20491f27, 0x20f020be, 0x233a215b, 0x24502348, 0x25ca2460, 0x2612260a, 0x1f332630, 0x25c023da, 0x216725fe, 0x1f451f15, 0x20d020c0, 0x225421e7, 0x238022fc, 0x25a624d6, 0x220726aa, 0x1fa325ea, 0x2233222d, 0x22be22a2, 0x236e2340, 0x242023ae, 0x1f612636, 0x25f22191, 0x20e21f3d, 0x258a22b2, 0x216b2143, 0x23322237, 0x1f9525f6, 0x20d82009, 0x222521fc, 0x2294224a, 0x2378233e, 0x25162446, 0x25c4251c, 0x1fcb2604, 0x200b22c0, 0x235022fe, 0x25f824de, 0x2682266e, 0x22ae2231, 0x23f6247c, 0x240e23fc, 0x22ea2326, 0x1f23254c, 0x1f9724b0, 0x21151f8f, 0x241421a5, 0x229c20b6, 0x258e220d, 0x25ee250e, 0x2123252c, 0x20371f4d, 0x0, 0x2061, 0x2205, 0x1f850000, 0x238c232a, 0x23cc23be, 0x23d823ce, 0x24102616, 0x2452, 0x24e2, 0x2544, 0x259e0000, 0x25b4, 0x0, 0x26422640, 0x26762644, 0x25fc25b0, 0x1f471f35, 0x1faf1f51, 0x1fd51fb5, 0x203d202f, 0x205f2041, 0x20d62065, 0x216120da, 0x21792175, 0x21db2185, 0x220921f3, 0x22a82246, 0x22ce22b6, 0x230822f8, 0x23b22342, 0x23c42240, 0x23c623c2, 0x23ca23c8, 0x23d623d4, 0x23f223e8, 0x24322400, 0x243a2436, 0x24582444, 0x249a2480, 0x24ce249a, 0x252e2522, 0x254a2548, 0x256e256c, 0x259e259a, 0x26282606, 0x215d2634, 0x248c274b, 0x0, 0x1f7b1ef9, 0x1f2f1f5b, 0x1f651f4f, 0x1fbb1fad, 0x2025202f, 0x203b202d, 0x20692061, 0x2094208e, 0x20aa20a2, 0x21252121, 0x214d213d, 0x21712165, 0x21792169, 0x21852173, 0x21bf2193, 0x21c921c5, 0x220521dd, 0x221f221d, 0x226e2229, 0x22a22276, 0x22c422c8, 0x22dc22ce, 0x23a422f8, 0x2324230a, 0x234a232a, 0x236a2358, 0x237e237c, 0x238e238c, 0x23a02396, 0x23b6239e, 0x240023f4, 0x2428240c, 0x24402432, 0x24b22458, 0x250024c6, 0x252a2524, 0x253a252e, 0x253c2544, 0x25462548, 0x254a2542, 0x256e2550, 0x25a4258c, 0x25ce25be, 0x260625f4, 0x26202616, 0x262e2628, 0x265e2634, 0x272126ae, 0x2733271f, 0x1ea11e8d, 0x27671ea3, 0x27a92779, 0x26ac26a4, 0x0, 0x0, 0x0, 0xadf0adb, 0xade0ae3, 0xd280ae2, 0xd28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x134e0000, 0x13481345, 0x134b1351, 0x0, 0x0, 0x13850000, 0x13d20000, 0x135413a6, 0x1374136f, 0x1360138e, 0x13b7139b, 0x2f413cd, 0x13ca13c7, 0x13c313bf, 0x13591356, 0x1364135c, 0x1371136c, 0x137c1376, 0x137f, 0x13881382, 0x1390138b, 0x1398, 0x139d, 0x13a313a0, 0x13a80000, 0x13ab, 0x13b413b1, 0x13bc13b9, 0x137913cf, 0x13931367, 0x135f13ae, 0x18181818, 0x181e181e, 0x181e181e, 0x18201820, 0x18201820, 0x18241824, 0x18241824, 0x181c181c, 0x181c181c, 0x18221822, 0x18221822, 0x181a181a, 0x181a181a, 0x183c183c, 0x183c183c, 0x183e183e, 0x183e183e, 0x18281828, 0x18281828, 0x18261826, 0x18261826, 0x182a182a, 0x182a182a, 0x182c182c, 0x182c182c, 0x18321832, 0x18301830, 0x18341834, 0x182e182e, 0x18381838, 0x18361836, 0x18401840, 0x18401840, 0x18441844, 0x18441844, 0x18481848, 0x18481848, 0x18461846, 0x18461846, 0x184a184a, 0x184c184c, 0x184c184c, 0x186d186d, 0x18501850, 0x18501850, 0x184e184e, 0x184e184e, 0x15911591, 0x186a186a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18420000, 0x18421842, 0x18031842, 0x17ff1803, 0x180717ff, 0x185b1807, 0x18621862, 0x18551855, 0x18601860, 0x180b180b, 0x180b180b, 0x14151415, 0x17cd17cd, 0x180d180d, 0x17f117f1, 0x18011801, 0x17fd17fd, 0x18051805, 0x18091809, 0x17f51809, 0x17f517f5, 0x18641864, 0x18641864, 0x17d517d1, 0x17f517e5, 0x13f417f9, 0x13fe13f7, 0x1414140b, 0x141e1417, 0x1438142d, 0x146a144d, 0x1472146d, 0x1484147b, 0x148c1487, 0x14311422, 0x14d11435, 0x143c14d4, 0x150514fa, 0x151a150c, 0x15931562, 0x15a515a2, 0x15ba15b0, 0x15c815c5, 0x15e415df, 0x16071575, 0x163f160a, 0x16451642, 0x1653164c, 0x165b1656, 0x16711662, 0x16791674, 0x167f167c, 0x16851682, 0x16931688, 0x16aa1696, 0x16c816b9, 0x1579158c, 0x145116e0, 0x14591455, 0x145d1526, 0x172d1461, 0x174f1740, 0x17691758, 0x1771176c, 0x177f1774, 0x179c1782, 0x17aa17a3, 0x17c417b3, 0x14e417c7, 0x179714ee, 0x64005d, 0x72006b, 0x800079, 0x17e117dd, 0x17e917e5, 0x17f917f5, 0x140813db, 0x140e140b, 0x14171414, 0x144a1447, 0x1464144d, 0x146d146a, 0x14781475, 0x147e147b, 0x14871484, 0x16561653, 0x16741671, 0x16851679, 0x16931688, 0x158c1696, 0x16e01579, 0x152616e5, 0x17551752, 0x17631758, 0x176c1769, 0x17ad1797, 0x17b317b0, 0x17c417be, 0x17d117c7, 0x17d917d5, 0x17ed17e5, 0x13f713f4, 0x140b13fe, 0x141e1411, 0x1438142d, 0x1467144d, 0x148c147b, 0x14311422, 0x14d11435, 0x14fa143c, 0x150c1505, 0x1562151a, 0x1593156d, 0x15a515a2, 0x15ba15b0, 0x15df15c5, 0x157515e4, 0x160a1607, 0x1642163f, 0x164c1645, 0x1662165b, 0x167f167c, 0x16851682, 0x16aa1688, 0x16c816b9, 0x13e0158c, 0x14551451, 0x15261459, 0x1740172d, 0x1758174f, 0x17711766, 0x17851774, 0x17a3179c, 0x17b317aa, 0x17e515ed, 0x140b17ed, 0x144d1411, 0x147b1467, 0x151a1481, 0x154c1529, 0x16851557, 0x158c1688, 0x17661758, 0x15ed17b3, 0x162c1625, 0x15d71633, 0x15ff15da, 0x16191602, 0x152c161c, 0x155a152f, 0x1490155d, 0x142613fb, 0x1440142a, 0x159a1402, 0x15bd159d, 0x153415c0, 0x1546153b, 0x1549154c, 0x15701517, 0x15d715b7, 0x15ff15da, 0x16191602, 0x152c161c, 0x155a152f, 0x1490155d, 0x142613fb, 0x1440142a, 0x159a1402, 0x15bd159d, 0x153415c0, 0x1546153b, 0x1549154c, 0x15701517, 0x153415b7, 0x1546153b, 0x1529154c, 0x15c81557, 0x150514fa, 0x1534150c, 0x1546153b, 0x15df15c8, 0x13e313e3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14301421, 0x14341430, 0x1450143b, 0x14581454, 0x14a314a3, 0x14c114c5, 0x14fd1508, 0x15211501, 0x151d1521, 0x15251525, 0x15651565, 0x153e1596, 0x1537153e, 0x154f154f, 0x15531553, 0x15b315a8, 0x15cb15b3, 0x15cf15cb, 0x15e715d3, 0x15f315f3, 0x160d15f7, 0x16111615, 0x16481648, 0x16691665, 0x16c416bc, 0x16ad16c0, 0x16cb16ad, 0x16d216cb, 0x16fe16d2, 0x170b1702, 0x16f316eb, 0x17161712, 0x0, 0x177716ef, 0x1743177b, 0x17341747, 0x17381734, 0x175b175f, 0x17b617b6, 0x14291401, 0x14431425, 0x1460143f, 0x14ab145c, 0x14a7148f, 0x1569150f, 0x15ac1542, 0x16d616b5, 0x179f17a6, 0x172117ba, 0x174b166d, 0x16bc1665, 0x168f15fb, 0x171a1730, 0x168b16b1, 0x173016b1, 0x14ba1493, 0x164f16f7, 0x168b13fa, 0x159615e7, 0x173c1513, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x165e158f, 0x13d913de, 0x15731706, 0x15eb14e9, 0x1578158a, 0x1497157c, 0x14f1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b3102f6, 0x5401b33, 0x8d0546, 0x1b770093, 0x2ff1b79, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a6d02fc, 0x9931a6b, 0xa10993, 0xe3b00a5, 0x1b4b0e3f, 0x1b451b4f, 0x1b391b47, 0x1b351b3b, 0x1b3d1b37, 0x1b411b3f, 0x1b43, 0x98b0000, 0xc098f, 0xc000c, 0x993000c, 0x9930993, 0x1b3102f6, 0x2fa, 0x5400546, 0x8d0093, 0xa11a6d, 0xe3b00a5, 0x1b4b0e3f, 0x971b4f, 0x2f2009d, 0x2f802f4, 0x5590548, 0x544, 0x99098d, 0x566009b, 0x0, 0x0, 0x161f0057, 0x5a, 0x61, 0x16220068, 0x1629006f, 0x16300076, 0x1637007d, 0x163a0084, 0x13e613d5, 0x13e913e6, 0x178f13e9, 0x13ec178f, 0x17ca13ec, 0x17ca17ca, 0x13d717ca, 0x13f213d7, 0x13f213f2, 0x141a13f2, 0x141c141a, 0x141c141c, 0x1470141c, 0x14701470, 0x13f51470, 0x13f513f5, 0x13f813f5, 0x13f813f8, 0x13ff13f8, 0x13ff13ff, 0x14e013ff, 0x14e214e0, 0x13dc14e2, 0x140913dc, 0x14f81409, 0x14f814f8, 0x153214f8, 0x15321532, 0x15601532, 0x15601560, 0x15a01560, 0x15a015a0, 0x15c315a0, 0x15c315c3, 0x15dd15c3, 0x15dd15dd, 0x15e215dd, 0x15e215e2, 0x160515e2, 0x16051605, 0x163d1605, 0x163d163d, 0x1659163d, 0x16591659, 0x16771659, 0x16771677, 0x14ec1677, 0x14ec14ec, 0x140c14ec, 0x140c140c, 0x140f140c, 0x140f140f, 0x13e1140f, 0x13e113e1, 0x178813e1, 0x14151788, 0x13fc1415, 0x13fc13fc, 0x169e13fc, 0x16a2169e, 0x16a616a2, 0x169b16a6, 0x169b, 0x0, 0x8d0000, 0x970095, 0x9b0099, 0x9f009d, 0xa500a1, 0x2f402f2, 0x2f802f6, 0x30302fa, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x5460540, 0x5440548, 0x930559, 0x5680566, 0x5e305d5, 0x62905e6, 0x687067e, 0x6cf06ac, 0x71a0607, 0x7230734, 0x7a4077e, 0x83b06af, 0x85e082c, 0x56b088d, 0x77006b2, 0x95a0682, 0x98b060a, 0x98f098d, 0x9930991, 0x6920995, 0x9a00937, 0xa7d0a2e, 0x6020ad9, 0xae00b0d, 0xb79073e, 0x5d30a28, 0x7870b3b, 0x5d80cd3, 0x8400a11, 0xa240ba3, 0xde1086a, 0x6950b41, 0xe3b0611, 0xe3f0e3d, 0x1b280e41, 0x1b331b2a, 0x1b3f1b3d, 0x1e5c1b31, 0x1bd61e55, 0x1bfd1bef, 0x1c181c08, 0x1e0f1e02, 0x1cee1e17, 0x1bd81c16, 0x1bff1bf1, 0x1c1a1c0a, 0x1c411c24, 0x1c901c73, 0x1cad1c99, 0x1c1e1cbd, 0x1cda1ccd, 0x1bfb1cdf, 0x1cf51cf0, 0x1ca61bde, 0x1d111d0f, 0x1d0d1c8e, 0x1d391d1b, 0x1d741d55, 0x1c311d9f, 0x1c221ddc, 0x1e001def, 0x1e111e04, 0x1e1b1e19, 0x1bed1c35, 0x1c5d1e34, 0x1c061e42, 0x8b0088, 0x194419d4, 0x1a101949, 0x1a12194b, 0x19501a14, 0x19571955, 0x1a181a16, 0x1a1c1a1a, 0x1a201a1e, 0x195c19a6, 0x19661961, 0x196819b0, 0x196f196d, 0x19811977, 0x198e1983, 0x19981993, 0x199d, 0x0, 0x19d81947, 0x19dc19da, 0x19e019de, 0x0, 0x19e419e2, 0x19e8198c, 0x19ec19ea, 0x0, 0x197519ee, 0x19f419f2, 0x19f819f6, 0x0, 0x197f19fa, 0x19fe, 0x0, 0xe450e43, 0x90e4b, 0xe470e49, 0x1a82, 0x1a841b22, 0x1a8b1a89, 0x1b241a90, 0x1b26, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26b6, 0x26b9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26bc0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26c226bf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26c826c5, 0x26cf26cb, 0x26d726d3, 0x26db, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26df0000, 0x26e226ea, 0x26e626ed, 0x26f1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0x602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x568, 0x5e605e3, 0x0, 0x687, 0x6070000, 0x71a, 0x77e0000, 0x6af07a4, 0x83b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90000, 0xb0d0000, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30000, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e60000, 0x67e0629, 0x687, 0x6070000, 0x734071a, 0x77e0723, 0x6af07a4, 0x83b, 0x88d085e, 0x6b2056b, 0x6820770, 0x95a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e60000, 0x67e0629, 0x687, 0x60706cf, 0x734071a, 0x723, 0x7a4, 0x0, 0x88d085e, 0x6b2056b, 0x6820770, 0x95a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x9370692, 0xa2e09a0, 0xad90a7d, 0xb0d0602, 0x73e0ae0, 0xa280b79, 0xb3b05d3, 0xcd30787, 0xa1105d8, 0xba30840, 0x86a0a24, 0xb410de1, 0x6110695, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0xb410de1, 0x6110695, 0xe800e6f, 0x0, 0xf380ee3, 0xf3c0f3a, 0xf5c0f3e, 0xfad0f5e, 0xfde0faf, 0xfe20fe0, 0xfe60fe4, 0x10060fe8, 0xfad1008, 0x100f100d, 0x10311011, 0x10351033, 0x1aa3077c, 0x10ea1086, 0x10ee10ec, 0x110e10f0, 0x116e1110, 0x11ae1170, 0x11b211b0, 0x11ce11cc, 0x11ee11d0, 0x11f811f0, 0x11fc11fa, 0x123c11fe, 0x1240123e, 0x1a9e1242, 0x116e10f0, 0x123c11ae, 0x11ee11f0, 0xf380ee3, 0xf3c0f3a, 0xf5c0f3e, 0xfad0f5e, 0xfde0faf, 0xfe20fe0, 0xfe60fe4, 0x10060fe8, 0xfad1008, 0x100f100d, 0x10311011, 0x10351033, 0x1aa3077c, 0x10ea1086, 0x10ee10ec, 0x110e10f0, 0x116e1110, 0x11ae1170, 0x11b211b0, 0x11ce11cc, 0x11ee11d0, 0x11f811f0, 0x11fc11fa, 0x123c11fe, 0x1240123e, 0x1a9e1242, 0x116e10f0, 0x123c11ae, 0x11ee11f0, 0xf380ee3, 0xf3c0f3a, 0xf5c0f3e, 0xfad0f5e, 0xfde0faf, 0xfe20fe0, 0xfe60fe4, 0x10060fe8, 0xfad1008, 0x100f100d, 0x10311011, 0x10351033, 0x1aa3077c, 0x10ea1086, 0x10ee10ec, 0x110e10f0, 0x116e1110, 0x11ae1170, 0x11b211b0, 0x11ce11cc, 0x11ee11d0, 0x11f811f0, 0x11fc11fa, 0x123c11fe, 0x1240123e, 0x1a9e1242, 0x116e10f0, 0x123c11ae, 0x11ee11f0, 0xf380ee3, 0xf3c0f3a, 0xf5c0f3e, 0xfad0f5e, 0xfde0faf, 0xfe20fe0, 0xfe60fe4, 0x10060fe8, 0xfad1008, 0x100f100d, 0x10311011, 0x10351033, 0x1aa3077c, 0x10ea1086, 0x10ee10ec, 0x110e10f0, 0x116e1110, 0x11ae1170, 0x11b211b0, 0x11ce11cc, 0x11ee11d0, 0x11f811f0, 0x11fc11fa, 0x123c11fe, 0x1240123e, 0x1a9e1242, 0x116e10f0, 0x123c11ae, 0x11ee11f0, 0xf380ee3, 0xf3c0f3a, 0xf5c0f3e, 0xfad0f5e, 0xfde0faf, 0xfe20fe0, 0xfe60fe4, 0x10060fe8, 0xfad1008, 0x100f100d, 0x10311011, 0x10351033, 0x1aa3077c, 0x10ea1086, 0x10ee10ec, 0x110e10f0, 0x116e1110, 0x11ae1170, 0x11b211b0, 0x11ce11cc, 0x11ee11d0, 0x11f811f0, 0x11fc11fa, 0x123c11fe, 0x1240123e, 0x1a9e1242, 0x116e10f0, 0x123c11ae, 0x11ee11f0, 0x12a212a0, 0x0, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x3140305, 0x30f0343, 0x3740365, 0x3920383, 0x3b003a1, 0x13f213d7, 0x14e013f5, 0x17880000, 0x13f81409, 0x13fc15c3, 0x14ec1677, 0x140f140c, 0x15e214f8, 0x1560163d, 0x13dc1659, 0x141c1532, 0x13ff1470, 0x15a014e2, 0x160515dd, 0x184a1814, 0x1816183a, 0x13f20000, 0x13f5, 0x13e1, 0x13f80000, 0x13fc0000, 0x14ec1677, 0x140f140c, 0x15e214f8, 0x1560163d, 0x1659, 0x141c1532, 0x13ff1470, 0x15a00000, 0x16050000, 0x0, 0x0, 0x0, 0x13f5, 0x0, 0x13f80000, 0x13fc0000, 0x14ec0000, 0x140f0000, 0x15e214f8, 0x15600000, 0x1659, 0x1532, 0x13ff0000, 0x15a00000, 0x16050000, 0x184a0000, 0x18160000, 0x13f20000, 0x13f5, 0x13e1, 0x13f80000, 0x13fc15c3, 0x1677, 0x140f140c, 0x15e214f8, 0x1560163d, 0x1659, 0x141c1532, 0x13ff1470, 0x15a00000, 0x160515dd, 0x1814, 0x183a, 0x13f213d7, 0x14e013f5, 0x178813e1, 0x13f81409, 0x13fc15c3, 0x14ec0000, 0x140f140c, 0x15e214f8, 0x1560163d, 0x13dc1659, 0x141c1532, 0x13ff1470, 0x15a014e2, 0x160515dd, 0x0, 0x0, 0x13f20000, 0x14e013f5, 0x17880000, 0x13f81409, 0x13fc15c3, 0x14ec0000, 0x140f140c, 0x15e214f8, 0x1560163d, 0x13dc1659, 0x141c1532, 0x13ff1470, 0x15a014e2, 0x160515dd, 0x0, 0x0, 0x307030a, 0x3f10316, 0x4ab0468, 0x4fa04de, 0x520050b, 0x531, 0x0, 0x0, 0x10200fe, 0x10a0106, 0x112010e, 0x11a0116, 0x122011e, 0x12a0126, 0x132012e, 0x13a0136, 0x142013e, 0x14a0146, 0x152014e, 0x15a0156, 0x162015e, 0x5e31b4d, 0x5e5082c, 0x933, 0x5d50568, 0x5e605e3, 0x67e0629, 0x6ac0687, 0x60706cf, 0x734071a, 0x77e0723, 0x6af07a4, 0x82c083b, 0x88d085e, 0x6b2056b, 0x6820770, 0x60a095a, 0x76c06b1, 0x8660860, 0x9300827, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x761075e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x606, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c9e1bc3, 0x1cad, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20b02197, 0x1cf71ff3, 0x20811f17, 0x208c2532, 0x21fe1f1d, 0x21e722f2, 0x21451f9d, 0x21eb1f69, 0x24261f93, 0x2560235c, 0x200f2073, 0x219d22cc, 0x1ee921b3, 0x25a01eef, 0x1efd20fa, 0x21ad2001, 0x21992574, 0x23f023d2, 0x22bc2005, 0x329221b, 0x1f9f2366, 0x2035, 0x0, 0x0, 0x1b511b69, 0x1b5d1b55, 0x1b611b6d, 0x1b591b71, 0x1b65, 0x0, 0x0, 0x0, 0x1ffd2147, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f031f07, 0x26f51f0b, 0x1f351f2d, 0x1f3b1f37, 0x1f411f3f, 0x1f431f47, 0x26fd1e63, 0x1f531f51, 0x1f631f55, 0x1e6526f7, 0x1f691f59, 0x1f7126fb, 0x1f251f75, 0x1f7b1f79, 0x1f8927b9, 0x1e691f8d, 0x1f9b1f99, 0x1fa11f9f, 0x1fad1e6b, 0x1fb51faf, 0x1fbd1fbb, 0x1fc31fbf, 0x1fd51fd3, 0x1fe11fd9, 0x1fe71fe5, 0x1fe71fe7, 0x22e42703, 0x1ff51ff1, 0x1ffb2705, 0x20031fff, 0x200d2017, 0x20152013, 0x201d2019, 0x2023201f, 0x20292027, 0x202d2029, 0x20332031, 0x204b2039, 0x204d203d, 0x2043203f, 0x20711f8f, 0x20572055, 0x20532059, 0x205b205d, 0x27072067, 0x20772075, 0x2081207b, 0x20962085, 0x270b2709, 0x209e209c, 0x209a20a0, 0x1e6d20a4, 0x20a81e6f, 0x20ac20ac, 0x20ba270d, 0x20be20bc, 0x270f20c2, 0x20c820c6, 0x20cc2137, 0x20d21e71, 0x20e020da, 0x271320de, 0x271520e4, 0x20e820ea, 0x20f420ec, 0x1e7320f6, 0x210220fe, 0x21062104, 0x27171e75, 0x21171e77, 0x211b2119, 0x27cd211f, 0x271b212b, 0x2486271b, 0x21332133, 0x27291e79, 0x213b277d, 0x1e7b213f, 0x21512149, 0x21572153, 0x1e7f215f, 0x21611e7d, 0x2163271d, 0x216f216d, 0x216f2171, 0x21792177, 0x217d2181, 0x2183217f, 0x21872185, 0x218f210b, 0x219f219b, 0x21b121a7, 0x21af2723, 0x21b521a9, 0x21c321b9, 0x21c72725, 0x21bd21c1, 0x21cb1e81, 0x21d321cf, 0x1e8321cd, 0x21df21db, 0x21f52727, 0x22032215, 0x22091e89, 0x1e851e87, 0x1f6d1f6b, 0x220b2217, 0x1ebb2470, 0x221f221d, 0x222b2221, 0x27312227, 0x22351e8b, 0x2242222f, 0x27352246, 0x22392248, 0x1e8d224c, 0x2250224e, 0x22582252, 0x225c2737, 0x22621e8f, 0x22642739, 0x226a1e91, 0x22762270, 0x273b2278, 0x273d2711, 0x273f2288, 0x2292228e, 0x2298228a, 0x22a822a0, 0x22a422a2, 0x22ac22aa, 0x229e2741, 0x22ba22b8, 0x22c41e93, 0x274322c2, 0x22d222b4, 0x27472745, 0x22de22d4, 0x22da22dc, 0x22e01e95, 0x22e622e8, 0x26f922ec, 0x274922f4, 0x274d22fa, 0x230a2304, 0x274f2314, 0x2320231e, 0x27532751, 0x2336232e, 0x23381e97, 0x1e991e99, 0x23462344, 0x234c234a, 0x1e9b2352, 0x2755235e, 0x2757236c, 0x27192372, 0x2759237a, 0x275d275b, 0x1e9f1e9d, 0x27612396, 0x2763275f, 0x239a2765, 0x239c239c, 0x1ea323a0, 0x1ea523a2, 0x27691ea7, 0x23b023ac, 0x1ea923b6, 0x23c8276b, 0x276f276d, 0x23e423d8, 0x23e81eab, 0x23ec23ea, 0x27732771, 0x23f82773, 0x27751ead, 0x24042402, 0x27771eaf, 0x1eb12412, 0x2416241a, 0x277b241e, 0x1eb3242a, 0x24342430, 0x1eb5243c, 0x2781277f, 0x27831eb7, 0x27852448, 0x2454244e, 0x27872458, 0x24622789, 0x2466278b, 0x1eb9272b, 0x24742472, 0x24761ebd, 0x278d20a6, 0x272d278f, 0x2486272f, 0x25942488, 0x249e1ebf, 0x24a0249c, 0x24a21fa9, 0x24a624a4, 0x279124aa, 0x24ac24a8, 0x24b824b6, 0x24ba24ae, 0x24ce24c4, 0x24be24b4, 0x24c224c0, 0x27972793, 0x1ec12795, 0x24d424d2, 0x279f24d8, 0x279924da, 0x1ec51ec3, 0x279d279b, 0x24ea1ec7, 0x24ee24ec, 0x24f624f0, 0x24fa24f4, 0x250024f8, 0x24fe24fc, 0x1ec92502, 0x25082506, 0x25101ecb, 0x27a12512, 0x251a2518, 0x25201ecd, 0x27a31e67, 0x1ecf27a5, 0x25361ed1, 0x25502542, 0x27a72558, 0x25642562, 0x25762570, 0x26ff27ab, 0x257a257c, 0x27012580, 0x258c2586, 0x27af27ad, 0x25b225ac, 0x27b125b6, 0x25cc25b8, 0x25d425d2, 0x25da25d0, 0x27b325dc, 0x1ed325e2, 0x27b525e6, 0x26021ed5, 0x260e20ee, 0x27bb27b7, 0x1ed91ed7, 0x27bd2622, 0x27bf1edb, 0x262e262e, 0x27c12632, 0x1edd263e, 0x264c2646, 0x26542650, 0x27c31edf, 0x266c265e, 0x1ee12672, 0x26741ee3, 0x1ee527c5, 0x27c927c7, 0x268627cb, 0x26901ee7, 0x26962694, 0x269e269a, 0x27cf26a2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//12288 bytes
diff --git a/std/internal/unicode_grapheme.d b/std/internal/unicode_grapheme.d
index ffc5c061d..2d540afda 100644
--- a/std/internal/unicode_grapheme.d
+++ b/std/internal/unicode_grapheme.d
@@ -1,7 +1,7 @@
module std.internal.unicode_grapheme;
import std.internal.unicode_tables;
-static if(size_t.sizeof == 8) {
+static if (size_t.sizeof == 8) {
//832 bytes
enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x20, 0x40], [ 0x100, 0x80, 0xa00], [ 0x2010000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000300020001, 0x1000700060005, 0x5000400030002, 0x2000100070006, 0x6000500040003, 0x3000200010007, 0x7000600050004, 0x4000300020001, 0x1000700060005, 0x5000400030002, 0x8000100070006, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000010000001, 0x1000000100000, 0x10000001000, 0x1000000100000010, 0x10000001000000, 0x100000010000, 0x1000000100, 0x100000010000001, 0x1000000100000, 0x10000001000, 0x1000000100000010, 0x10000001000000, 0x100000010000, 0x1000000100, 0x100000010000001, 0x1000000100000, 0x10000001000, 0x1000000100000010, 0x10000001000000, 0x100000010000, 0x1000000100, 0x100000010000001, 0x1000000100000, 0x10000001000, 0x1000000100000010, 0x10000001000000, 0x100000010000, 0x1000000100, 0x10000001000000, 0x100000010000, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0]);
//832 bytes
@@ -14,7 +14,7 @@ enum graphemeExtendTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x20, 0x70],
}
-static if(size_t.sizeof == 4) {
+static if (size_t.sizeof == 4) {
//832 bytes
enum hangulLVTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x40, 0x80], [ 0x100, 0x80, 0xa00], [ 0x0, 0x20100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20001, 0x40003, 0x60005, 0x10007, 0x30002, 0x50004, 0x70006, 0x20001, 0x40003, 0x60005, 0x10007, 0x30002, 0x50004, 0x70006, 0x20001, 0x40003, 0x60005, 0x10007, 0x30002, 0x50004, 0x70006, 0x80001, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x10000001, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//832 bytes
diff --git a/std/internal/unicode_norm.d b/std/internal/unicode_norm.d
index 7d142d8b6..05944fb9f 100644
--- a/std/internal/unicode_norm.d
+++ b/std/internal/unicode_norm.d
@@ -1,7 +1,7 @@
module std.internal.unicode_norm;
import std.internal.unicode_tables;
-static if(size_t.sizeof == 8) {
+static if (size_t.sizeof == 8) {
//1600 bytes
enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x20, 0x60], [ 0x100, 0x100, 0x1a00], [ 0x302020202020100, 0x205020202020204, 0x602020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000000000, 0x200000000, 0x5000400030000, 0x8000000070006, 0xa0009, 0x0, 0xb000000000000, 0xc000000000000, 0xf0000000e000d, 0x0, 0x1000000000, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14001300120000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x160015, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x170000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1800120012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10361f8081a9fdf, 0x401000000000003f, 0x80, 0x0, 0x0, 0x380000, 0x0, 0x0, 0x1000000000000000, 0xff000000, 0x4000000000000000, 0xb0800000, 0x48000000000000, 0x4e000000, 0x0, 0x0, 0x4000000000000000, 0x30c00000, 0x4000000000000000, 0x800000, 0x0, 0x400000, 0x0, 0x600004, 0x4000000000000000, 0x800000, 0x0, 0x80008400, 0x0, 0x168020010842008, 0x200108420080002, 0x0, 0x400000000000, 0x0, 0x0, 0x0, 0x0, 0x3ffffe00000000, 0xffffff0000000000, 0x7, 0x20000000000000, 0x0, 0x0, 0x0, 0x0, 0x2aaa000000000000, 0x4800000000000000, 0x2a00c80808080a00, 0x3, 0x0, 0x0, 0x0, 0xc4000000000, 0x0, 0x0, 0x0, 0x60000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0, 0x6000000, 0x0, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xfffffc657fe53fff, 0xffff3fffffffffff, 0xffffffffffffffff, 0x3ffffff, 0x5f7ffc00a0000000, 0x7fdb, 0x0, 0x0, 0x0, 0x0, 0x400000000000000, 0x0, 0x8000000000, 0x0, 0x0, 0x0, 0x0, 0x1fc0000000, 0xf800000000000000, 0x1, 0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//1920 bytes
@@ -14,7 +14,7 @@ enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x20, 0x78], [ 0x100
}
-static if(size_t.sizeof == 4) {
+static if (size_t.sizeof == 4) {
//1600 bytes
enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([ 0x0, 0x40, 0xc0], [ 0x100, 0x100, 0x1a00], [ 0x2020100, 0x3020202, 0x2020204, 0x2050202, 0x2020202, 0x6020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000, 0x0, 0x2, 0x30000, 0x50004, 0x70006, 0x80000, 0xa0009, 0x0, 0x0, 0x0, 0x0, 0xb0000, 0x0, 0xc0000, 0xe000d, 0xf0000, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x120000, 0x140013, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x160015, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x170000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x120012, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x81a9fdf, 0x10361f8, 0x3f, 0x40100000, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x380000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0xff000000, 0x0, 0x0, 0x40000000, 0xb0800000, 0x0, 0x0, 0x480000, 0x4e000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x30c00000, 0x0, 0x0, 0x40000000, 0x800000, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x600004, 0x0, 0x0, 0x40000000, 0x800000, 0x0, 0x0, 0x0, 0x80008400, 0x0, 0x0, 0x0, 0x10842008, 0x1680200, 0x20080002, 0x2001084, 0x0, 0x0, 0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ffffe, 0x0, 0xffffff00, 0x7, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2aaa0000, 0x0, 0x48000000, 0x8080a00, 0x2a00c808, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6000000, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x7fe53fff, 0xfffffc65, 0xffffffff, 0xffff3fff, 0xffffffff, 0xffffffff, 0x3ffffff, 0x0, 0xa0000000, 0x5f7ffc00, 0x7fdb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0x1f, 0x0, 0xf8000000, 0x1, 0x0, 0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//1920 bytes
diff --git a/std/internal/unicode_tables.d b/std/internal/unicode_tables.d
index 38cc7239b..831b5432e 100644
--- a/std/internal/unicode_tables.d
+++ b/std/internal/unicode_tables.d
@@ -2091,37 +2091,37 @@ _U("Vowel_Jamo", V),
}
bool isFormatGen(dchar ch) @safe pure nothrow
{
- if(ch < 8288)
+ if (ch < 8288)
{
- if(ch < 1807)
+ if (ch < 1807)
{
- if(ch < 1564)
+ if (ch < 1564)
{
- if(ch == 173) return true;
- if(ch < 1536) return false;
- if(ch < 1541) return true;
+ if (ch == 173) return true;
+ if (ch < 1536) return false;
+ if (ch < 1541) return true;
return false;
}
else if (ch < 1565) return true;
else
{
- if(ch == 1757) return true;
+ if (ch == 1757) return true;
return false;
}
}
else if (ch < 1808) return true;
else
{
- if(ch < 8203)
+ if (ch < 8203)
{
- if(ch == 6158) return true;
+ if (ch == 6158) return true;
return false;
}
else if (ch < 8208) return true;
else
{
- if(ch < 8234) return false;
- if(ch < 8239) return true;
+ if (ch < 8234) return false;
+ if (ch < 8239) return true;
return false;
}
}
@@ -2129,36 +2129,36 @@ bool isFormatGen(dchar ch) @safe pure nothrow
else if (ch < 8293) return true;
else
{
- if(ch < 69821)
+ if (ch < 69821)
{
- if(ch < 65279)
+ if (ch < 65279)
{
- if(ch < 8294) return false;
- if(ch < 8304) return true;
+ if (ch < 8294) return false;
+ if (ch < 8304) return true;
return false;
}
else if (ch < 65280) return true;
else
{
- if(ch < 65529) return false;
- if(ch < 65532) return true;
+ if (ch < 65529) return false;
+ if (ch < 65532) return true;
return false;
}
}
else if (ch < 69822) return true;
else
{
- if(ch < 917505)
+ if (ch < 917505)
{
- if(ch < 119155) return false;
- if(ch < 119163) return true;
+ if (ch < 119155) return false;
+ if (ch < 119163) return true;
return false;
}
else if (ch < 917506) return true;
else
{
- if(ch < 917536) return false;
- if(ch < 917632) return true;
+ if (ch < 917536) return false;
+ if (ch < 917632) return true;
return false;
}
}
@@ -2167,34 +2167,34 @@ bool isFormatGen(dchar ch) @safe pure nothrow
bool isControlGen(dchar ch) @safe pure nothrow
{
- if(ch < 32) return true;
- if(ch < 127) return false;
- if(ch < 160) return true;
+ if (ch < 32) return true;
+ if (ch < 127) return false;
+ if (ch < 160) return true;
return false;
}
bool isSpaceGen(dchar ch) @safe pure nothrow
{
- if(ch < 160)
+ if (ch < 160)
{
- if(ch == 32) return true;
+ if (ch == 32) return true;
return false;
}
else if (ch < 161) return true;
else
{
- if(ch < 8239)
+ if (ch < 8239)
{
- if(ch == 5760) return true;
- if(ch < 8192) return false;
- if(ch < 8203) return true;
+ if (ch == 5760) return true;
+ if (ch < 8192) return false;
+ if (ch < 8203) return true;
return false;
}
else if (ch < 8240) return true;
else
{
- if(ch == 8287) return true;
- if(ch == 12288) return true;
+ if (ch == 8287) return true;
+ if (ch == 12288) return true;
return false;
}
}
@@ -2202,43 +2202,43 @@ bool isSpaceGen(dchar ch) @safe pure nothrow
bool isWhiteGen(dchar ch) @safe pure nothrow @nogc
{
- if(ch < 133)
+ if (ch < 133)
{
- if(ch < 9) return false;
- if(ch < 14) return true;
- if(ch == 32) return true;
+ if (ch < 9) return false;
+ if (ch < 14) return true;
+ if (ch == 32) return true;
return false;
}
else if (ch < 134) return true;
else
{
- if(ch < 8232)
+ if (ch < 8232)
{
- if(ch < 5760)
+ if (ch < 5760)
{
- if(ch == 160) return true;
+ if (ch == 160) return true;
return false;
}
else if (ch < 5761) return true;
else
{
- if(ch < 8192) return false;
- if(ch < 8203) return true;
+ if (ch < 8192) return false;
+ if (ch < 8203) return true;
return false;
}
}
else if (ch < 8234) return true;
else
{
- if(ch < 8287)
+ if (ch < 8287)
{
- if(ch == 8239) return true;
+ if (ch == 8239) return true;
return false;
}
else if (ch < 8288) return true;
else
{
- if(ch == 12288) return true;
+ if (ch == 12288) return true;
return false;
}
}
@@ -2247,33 +2247,33 @@ bool isWhiteGen(dchar ch) @safe pure nothrow @nogc
bool isHangL(dchar ch) @safe pure nothrow
{
- if(ch < 4352) return false;
- if(ch < 4448) return true;
- if(ch < 43360) return false;
- if(ch < 43389) return true;
+ if (ch < 4352) return false;
+ if (ch < 4448) return true;
+ if (ch < 43360) return false;
+ if (ch < 43389) return true;
return false;
}
bool isHangV(dchar ch) @safe pure nothrow
{
- if(ch < 4448) return false;
- if(ch < 4520) return true;
- if(ch < 55216) return false;
- if(ch < 55239) return true;
+ if (ch < 4448) return false;
+ if (ch < 4520) return true;
+ if (ch < 55216) return false;
+ if (ch < 55239) return true;
return false;
}
bool isHangT(dchar ch) @safe pure nothrow
{
- if(ch < 4520) return false;
- if(ch < 4608) return true;
- if(ch < 55243) return false;
- if(ch < 55292) return true;
+ if (ch < 4520) return false;
+ if (ch < 4608) return true;
+ if (ch < 55243) return false;
+ if (ch < 55292) return true;
return false;
}
-static if(size_t.sizeof == 8) {
+static if (size_t.sizeof == 8) {
//1536 bytes
enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 4, 9)([ 0x0, 0x20, 0x40], [ 0x100, 0x80, 0x2000], [ 0x402030202020100, 0x206020202020205, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3000200010000, 0x3000300030003, 0x3000300030003, 0x5000400030003, 0x3000700030006, 0x3000800030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x9000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0xb0003000a0003, 0x3000c00030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0xe000d00030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x3000300030003, 0x0, 0x7fffffe00000000, 0x420040000000000, 0xff7fffff80000000, 0x55aaaaaaaaaaaaaa, 0xd4aaaaaaaaaaab55, 0xe6512d2a4e243129, 0xaa29aaaab5555240, 0x93faaaaaaaaaaaaa, 0xffffffffffffaa85, 0x1ffffffffefffff, 0x1f00000003, 0x0, 0x3c8a000000000020, 0xfffff00000010000, 0x192faaaaaae37fff, 0xffff000000000000, 0xaaaaaaaaffffffff, 0xaaaaaaaaaaaaa802, 0xaaaaaaaaaaaad554, 0xaaaaaaaaaa, 0xfffffffe00000000, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xaaaaaaaaaaaaaaaa, 0xaaaaaaaaaaaaaaaa, 0xaaaaaaaabfeaaaaa, 0xaaaaaaaaaaaaaaaa, 0xff00ff003f00ff, 0x3fff00ff00ff003f, 0x40df00ff00ff00ff, 0xdc00ff00cf00dc, 0x0, 0x8002000000000000, 0x1fff0000, 0x0, 0x321080000008c400, 0xffff0000000043c0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x3ffffff0000, 0x0, 0x0, 0x0, 0x0, 0xffff000000000000, 0x3fda15627fffffff, 0xaaaaaaaaaaaaaaaa, 0x8501aaaaaaaaa, 0x20bfffffffff, 0x0, 0x0, 0x0, 0x0, 0x2aaaaaaaaaaa, 0xaaaaaa, 0x0, 0xaaabaaa800000000, 0x95ffaaaaaaaaaaaa, 0x2aa000a50aa, 0x700000000000000, 0x0, 0x0, 0x0, 0x0, 0xf8007f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7fffffe, 0x0, 0x0, 0xffffff0000000000, 0xffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffc000000, 0xffffdfc000, 0xebc000000ffffffc, 0xfffffc000000ffef, 0xffffffc000000f, 0xffffffc0000, 0xfc000000ffffffc0, 0xffffc000000fffff, 0xffffffc000000ff, 0xffffffc00000, 0x3ffffffc00, 0xf0000003f7fffffc, 0xffc000000fdfffff, 0xffff0000003f7fff, 0xfffffc000000fdff, 0xbf7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//1472 bytes
@@ -2322,7 +2322,7 @@ _IUA toTitleTable() { static _IUA t = [ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
}
-static if(size_t.sizeof == 4) {
+static if (size_t.sizeof == 4) {
//1536 bytes
enum lowerCaseTrieEntries = TrieEntry!(bool, 8, 4, 9)([ 0x0, 0x40, 0x80], [ 0x100, 0x80, 0x2000], [ 0x2020100, 0x4020302, 0x2020205, 0x2060202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000, 0x30002, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x50004, 0x30006, 0x30007, 0x30003, 0x30008, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x90003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0xa0003, 0xb0003, 0x30003, 0x3000c, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0xe000d, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x30003, 0x0, 0x0, 0x0, 0x7fffffe, 0x0, 0x4200400, 0x80000000, 0xff7fffff, 0xaaaaaaaa, 0x55aaaaaa, 0xaaaaab55, 0xd4aaaaaa, 0x4e243129, 0xe6512d2a, 0xb5555240, 0xaa29aaaa, 0xaaaaaaaa, 0x93faaaaa, 0xffffaa85, 0xffffffff, 0xffefffff, 0x1ffffff, 0x3, 0x1f, 0x0, 0x0, 0x20, 0x3c8a0000, 0x10000, 0xfffff000, 0xaae37fff, 0x192faaaa, 0x0, 0xffff0000, 0xffffffff, 0xaaaaaaaa, 0xaaaaa802, 0xaaaaaaaa, 0xaaaad554, 0xaaaaaaaa, 0xaaaaaaaa, 0xaa, 0x0, 0xfffffffe, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x0, 0x0, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xbfeaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x3f00ff, 0xff00ff, 0xff003f, 0x3fff00ff, 0xff00ff, 0x40df00ff, 0xcf00dc, 0xdc00ff, 0x0, 0x0, 0x0, 0x80020000, 0x1fff0000, 0x0, 0x0, 0x0, 0x8c400, 0x32108000, 0x43c0, 0xffff0000, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffff0000, 0x3ff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffff0000, 0x7fffffff, 0x3fda1562, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x8501a, 0xffffffff, 0x20bf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xaaaaaaaa, 0x2aaa, 0xaaaaaa, 0x0, 0x0, 0x0, 0x0, 0xaaabaaa8, 0xaaaaaaaa, 0x95ffaaaa, 0xa50aa, 0x2aa, 0x0, 0x7000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf8007f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7fffffe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffff00, 0xffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfc000000, 0xfffff, 0xffdfc000, 0xff, 0xffffffc, 0xebc00000, 0xffef, 0xfffffc00, 0xc000000f, 0xffffff, 0xfffc0000, 0xfff, 0xffffffc0, 0xfc000000, 0xfffff, 0xffffc000, 0xff, 0xffffffc, 0xffc00000, 0xffff, 0xfffffc00, 0x3f, 0xf7fffffc, 0xf0000003, 0xfdfffff, 0xffc00000, 0x3f7fff, 0xffff0000, 0xfdff, 0xfffffc00, 0xbf7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//1472 bytes
diff --git a/std/json.d b/std/json.d
index d7ff9f692..c440ebf99 100644
--- a/std/json.d
+++ b/std/json.d
@@ -337,16 +337,16 @@ struct JSONValue
private void assign(T)(T arg) @safe
{
- static if(is(T : typeof(null)))
+ static if (is(T : typeof(null)))
{
type_tag = JSON_TYPE.NULL;
}
- else static if(is(T : string))
+ else static if (is(T : string))
{
type_tag = JSON_TYPE.STRING;
store.str = arg;
}
- else static if(isSomeString!T) // issue 15884
+ else static if (isSomeString!T) // issue 15884
{
type_tag = JSON_TYPE.STRING;
// FIXME: std.array.array(Range) is not deduced as 'pure'
@@ -355,56 +355,56 @@ struct JSONValue
store.str = cast(immutable)(arg.byUTF!char.array);
}();
}
- else static if(is(T : bool))
+ else static if (is(T : bool))
{
type_tag = arg ? JSON_TYPE.TRUE : JSON_TYPE.FALSE;
}
- else static if(is(T : ulong) && isUnsigned!T)
+ else static if (is(T : ulong) && isUnsigned!T)
{
type_tag = JSON_TYPE.UINTEGER;
store.uinteger = arg;
}
- else static if(is(T : long))
+ else static if (is(T : long))
{
type_tag = JSON_TYPE.INTEGER;
store.integer = arg;
}
- else static if(isFloatingPoint!T)
+ else static if (isFloatingPoint!T)
{
type_tag = JSON_TYPE.FLOAT;
store.floating = arg;
}
- else static if(is(T : Value[Key], Key, Value))
+ else static if (is(T : Value[Key], Key, Value))
{
static assert(is(Key : string), "AA key must be string");
type_tag = JSON_TYPE.OBJECT;
- static if(is(Value : JSONValue)) {
+ static if (is(Value : JSONValue)) {
store.object = arg;
}
else
{
JSONValue[string] aa;
- foreach(key, value; arg)
+ foreach (key, value; arg)
aa[key] = JSONValue(value);
store.object = aa;
}
}
- else static if(isArray!T)
+ else static if (isArray!T)
{
type_tag = JSON_TYPE.ARRAY;
- static if(is(ElementEncodingType!T : JSONValue))
+ static if (is(ElementEncodingType!T : JSONValue))
{
store.array = arg;
}
else
{
JSONValue[] new_arg = new JSONValue[arg.length];
- foreach(i, e; arg)
+ foreach (i, e; arg)
new_arg[i] = JSONValue(e);
store.array = new_arg;
}
}
- else static if(is(T : JSONValue))
+ else static if (is(T : JSONValue))
{
type_tag = arg.type;
store = arg.store;
@@ -415,17 +415,17 @@ struct JSONValue
}
}
- private void assignRef(T)(ref T arg) if(isStaticArray!T)
+ private void assignRef(T)(ref T arg) if (isStaticArray!T)
{
type_tag = JSON_TYPE.ARRAY;
- static if(is(ElementEncodingType!T : JSONValue))
+ static if (is(ElementEncodingType!T : JSONValue))
{
store.array = arg;
}
else
{
JSONValue[] new_arg = new JSONValue[arg.length];
- foreach(i, e; arg)
+ foreach (i, e; arg)
new_arg[i] = JSONValue(e);
store.array = new_arg;
}
@@ -443,12 +443,12 @@ struct JSONValue
* and $(D K) i.e. a JSON object, any array or $(D bool). The type will
* be set accordingly.
*/
- this(T)(T arg) if(!isStaticArray!T)
+ this(T)(T arg) if (!isStaticArray!T)
{
assign(arg);
}
/// Ditto
- this(T)(ref T arg) if(isStaticArray!T)
+ this(T)(ref T arg) if (isStaticArray!T)
{
assignRef(arg);
}
@@ -471,12 +471,12 @@ struct JSONValue
assert(j.type == JSON_TYPE.OBJECT);
}
- void opAssign(T)(T arg) if(!isStaticArray!T && !is(T : JSONValue))
+ void opAssign(T)(T arg) if (!isStaticArray!T && !is(T : JSONValue))
{
assign(arg);
}
- void opAssign(T)(ref T arg) if(isStaticArray!T)
+ void opAssign(T)(ref T arg) if (isStaticArray!T)
{
assignRef(arg);
}
@@ -560,11 +560,11 @@ struct JSONValue
JSONValue opBinary(string op : "~", T)(T arg) @safe
{
auto a = this.arrayNoRef;
- static if(isArray!T)
+ static if (isArray!T)
{
return JSONValue(a ~ JSONValue(arg).arrayNoRef);
}
- else static if(is(T : JSONValue))
+ else static if (is(T : JSONValue))
{
return JSONValue(a ~ arg.arrayNoRef);
}
@@ -577,11 +577,11 @@ struct JSONValue
void opOpAssign(string op : "~", T)(T arg) @safe
{
auto a = this.arrayNoRef;
- static if(isArray!T)
+ static if (isArray!T)
{
a ~= JSONValue(arg).arrayNoRef;
}
- else static if(is(T : JSONValue))
+ else static if (is(T : JSONValue))
{
a ~= arg.arrayNoRef;
}
@@ -653,10 +653,10 @@ struct JSONValue
{
int result;
- foreach(size_t index, ref value; array)
+ foreach (size_t index, ref value; array)
{
result = dg(index, value);
- if(result)
+ if (result)
break;
}
@@ -670,10 +670,10 @@ struct JSONValue
"JSONValue is not an object");
int result;
- foreach(string key, ref value; object)
+ foreach (string key, ref value; object)
{
result = dg(key, value);
- if(result)
+ if (result)
break;
}
@@ -707,7 +707,7 @@ Params:
options = enable decoding string representations of NaN/Inf as float values
*/
JSONValue parseJSON(T)(T json, int maxDepth = -1, JSONOptions options = JSONOptions.none)
-if(isInputRange!T)
+if (isInputRange!T)
{
import std.ascii : isWhite, isDigit, isHexDigit, toUpper, toLower;
import std.utf : toUTF8;
@@ -715,7 +715,7 @@ if(isInputRange!T)
JSONValue root;
root.type_tag = JSON_TYPE.NULL;
- if(json.empty) return root;
+ if (json.empty) return root;
int depth = -1;
dchar next = 0;
@@ -732,7 +732,7 @@ if(isInputRange!T)
dchar c = json.front;
json.popFront();
- if(c == '\n')
+ if (c == '\n')
{
line++;
pos = 0;
@@ -747,9 +747,9 @@ if(isInputRange!T)
dchar peekChar()
{
- if(!next)
+ if (!next)
{
- if(json.empty) return '\0';
+ if (json.empty) return '\0';
next = popChar();
}
return next;
@@ -757,15 +757,15 @@ if(isInputRange!T)
void skipWhitespace()
{
- while(isWhite(peekChar())) next = 0;
+ while (isWhite(peekChar())) next = 0;
}
dchar getChar(bool SkipWhitespace = false)()
{
- static if(SkipWhitespace) skipWhitespace();
+ static if (SkipWhitespace) skipWhitespace();
dchar c;
- if(next)
+ if (next)
{
c = next;
next = 0;
@@ -778,20 +778,20 @@ if(isInputRange!T)
void checkChar(bool SkipWhitespace = true, bool CaseSensitive = true)(char c)
{
- static if(SkipWhitespace) skipWhitespace();
+ static if (SkipWhitespace) skipWhitespace();
auto c2 = getChar();
- static if(!CaseSensitive) c2 = toLower(c2);
+ static if (!CaseSensitive) c2 = toLower(c2);
- if(c2 != c) error(text("Found '", c2, "' when expecting '", c, "'."));
+ if (c2 != c) error(text("Found '", c2, "' when expecting '", c, "'."));
}
bool testChar(bool SkipWhitespace = true, bool CaseSensitive = true)(char c)
{
- static if(SkipWhitespace) skipWhitespace();
+ static if (SkipWhitespace) skipWhitespace();
auto c2 = peekChar();
static if (!CaseSensitive) c2 = toLower(c2);
- if(c2 != c) return false;
+ if (c2 != c) return false;
getChar();
return true;
@@ -802,7 +802,7 @@ if(isInputRange!T)
auto str = appender!string();
Next:
- switch(peekChar())
+ switch (peekChar())
{
case '"':
getChar();
@@ -811,7 +811,7 @@ if(isInputRange!T)
case '\\':
getChar();
auto c = getChar();
- switch(c)
+ switch (c)
{
case '"': str.put('"'); break;
case '\\': str.put('\\'); break;
@@ -823,10 +823,10 @@ if(isInputRange!T)
case 't': str.put('\t'); break;
case 'u':
dchar val = 0;
- foreach_reverse(i; 0 .. 4)
+ foreach_reverse (i; 0 .. 4)
{
auto hex = toUpper(getChar());
- if(!isHexDigit(hex)) error("Expecting hex character");
+ if (!isHexDigit(hex)) error("Expecting hex character");
val += (isDigit(hex) ? hex - '0' : hex - ('A' - 10)) << (4 * i);
}
char[4] buf;
@@ -848,7 +848,7 @@ if(isInputRange!T)
}
bool tryGetSpecialFloat(string str, out double val) {
- switch(str) {
+ switch (str) {
case JSONFloatLiteral.nan:
val = double.nan;
return true;
@@ -867,14 +867,14 @@ if(isInputRange!T)
{
depth++;
- if(maxDepth != -1 && depth > maxDepth) error("Nesting too deep.");
+ if (maxDepth != -1 && depth > maxDepth) error("Nesting too deep.");
auto c = getChar!true();
- switch(c)
+ switch (c)
{
case '{':
- if(testChar('}'))
+ if (testChar('}'))
{
value.object = null;
break;
@@ -890,14 +890,14 @@ if(isInputRange!T)
parseValue(member);
obj[name] = member;
}
- while(testChar(','));
+ while (testChar(','));
value.object = obj;
checkChar('}');
break;
case '[':
- if(testChar(']'))
+ if (testChar(']'))
{
value.type_tag = JSON_TYPE.ARRAY;
break;
@@ -910,7 +910,7 @@ if(isInputRange!T)
parseValue(element);
arr ~= element;
}
- while(testChar(','));
+ while (testChar(','));
checkChar(']');
value.array = arr;
@@ -939,18 +939,18 @@ if(isInputRange!T)
void readInteger()
{
- if(!isDigit(c)) error("Digit expected");
+ if (!isDigit(c)) error("Digit expected");
Next: number.put(c);
- if(isDigit(peekChar()))
+ if (isDigit(peekChar()))
{
c = getChar();
goto Next;
}
}
- if(c == '-')
+ if (c == '-')
{
number.put('-');
c = getChar();
@@ -959,25 +959,25 @@ if(isInputRange!T)
readInteger();
- if(testChar('.'))
+ if (testChar('.'))
{
isFloat = true;
number.put('.');
c = getChar();
readInteger();
}
- if(testChar!(false, false)('e'))
+ if (testChar!(false, false)('e'))
{
isFloat = true;
number.put('e');
- if(testChar('+')) number.put('+');
- else if(testChar('-')) number.put('-');
+ if (testChar('+')) number.put('+');
+ else if (testChar('-')) number.put('-');
c = getChar();
readInteger();
}
string data = number.data;
- if(isFloat)
+ if (isFloat)
{
value.type_tag = JSON_TYPE.FLOAT;
value.store.floating = parse!double(data);
@@ -1073,7 +1073,7 @@ Params:
options = enable decoding string representations of NaN/Inf as float values
*/
JSONValue parseJSON(T)(T json, JSONOptions options)
-if(isInputRange!T)
+if (isInputRange!T)
{
return parseJSON!T(json, -1, options);
}
@@ -1105,7 +1105,7 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
foreach (dchar c; str)
{
- switch(c)
+ switch (c)
{
case '"': json.put("\\\""); break;
case '\\': json.put("\\\\"); break;
@@ -1128,13 +1128,13 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
{
void putTabs(ulong additionalIndent = 0)
{
- if(pretty)
- foreach(i; 0 .. indentLevel + additionalIndent)
+ if (pretty)
+ foreach (i; 0 .. indentLevel + additionalIndent)
json.put(" ");
}
void putEOL()
{
- if(pretty)
+ if (pretty)
json.put('\n');
}
void putCharAndEOL(char ch)
@@ -1143,11 +1143,11 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
putEOL();
}
- final switch(value.type)
+ final switch (value.type)
{
case JSON_TYPE.OBJECT:
auto obj = value.objectNoRef;
- if(!obj.length)
+ if (!obj.length)
{
json.put("{}");
}
@@ -1161,13 +1161,13 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
foreach (name; names)
{
auto member = obj[name];
- if(!first)
+ if (!first)
putCharAndEOL(',');
first = false;
putTabs(1);
toString(name);
json.put(':');
- if(pretty)
+ if (pretty)
json.put(' ');
toValue(member, indentLevel + 1);
}
@@ -1195,7 +1195,7 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
case JSON_TYPE.ARRAY:
auto arr = value.arrayNoRef;
- if(arr.empty)
+ if (arr.empty)
{
json.put("[]");
}
@@ -1204,7 +1204,7 @@ string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions o
putCharAndEOL('[');
foreach (i, el; arr)
{
- if(i)
+ if (i)
putCharAndEOL(',');
putTabs(1);
toValue(el, indentLevel + 1);
@@ -1316,7 +1316,7 @@ class JSONException : Exception
{
this(string msg, int line = 0, int pos = 0) pure nothrow @safe
{
- if(line)
+ if (line)
super(text(msg, " (Line ", line, ":", pos, ")"));
else
super(msg);
@@ -1366,7 +1366,7 @@ unittest
assert("key" in cjv);
assertThrown!JSONException(cjv["notAnElement"]);
- foreach(string key, value; jv)
+ foreach (string key, value; jv)
{
static assert(is(typeof(value) == JSONValue));
assert(key == "key");
@@ -1379,7 +1379,7 @@ unittest
assert(jv.type == JSON_TYPE.ARRAY);
assertNotThrown(jv.array);
assertNotThrown(jv[2]);
- foreach(size_t index, value; jv)
+ foreach (size_t index, value; jv)
{
static assert(is(typeof(value) == JSONValue));
assert(value.type == JSON_TYPE.INTEGER);
diff --git a/std/math.d b/std/math.d
index 1ec7b36d1..71c7adc9b 100644
--- a/std/math.d
+++ b/std/math.d
@@ -163,7 +163,7 @@ version(unittest)
{
import core.stdc.stdio;
- static if(real.sizeof > double.sizeof)
+ static if (real.sizeof > double.sizeof)
enum uint useDigits = 16;
else
enum uint useDigits = 15;
@@ -580,7 +580,7 @@ auto conj(Num)(Num z) @safe pure nothrow @nogc
{
//FIXME
//Issue 14206
- static if(is(Num* : const(cdouble*)))
+ static if (is(Num* : const(cdouble*)))
return cast(cdouble) conj(cast(creal)z);
else
return z.re - z.im*1fi;
@@ -2197,7 +2197,7 @@ unittest
unittest
{
FloatingPointControl ctrl;
- if(FloatingPointControl.hasExceptionTraps)
+ if (FloatingPointControl.hasExceptionTraps)
ctrl.disableExceptions(FloatingPointControl.allExceptions);
ctrl.rounding = FloatingPointControl.roundToNearest;
@@ -2359,11 +2359,11 @@ creal expi(real y) @trusted pure nothrow @nogc
* )
*/
T frexp(T)(const T value, out int exp) @trusted pure nothrow @nogc
- if(isFloatingPoint!T)
+ if (isFloatingPoint!T)
{
Unqual!T vf = value;
ushort* vu = cast(ushort*)&vf;
- static if(is(Unqual!T == float))
+ static if (is(Unqual!T == float))
int* vi = cast(int*)&vf;
else
long* vl = cast(long*)&vf;
@@ -2576,7 +2576,7 @@ unittest
tuple(-T.nan, -T.nan, int.min),
];
- foreach(elem; vals)
+ foreach (elem; vals)
{
T x = elem[0];
T e = elem[1];
@@ -2596,7 +2596,7 @@ unittest
[T.min_normal, .5, -16381],
[T.min_normal/2.0L, .5, -16382] // subnormal
];
- foreach(elem; extendedvals)
+ foreach (elem; extendedvals)
{
T x = elem[0];
T e = elem[1];
@@ -2640,7 +2640,7 @@ unittest
* )
*/
int ilogb(T)(const T x) @trusted pure nothrow @nogc
- if(isFloatingPoint!T)
+ if (isFloatingPoint!T)
{
alias F = floatTraits!T;
@@ -2649,7 +2649,7 @@ int ilogb(T)(const T x) @trusted pure nothrow @nogc
T rv;
ushort[T.sizeof/2] vu;
uint[T.sizeof/4] vui;
- static if(T.sizeof >= 8)
+ static if (T.sizeof >= 8)
ulong[T.sizeof/8] vul;
}
floatBits y = void;
@@ -2780,7 +2780,7 @@ int ilogb(T)(const T x) @trusted pure nothrow @nogc
}
/// ditto
int ilogb(T)(const T x) @safe pure nothrow @nogc
- if(isIntegral!T && isUnsigned!T)
+ if (isIntegral!T && isUnsigned!T)
{
if (x == 0)
return FP_ILOGB0;
@@ -2792,7 +2792,7 @@ int ilogb(T)(const T x) @safe pure nothrow @nogc
}
/// ditto
int ilogb(T)(const T x) @safe pure nothrow @nogc
- if(isIntegral!T && isSigned!T)
+ if (isIntegral!T && isSigned!T)
{
// Note: abs(x) can not be used because the return type is not Unsigned and
// the return value would be wrong for x == int.min
@@ -2826,7 +2826,7 @@ alias FP_ILOGBNAN = core.stdc.math.FP_ILOGBNAN;
T( 0.123 , -4 ),
];
- foreach(elem; vals)
+ foreach (elem; vals)
{
assert(ilogb(elem[0]) == elem[1]);
}
@@ -2879,7 +2879,7 @@ float ldexp(float n, int exp) @safe pure nothrow @nogc { return ldexp(cast(real)
@nogc @safe pure nothrow unittest
{
import std.meta;
- foreach(T; AliasSeq!(float, double, real))
+ foreach (T; AliasSeq!(float, double, real))
{
T r;
@@ -3048,9 +3048,9 @@ real log(real x) @safe pure nothrow @nogc
// Logarithm using log(x) = z + z^^3 P(z) / Q(z),
// where z = 2(x - 1)/(x + 1)
- if((exp > 2) || (exp < -2))
+ if ((exp > 2) || (exp < -2))
{
- if(x < SQRT1_2)
+ if (x < SQRT1_2)
{ // 2(2x - 1)/(2x + 1)
exp -= 1;
z = x - 0.5;
@@ -3179,9 +3179,9 @@ real log10(real x) @safe pure nothrow @nogc
// Logarithm using log(x) = z + z^^3 P(z) / Q(z),
// where z = 2(x - 1)/(x + 1)
- if((exp > 2) || (exp < -2))
+ if ((exp > 2) || (exp < -2))
{
- if(x < SQRT1_2)
+ if (x < SQRT1_2)
{ // 2(2x - 1)/(2x + 1)
exp -= 1;
z = x - 0.5;
@@ -3341,9 +3341,9 @@ real log2(real x) @safe pure nothrow @nogc
// Logarithm using log(x) = z + z^^3 P(z) / Q(z),
// where z = 2(x - 1)/(x + 1)
- if((exp > 2) || (exp < -2))
+ if ((exp > 2) || (exp < -2))
{
- if(x < SQRT1_2)
+ if (x < SQRT1_2)
{ // 2(2x - 1)/(2x + 1)
exp -= 1;
z = x - 0.5;
@@ -4797,7 +4797,7 @@ unittest
{
assert(FloatingPointControl.rounding
== FloatingPointControl.roundToNearest);
- if(FloatingPointControl.hasExceptionTraps)
+ if (FloatingPointControl.hasExceptionTraps)
assert(FloatingPointControl.enabledExceptions == 0);
}
@@ -4813,7 +4813,7 @@ unittest
}
ensureDefaults();
- if(FloatingPointControl.hasExceptionTraps)
+ if (FloatingPointControl.hasExceptionTraps)
{
FloatingPointControl ctrl;
ctrl.enableExceptions(FloatingPointControl.divByZeroException
@@ -4896,7 +4896,7 @@ bool isNaN(X)(X x) @nogc @trusted pure nothrow
{
import std.meta;
- foreach(T; AliasSeq!(float, double, real))
+ foreach (T; AliasSeq!(float, double, real))
{
// CTFE-able tests
assert(isNaN(T.init));
@@ -6055,7 +6055,7 @@ typeof(Unqual!(F).init * Unqual!(G).init) pow(F, G)(F x, G n) @nogc @trusted pur
/**Computes integer to floating point powers.*/
real pow(I, F)(I x, F y) @nogc @trusted pure nothrow
- if(isIntegral!I && isFloatingPoint!F)
+ if (isIntegral!I && isFloatingPoint!F)
{
return pow(cast(real) x, cast(Unqual!F) y);
}
@@ -6254,27 +6254,27 @@ Unqual!(Largest!(F, G)) pow(F, G)(F x, G y) @nogc @trusted pure nothrow
// Result is real only if y is an integer
// Check for a non-zero fractional part
enum maxOdd = pow(2.0L, real.mant_dig) - 1.0L;
- static if(maxOdd > ulong.max)
+ static if (maxOdd > ulong.max)
{
// Generic method, for any FP type
- if(floor(y) != y)
+ if (floor(y) != y)
return sqrt(x); // Complex result -- create a NaN
const hy = ldexp(y, -1);
- if(floor(hy) != hy)
+ if (floor(hy) != hy)
sign = -1.0;
}
else
{
// Much faster, if ulong has enough precision
const absY = fabs(y);
- if(absY <= maxOdd)
+ if (absY <= maxOdd)
{
const uy = cast(ulong)absY;
- if(uy != absY)
+ if (uy != absY)
return sqrt(x); // Complex result -- create a NaN
- if(uy & 1)
+ if (uy & 1)
sign = -1.0;
}
}
@@ -6680,7 +6680,7 @@ in
}
body
{
- static if(is(Unqual!T2 == real))
+ static if (is(Unqual!T2 == real))
{
return polyImpl(x, A);
}
@@ -6732,7 +6732,7 @@ private real polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
{
version (D_InlineAsm_X86)
{
- if(__ctfe)
+ if (__ctfe)
{
return polyImplBase(x, A);
}
@@ -7465,7 +7465,7 @@ T nextPow2(T)(const T val) if (isFloatingPoint!T)
{
import std.meta: AliasSeq;
- foreach(T; AliasSeq!(float, double, real))
+ foreach (T; AliasSeq!(float, double, real))
{
enum T subNormal = T.min_normal / 2;
@@ -7584,7 +7584,7 @@ T truncPow2(T)(const T val) if (isFloatingPoint!T)
{
import std.meta: AliasSeq;
- foreach(T; AliasSeq!(float, double, real))
+ foreach (T; AliasSeq!(float, double, real))
{
assert(truncPow2(T(0.0)) == 0.0);
diff --git a/std/meta.d b/std/meta.d
index 1872d238a..ad11d7443 100644
--- a/std/meta.d
+++ b/std/meta.d
@@ -757,7 +757,7 @@ template predicate must be instantiable with all the given items.
*/
template anySatisfy(alias F, T...)
{
- static if(T.length == 0)
+ static if (T.length == 0)
{
enum anySatisfy = false;
}
@@ -1060,7 +1060,7 @@ unittest
unittest
{
enum REF = [0, 1, 2, 3];
- foreach(I, V; aliasSeqOf!([0, 1, 2, 3]))
+ foreach (I, V; aliasSeqOf!([0, 1, 2, 3]))
{
static assert(V == I);
static assert(V == REF[I]);
@@ -1086,7 +1086,7 @@ unittest
unittest
{
enum REF = "日本語"d;
- foreach(I, V; aliasSeqOf!"日本語"c)
+ foreach (I, V; aliasSeqOf!"日本語"c)
{
static assert(V == REF[I]);
}
diff --git a/std/net/curl.d b/std/net/curl.d
index 9c6af6609..11a5e7be1 100644
--- a/std/net/curl.d
+++ b/std/net/curl.d
@@ -3748,7 +3748,7 @@ struct SMTP
{
assert(!recipients.empty, "Recipient must not be empty");
curl_slist* recipients_list = null;
- foreach(recipient; recipients)
+ foreach (recipient; recipients)
{
recipients_list =
Curl.curl.slist_append(recipients_list,
@@ -3999,7 +3999,7 @@ struct Curl
interleavefunction, chunk_data, chunk_bgn_function,
chunk_end_function, fnmatch_data, fnmatch_function, cookiejar, postfields);
- foreach(option; tt)
+ foreach (option; tt)
copy.clear(option);
}
diff --git a/std/numeric.d b/std/numeric.d
index 4a6ea7844..8b619aefe 100644
--- a/std/numeric.d
+++ b/std/numeric.d
@@ -161,14 +161,14 @@ private:
// get the correct unsigned bitfield type to support > 32 bits
template uType(uint bits)
{
- static if(bits <= size_t.sizeof*8) alias uType = size_t;
+ static if (bits <= size_t.sizeof*8) alias uType = size_t;
else alias uType = ulong ;
}
// get the correct signed bitfield type to support > 32 bits
template sType(uint bits)
{
- static if(bits <= ptrdiff_t.sizeof*8-1) alias sType = ptrdiff_t;
+ static if (bits <= ptrdiff_t.sizeof*8-1) alias sType = ptrdiff_t;
else alias sType = long;
}
@@ -243,7 +243,7 @@ private:
// Convert denormalized form to normalized form
((flags&Flags.allowDenorm) && exp==0))
{
- if(sig > 0)
+ if (sig > 0)
{
import core.bitop : bsr;
auto shift2 = precision - bsr(sig);
@@ -465,7 +465,7 @@ public:
static if (flags & Flags.signed)
value.sign = 0;
value.exponent = 1;
- static if(flags&Flags.storeNormalized)
+ static if (flags&Flags.storeNormalized)
value.significand = 0;
else
value.significand = cast(T_sig) 1uL << (precision - 1);
@@ -792,17 +792,17 @@ public:
*/
T findRoot(T, DF, DT)(scope DF f, in T a, in T b,
scope DT tolerance) //= (T a, T b) => false)
- if(
+ if (
isFloatingPoint!T &&
is(typeof(tolerance(T.init, T.init)) : bool) &&
is(typeof(f(T.init)) == R, R) && isFloatingPoint!R
)
{
immutable fa = f(a);
- if(fa == 0)
+ if (fa == 0)
return a;
immutable fb = f(b);
- if(fb == 0)
+ if (fb == 0)
return b;
immutable r = findRoot(f, a, b, fa, fb, tolerance);
// Return the first value if it is smaller or NaN
@@ -850,7 +850,7 @@ T findRoot(T, DF)(scope DF f, in T a, in T b)
*/
Tuple!(T, T, R, R) findRoot(T, R, DF, DT)(scope DF f, in T ax, in T bx, in R fax, in R fbx,
scope DT tolerance) // = (T a, T b) => false)
- if(
+ if (
isFloatingPoint!T &&
is(typeof(tolerance(T.init, T.init)) : bool) &&
is(typeof(f(T.init)) == R) && isFloatingPoint!R
@@ -1434,7 +1434,7 @@ euclideanDistance(Range1, Range2, F)(Range1 a, Range2 b, F limit)
unittest
{
import std.meta : AliasSeq;
- foreach(T; AliasSeq!(double, const double, immutable double))
+ foreach (T; AliasSeq!(double, const double, immutable double))
{
T[] a = [ 1.0, 2.0, ];
T[] b = [ 4.0, 6.0, ];
@@ -1524,7 +1524,7 @@ dotProduct(F1, F2)(in F1[] avector, in F2[] bvector)
unittest
{
import std.meta : AliasSeq;
- foreach(T; AliasSeq!(double, const double, immutable double))
+ foreach (T; AliasSeq!(double, const double, immutable double))
{
T[] a = [ 1.0, 2.0, ];
T[] b = [ 4.0, 6.0, ];
@@ -1568,7 +1568,7 @@ cosineSimilarity(Range1, Range2)(Range1 a, Range2 b)
unittest
{
import std.meta : AliasSeq;
- foreach(T; AliasSeq!(double, const double, immutable double))
+ foreach (T; AliasSeq!(double, const double, immutable double))
{
T[] a = [ 1.0, 2.0, ];
T[] b = [ 4.0, 3.0, ];
@@ -1718,7 +1718,7 @@ if (isInputRange!Range &&
unittest
{
import std.meta : AliasSeq;
- foreach(T; AliasSeq!(double, const double, immutable double))
+ foreach (T; AliasSeq!(double, const double, immutable double))
{
T[] p = [ 0.0, 0, 0, 1 ];
assert(entropy(p) == 0);
@@ -2410,7 +2410,7 @@ private:
auto recurseRange = range;
recurseRange.doubleSteps();
- if(buf.length > 4)
+ if (buf.length > 4)
{
fftImpl(recurseRange, buf[0..$ / 2]);
recurseRange.popHalf();
@@ -2445,7 +2445,7 @@ private:
// Converts odd indices of range to the imaginary components of
// a range half the size. The even indices become the real components.
- static if(isArray!R && isFloatingPoint!E)
+ static if (isArray!R && isFloatingPoint!E)
{
// Then the memory layout of complex numbers provides a dirt
// cheap way to convert. This is a common case, so take advantage.
@@ -2627,7 +2627,7 @@ private:
* inefficient, but having all the lookups be next to each other in
* memory at every level of iteration is a huge win performance-wise.
*/
- if(size == 0)
+ if (size == 0)
{
return;
}
@@ -2732,7 +2732,7 @@ public:
* property that can be both read and written and are floating point numbers.
*/
void fft(Ret, R)(R range, Ret buf) const
- if(isRandomAccessRange!Ret && isComplexLike!(ElementType!Ret) && hasSlicing!Ret)
+ if (isRandomAccessRange!Ret && isComplexLike!(ElementType!Ret) && hasSlicing!Ret)
{
enforce(buf.length == range.length);
enforceSize(range);
diff --git a/std/parallelism.d b/std/parallelism.d
index e508bea48..df7f75e50 100644
--- a/std/parallelism.d
+++ b/std/parallelism.d
@@ -274,11 +274,11 @@ unittest
// since they can't read global state.
private template isSafeReturn(T)
{
- static if(!hasUnsharedAliasing!(T.ReturnType))
+ static if (!hasUnsharedAliasing!(T.ReturnType))
{
enum isSafeReturn = true;
}
- else static if(T.isPure)
+ else static if (T.isPure)
{
enum isSafeReturn = true;
}
@@ -309,7 +309,7 @@ private template AliasReturn(alias fun, T...)
// and won't work w/ private.
template reduceAdjoin(functions...)
{
- static if(functions.length == 1)
+ static if (functions.length == 1)
{
alias reduceAdjoin = binaryFun!(functions[0]);
}
@@ -319,7 +319,7 @@ template reduceAdjoin(functions...)
{
alias funs = staticMap!(binaryFun, functions);
- foreach(i, Unused; typeof(lhs.expand))
+ foreach (i, Unused; typeof(lhs.expand))
{
lhs.expand[i] = funs[i](lhs.expand[i], rhs);
}
@@ -331,7 +331,7 @@ template reduceAdjoin(functions...)
private template reduceFinish(functions...)
{
- static if(functions.length == 1)
+ static if (functions.length == 1)
{
alias reduceFinish = binaryFun!(functions[0]);
}
@@ -341,7 +341,7 @@ private template reduceFinish(functions...)
{
alias funs = staticMap!(binaryFun, functions);
- foreach(i, Unused; typeof(lhs.expand))
+ foreach (i, Unused; typeof(lhs.expand))
{
lhs.expand[i] = funs[i](lhs.expand[i], rhs.expand[i]);
}
@@ -382,9 +382,9 @@ private struct AbstractTask
bool done() @property
{
- if(atomicReadUbyte(taskStatus) == TaskStatus.done)
+ if (atomicReadUbyte(taskStatus) == TaskStatus.done)
{
- if(exception)
+ if (exception)
{
throw exception;
}
@@ -444,11 +444,11 @@ struct Task(alias fun, Args...)
import std.algorithm.internal : addressOf;
Task* myCastedTask = cast(typeof(this)*) myTask;
- static if(is(ReturnType == void))
+ static if (is(ReturnType == void))
{
fun(myCastedTask._args);
}
- else static if(is(typeof(addressOf(fun(myCastedTask._args)))))
+ else static if (is(typeof(addressOf(fun(myCastedTask._args)))))
{
myCastedTask.returnVal = addressOf(fun(myCastedTask._args));
}
@@ -467,7 +467,7 @@ struct Task(alias fun, Args...)
The arguments the function was called with. Changes to $(D out) and
$(D ref) arguments will be visible here.
*/
- static if(__traits(isSame, fun, run))
+ static if (__traits(isSame, fun, run))
{
alias args = _args[1..$];
}
@@ -480,9 +480,9 @@ struct Task(alias fun, Args...)
// The purpose of this code is to decide whether functions whose
// return values have unshared aliasing can be executed via
// TaskPool from @safe code. See isSafeReturn.
- static if(__traits(isSame, fun, run))
+ static if (__traits(isSame, fun, run))
{
- static if(isFunctionPointer!(_args[0]))
+ static if (isFunctionPointer!(_args[0]))
{
private enum bool isPure =
functionAttributes!(Args[0]) & FunctionAttribute.pure_;
@@ -511,9 +511,9 @@ struct Task(alias fun, Args...)
*/
alias ReturnType = typeof(fun(_args));
- static if(!is(ReturnType == void))
+ static if (!is(ReturnType == void))
{
- static if(is(typeof(&fun(_args))))
+ static if (is(typeof(&fun(_args))))
{
// Ref return.
ReturnType* returnVal;
@@ -540,7 +540,7 @@ struct Task(alias fun, Args...)
enforce(this.pool !is null, "Job not submitted yet.");
}
- static if(Args.length > 0)
+ static if (Args.length > 0)
{
private this(Args args)
{
@@ -549,11 +549,11 @@ struct Task(alias fun, Args...)
}
// Work around DMD bug 6588, allow immutable elements.
- static if(allSatisfy!(isAssignable, Args))
+ static if (allSatisfy!(isAssignable, Args))
{
typeof(this) opAssign(typeof(this) rhs)
{
- foreach(i, Type; typeof(this.tupleof))
+ foreach (i, Type; typeof(this.tupleof))
{
this.tupleof[i] = rhs.tupleof[i];
}
@@ -584,14 +584,14 @@ struct Task(alias fun, Args...)
this.pool.tryDeleteExecute(basePtr);
- while(atomicReadUbyte(this.taskStatus) != TaskStatus.done) {}
+ while (atomicReadUbyte(this.taskStatus) != TaskStatus.done) {}
- if(exception)
+ if (exception)
{
throw exception;
}
- static if(!is(ReturnType == void))
+ static if (!is(ReturnType == void))
{
return fixRef(this.returnVal);
}
@@ -611,9 +611,9 @@ struct Task(alias fun, Args...)
enforcePool();
this.pool.tryDeleteExecute(basePtr);
- if(done)
+ if (done)
{
- static if(is(ReturnType == void))
+ static if (is(ReturnType == void))
{
return;
}
@@ -626,17 +626,17 @@ struct Task(alias fun, Args...)
pool.waiterLock();
scope(exit) pool.waiterUnlock();
- while(atomicReadUbyte(this.taskStatus) != TaskStatus.done)
+ while (atomicReadUbyte(this.taskStatus) != TaskStatus.done)
{
pool.waitUntilCompletion();
}
- if(exception)
+ if (exception)
{
throw exception;
}
- static if(!is(ReturnType == void))
+ static if (!is(ReturnType == void))
{
return fixRef(this.returnVal);
}
@@ -656,11 +656,11 @@ struct Task(alias fun, Args...)
enforcePool();
this.pool.tryDeleteExecute(basePtr);
- while(true)
+ while (true)
{
- if(done) // done() implicitly checks for exceptions.
+ if (done) // done() implicitly checks for exceptions.
{
- static if(is(ReturnType == void))
+ static if (is(ReturnType == void))
{
return;
}
@@ -682,7 +682,7 @@ struct Task(alias fun, Args...)
}
- if(job !is null)
+ if (job !is null)
{
version(verboseUnittest)
@@ -692,9 +692,9 @@ struct Task(alias fun, Args...)
pool.doJob(job);
- if(done)
+ if (done)
{
- static if(is(ReturnType == void))
+ static if (is(ReturnType == void))
{
return;
}
@@ -749,7 +749,7 @@ struct Task(alias fun, Args...)
@safe ~this()
{
- if(isScoped && pool !is null && taskStatus != TaskStatus.done)
+ if (isScoped && pool !is null && taskStatus != TaskStatus.done)
{
yieldForce;
}
@@ -809,7 +809,7 @@ void main()
void parallelSort(T)(T[] data)
{
// Sort small subarrays serially.
- if(data.length < 100)
+ if (data.length < 100)
{
std.algorithm.sort(data);
return;
@@ -871,7 +871,7 @@ Notes: This function takes a non-scope delegate, meaning it can be
takes a scope delegate.
*/
auto task(F, Args...)(F delegateOrFp, Args args)
-if(is(typeof(delegateOrFp(args))) && !isSafeTask!F)
+if (is(typeof(delegateOrFp(args))) && !isSafeTask!F)
{
return new Task!(run, F, Args)(delegateOrFp, args);
}
@@ -898,7 +898,7 @@ identical to the non-@safe case, but safety introduces some restrictions:
*/
@trusted auto task(F, Args...)(F fun, Args args)
-if(is(typeof(fun(args))) && isSafeTask!F)
+if (is(typeof(fun(args))) && isSafeTask!F)
{
return new Task!(run, F, Args)(fun, args);
}
@@ -933,7 +933,7 @@ auto scopedTask(alias fun, Args...)(Args args)
/// Ditto
auto scopedTask(F, Args...)(scope F delegateOrFp, Args args)
-if(is(typeof(delegateOrFp(args))) && !isSafeTask!F)
+if (is(typeof(delegateOrFp(args))) && !isSafeTask!F)
{
auto ret = Task!(run, F, Args)(delegateOrFp, args);
ret.isScoped = true;
@@ -942,7 +942,7 @@ if(is(typeof(delegateOrFp(args))) && !isSafeTask!F)
/// Ditto
@trusted auto scopedTask(F, Args...)(F fun, Args args)
-if(is(typeof(fun(args))) && isSafeTask!F)
+if (is(typeof(fun(args))) && isSafeTask!F)
{
auto ret = Task!(run, F, Args)(fun, args);
ret.isScoped = true;
@@ -980,12 +980,12 @@ shared static ~this()
{
auto allThreads = Thread.getAll();
- foreach(thread; allThreads)
+ foreach (thread; allThreads)
{
auto pthread = cast(ParallelismThread) thread;
- if(pthread is null) continue;
+ if (pthread is null) continue;
auto pool = pthread.pool;
- if(!pool.isDaemon) continue;
+ if (!pool.isDaemon) continue;
pool.stop();
pthread.join();
}
@@ -1057,7 +1057,7 @@ private:
scope(exit)
{
- if(!isSingleTask)
+ if (!isSingleTask)
{
waiterLock();
scope(exit) waiterUnlock();
@@ -1109,12 +1109,12 @@ private:
// finish() is called with the blocking variable set to true.
void executeWorkLoop()
{
- while(atomicReadUbyte(status) != PoolState.stopNow)
+ while (atomicReadUbyte(status) != PoolState.stopNow)
{
AbstractTask* task = pop();
if (task is null)
{
- if(atomicReadUbyte(status) == PoolState.finishing)
+ if (atomicReadUbyte(status) == PoolState.finishing)
{
atomicSetUbyte(status, PoolState.stopNow);
return;
@@ -1133,7 +1133,7 @@ private:
queueLock();
scope(exit) queueUnlock();
auto ret = popNoSync();
- while(ret is null && status == PoolState.running)
+ while (ret is null && status == PoolState.running)
{
wait();
ret = popNoSync();
@@ -1148,7 +1148,7 @@ private:
* can try to delete this task from the pool after it's
* alreadly been deleted/popped.
*/
- if(returned !is null)
+ if (returned !is null)
{
assert(returned.next is null);
assert(returned.prev is null);
@@ -1156,7 +1156,7 @@ private:
}
body
{
- if(isSingleTask) return null;
+ if (isSingleTask) return null;
AbstractTask* returned = head;
if (head !is null)
@@ -1166,7 +1166,7 @@ private:
returned.next = null;
returned.taskStatus = TaskStatus.inProgress;
}
- if(head !is null)
+ if (head !is null)
{
head.prev = null;
}
@@ -1191,7 +1191,7 @@ private:
{
assert(tail.prev !is tail);
assert(tail.next is null, text(tail.prev, '\t', tail.next));
- if(tail.prev !is null)
+ if (tail.prev !is null)
{
assert(tail.prev.next is tail, text(tail.prev, '\t', tail.next));
}
@@ -1200,7 +1200,7 @@ private:
{
// Not using enforce() to save on function call overhead since this
// is a performance critical function.
- if(status != PoolState.running)
+ if (status != PoolState.running)
{
throw new Error(
"Cannot submit a new task to a pool after calling " ~
@@ -1226,7 +1226,7 @@ private:
void abstractPutGroupNoSync(AbstractTask* h, AbstractTask* t)
{
- if(status != PoolState.running)
+ if (status != PoolState.running)
{
throw new Error(
"Cannot submit a new task to a pool after calling " ~
@@ -1234,7 +1234,7 @@ private:
);
}
- if(head is null)
+ if (head is null)
{
head = h;
tail = t;
@@ -1251,9 +1251,9 @@ private:
void tryDeleteExecute(AbstractTask* toExecute)
{
- if(isSingleTask) return;
+ if (isSingleTask) return;
- if( !deleteItem(toExecute) )
+ if ( !deleteItem(toExecute) )
{
return;
}
@@ -1279,22 +1279,22 @@ private:
bool deleteItemNoSync(AbstractTask* item)
{
- if(item.taskStatus != TaskStatus.notStarted)
+ if (item.taskStatus != TaskStatus.notStarted)
{
return false;
}
item.taskStatus = TaskStatus.inProgress;
- if(item is head)
+ if (item is head)
{
// Make sure head gets set properly.
popNoSync();
return true;
}
- if(item is tail)
+ if (item is tail)
{
tail = tail.prev;
- if(tail !is null)
+ if (tail !is null)
{
tail.next = null;
}
@@ -1302,12 +1302,12 @@ private:
item.prev = null;
return true;
}
- if(item.next !is null)
+ if (item.next !is null)
{
assert(item.next.prev is item); // Check queue consistency.
item.next.prev = item.prev;
}
- if(item.prev !is null)
+ if (item.prev !is null)
{
assert(item.prev.next is item); // Check queue consistency.
item.prev.next = item.next;
@@ -1320,43 +1320,43 @@ private:
void queueLock()
{
assert(queueMutex);
- if(!isSingleTask) queueMutex.lock();
+ if (!isSingleTask) queueMutex.lock();
}
void queueUnlock()
{
assert(queueMutex);
- if(!isSingleTask) queueMutex.unlock();
+ if (!isSingleTask) queueMutex.unlock();
}
void waiterLock()
{
- if(!isSingleTask) waiterMutex.lock();
+ if (!isSingleTask) waiterMutex.lock();
}
void waiterUnlock()
{
- if(!isSingleTask) waiterMutex.unlock();
+ if (!isSingleTask) waiterMutex.unlock();
}
void wait()
{
- if(!isSingleTask) workerCondition.wait();
+ if (!isSingleTask) workerCondition.wait();
}
void notify()
{
- if(!isSingleTask) workerCondition.notify();
+ if (!isSingleTask) workerCondition.notify();
}
void notifyAll()
{
- if(!isSingleTask) workerCondition.notifyAll();
+ if (!isSingleTask) workerCondition.notifyAll();
}
void waitUntilCompletion()
{
- if(isSingleTask)
+ if (isSingleTask)
{
singleTaskThread.join();
}
@@ -1368,7 +1368,7 @@ private:
void notifyWaiters()
{
- if(!isSingleTask) waiterCondition.notifyAll();
+ if (!isSingleTask) waiterCondition.notifyAll();
}
// Private constructor for creating dummy pools that only have one thread,
@@ -1391,7 +1391,7 @@ private:
// running thread with specified priority
// See https://d.puremagic.com/issues/show_bug.cgi?id=8960
- /*if(priority != int.max)
+ /*if (priority != int.max)
{
singleTaskThread.priority = priority;
}*/
@@ -1402,7 +1402,7 @@ public:
// as public API.
size_t defaultWorkUnitSize(size_t rangeLen) const @safe pure nothrow
{
- if(this.size == 0)
+ if (this.size == 0)
{
return rangeLen;
}
@@ -1447,7 +1447,7 @@ public:
waiterCondition = new Condition(waiterMutex);
pool = new ParallelismThread[nWorkers];
- foreach(ref poolThread; pool)
+ foreach (ref poolThread; pool)
{
poolThread = new ParallelismThread(&startWorkLoop);
poolThread.pool = this;
@@ -1481,7 +1481,7 @@ public:
// returns by ref.
// Iterate over logs using work units of size 100.
- foreach(i, ref elem; taskPool.parallel(logs, 100))
+ foreach (i, ref elem; taskPool.parallel(logs, 100))
{
elem = log(i + 1.0);
}
@@ -1492,7 +1492,7 @@ public:
//
// Parallel foreach: 388 milliseconds
// Regular foreach: 619 milliseconds
- foreach(i, ref elem; taskPool.parallel(logs))
+ foreach (i, ref elem; taskPool.parallel(logs))
{
elem = log(i + 1.0);
}
@@ -1537,7 +1537,7 @@ public:
/// Ditto
ParallelForeach!R parallel(R)(R range)
{
- static if(hasLength!R)
+ static if (hasLength!R)
{
// Default work unit size is such that we would use 4x as many
// slots as are in this thread pool.
@@ -1639,14 +1639,14 @@ public:
rethrown. The order of the exception chaining is non-deterministic.
*/
auto amap(Args...)(Args args)
- if(isRandomAccessRange!(Args[0]))
+ if (isRandomAccessRange!(Args[0]))
{
alias fun = adjoin!(staticMap!(unaryFun, functions));
alias range = args[0];
immutable len = range.length;
- static if(
+ static if (
Args.length > 1 &&
randAssignable!(Args[$ - 1]) &&
is(MapType!(Args[0], functions) : ElementType!(Args[$ - 1]))
@@ -1659,7 +1659,7 @@ public:
text("Can't use a user supplied buffer that's the wrong ",
"size. (Expected :", len, " Got: ", buf.length));
}
- else static if(randAssignable!(Args[$ - 1]) && Args.length > 1)
+ else static if (randAssignable!(Args[$ - 1]) && Args.length > 1)
{
static assert(0, "Wrong buffer type.");
}
@@ -1670,9 +1670,9 @@ public:
alias Args2 = Args;
}
- if(!len) return buf;
+ if (!len) return buf;
- static if(isIntegral!(Args2[$ - 1]))
+ static if (isIntegral!(Args2[$ - 1]))
{
static assert(args2.length == 2);
auto workUnitSize = cast(size_t) args2[1];
@@ -1685,16 +1685,16 @@ public:
alias R = typeof(range);
- if(workUnitSize > len)
+ if (workUnitSize > len)
{
workUnitSize = len;
}
// Handle as a special case:
- if(size == 0)
+ if (size == 0)
{
size_t index = 0;
- foreach(elem; range)
+ foreach (elem; range)
{
emplaceRef(buf[index++], fun(elem));
}
@@ -1713,11 +1713,11 @@ public:
atomicStore(shouldContinue, false);
}
- while(atomicLoad(shouldContinue))
+ while (atomicLoad(shouldContinue))
{
immutable myUnitIndex = atomicOp!"+="(workUnitIndex, 1);
immutable start = workUnitSize * myUnitIndex;
- if(start >= len)
+ if (start >= len)
{
atomicStore(shouldContinue, false);
break;
@@ -1728,7 +1728,7 @@ public:
static if (hasSlicing!R)
{
auto subrange = range[start..end];
- foreach(i; start..end)
+ foreach (i; start..end)
{
emplaceRef(buf[i], fun(subrange.front));
subrange.popFront();
@@ -1736,7 +1736,7 @@ public:
}
else
{
- foreach(i; start..end)
+ foreach (i; start..end)
{
emplaceRef(buf[i], fun(range[i]));
}
@@ -1807,7 +1807,7 @@ public:
auto logs = taskPool.map!log10(nums);
double sum = 0;
- foreach(elem; logs)
+ foreach (elem; logs)
{
sum += elem;
}
@@ -1823,7 +1823,7 @@ public:
*/
auto
map(S)(S source, size_t bufSize = 100, size_t workUnitSize = size_t.max)
- if(isInputRange!S)
+ if (isInputRange!S)
{
enforce(workUnitSize == size_t.max || workUnitSize <= bufSize,
"Work unit size must be smaller than buffer size.");
@@ -1849,17 +1849,17 @@ public:
size_t bufPos;
bool lastTaskWaited;
- static if(isRandomAccessRange!S)
+ static if (isRandomAccessRange!S)
{
alias FromType = S;
void popSource()
{
- static if(__traits(compiles, source[0..source.length]))
+ static if (__traits(compiles, source[0..source.length]))
{
source = source[min(buf1.length, source.length)..source.length];
}
- else static if(__traits(compiles, source[0..$]))
+ else static if (__traits(compiles, source[0..$]))
{
source = source[min(buf1.length, source.length)..$];
}
@@ -1870,11 +1870,11 @@ public:
}
}
}
- else static if(bufferTrick)
+ else static if (bufferTrick)
{
// Make sure we don't have the buffer recycling overload of
// asyncBuf.
- static if(
+ static if (
is(typeof(source.source)) &&
isRoundRobin!(typeof(source.source))
)
@@ -1899,7 +1899,7 @@ public:
// being sent to map:
from = from[source.bufPos..$];
- static if(is(typeof(source._length)))
+ static if (is(typeof(source._length)))
{
source._length -= (from.length - source.bufPos);
}
@@ -1932,7 +1932,7 @@ public:
}
}
- static if(hasLength!S)
+ static if (hasLength!S)
{
size_t _length;
@@ -1944,7 +1944,7 @@ public:
this(S source, size_t bufSize, size_t workUnitSize, TaskPool pool)
{
- static if(bufferTrick)
+ static if (bufferTrick)
{
bufSize = source.buf1.length;
}
@@ -1952,7 +1952,7 @@ public:
buf1.length = bufSize;
buf2.length = bufSize;
- static if(!isRandomAccessRange!S)
+ static if (!isRandomAccessRange!S)
{
from.length = bufSize;
}
@@ -1962,7 +1962,7 @@ public:
this.source = source;
this.pool = pool;
- static if(hasLength!S)
+ static if (hasLength!S)
{
_length = source.length;
}
@@ -1975,7 +1975,7 @@ public:
// case.
E[] fillBuf(E[] buf)
{
- static if(isRandomAccessRange!S)
+ static if (isRandomAccessRange!S)
{
auto toMap = take(source, buf.length);
scope(success) popSource();
@@ -1988,10 +1988,10 @@ public:
buf = buf[0..min(buf.length, toMap.length)];
// Handle as a special case:
- if(pool.size == 0)
+ if (pool.size == 0)
{
size_t index = 0;
- foreach(elem; toMap)
+ foreach (elem; toMap)
{
buf[index++] = fun(elem);
}
@@ -2020,13 +2020,13 @@ public:
void doBufSwap()
{
- if(lastTaskWaited)
+ if (lastTaskWaited)
{
// Then the source is empty. Signal it here.
buf1 = null;
buf2 = null;
- static if(!isRandomAccessRange!S)
+ static if (!isRandomAccessRange!S)
{
from = null;
}
@@ -2038,7 +2038,7 @@ public:
buf1 = nextBufTask.yieldForce;
bufPos = 0;
- if(source.empty)
+ if (source.empty)
{
lastTaskWaited = true;
}
@@ -2056,19 +2056,19 @@ public:
void popFront()
{
- static if(hasLength!S)
+ static if (hasLength!S)
{
_length--;
}
bufPos++;
- if(bufPos >= buf1.length)
+ if (bufPos >= buf1.length)
{
doBufSwap();
}
}
- static if(std.range.isInfinite!S)
+ static if (std.range.isInfinite!S)
{
enum bool empty = false;
}
@@ -2115,7 +2115,7 @@ public:
double[][] matrix;
auto asyncReader = taskPool.asyncBuf(duped);
- foreach(line; asyncReader)
+ foreach (line; asyncReader)
{
auto ls = line.split("\t");
matrix ~= to!(double[])(ls);
@@ -2129,7 +2129,7 @@ public:
call to $(D popFront) or, if thrown during construction, simply
allowed to propagate to the caller.
*/
- auto asyncBuf(S)(S source, size_t bufSize = 100) if(isInputRange!S)
+ auto asyncBuf(S)(S source, size_t bufSize = 100) if (isInputRange!S)
{
static final class AsyncBuf
{
@@ -2147,7 +2147,7 @@ public:
size_t bufPos;
bool lastTaskWaited;
- static if(hasLength!S)
+ static if (hasLength!S)
{
size_t _length;
@@ -2166,7 +2166,7 @@ public:
this.source = source;
this.pool = pool;
- static if(hasLength!S)
+ static if (hasLength!S)
{
_length = source.length;
}
@@ -2206,7 +2206,7 @@ public:
void doBufSwap()
{
- if(lastTaskWaited)
+ if (lastTaskWaited)
{
// Then source is empty. Signal it here.
buf1 = null;
@@ -2218,7 +2218,7 @@ public:
buf1 = nextBufTask.yieldForce;
bufPos = 0;
- if(source.empty)
+ if (source.empty)
{
lastTaskWaited = true;
}
@@ -2236,19 +2236,19 @@ public:
void popFront()
{
- static if(hasLength!S)
+ static if (hasLength!S)
{
_length--;
}
bufPos++;
- if(bufPos >= buf1.length)
+ if (bufPos >= buf1.length)
{
doBufSwap();
}
}
- static if(std.range.isInfinite!S)
+ static if (std.range.isInfinite!S)
{
enum bool empty = false;
}
@@ -2310,7 +2310,7 @@ public:
double[][] matrix;
auto asyncReader = taskPool.asyncBuf(&next, &file.eof);
- foreach(line; asyncReader)
+ foreach (line; asyncReader)
{
auto ls = line.split("\t");
matrix ~= to!(double[])(ls);
@@ -2330,7 +2330,7 @@ public:
and will result in a static assertion failure.
*/
auto asyncBuf(C1, C2)(C1 next, C2 empty, size_t initialBufSize = 0, size_t nBuffers = 100)
- if(is(typeof(C2.init()) : bool) &&
+ if (is(typeof(C2.init()) : bool) &&
Parameters!C1.length == 1 &&
Parameters!C2.length == 0 &&
isArray!(Parameters!C1[0])
@@ -2431,7 +2431,7 @@ public:
alias fun = reduceAdjoin!functions;
alias finishFun = reduceFinish!functions;
- static if(isIntegral!(Args[$ - 1]))
+ static if (isIntegral!(Args[$ - 1]))
{
size_t workUnitSize = cast(size_t) args[$ - 1];
alias args2 = args[0..$ - 1];
@@ -2445,7 +2445,7 @@ public:
auto makeStartValue(Type)(Type e)
{
- static if(functions.length == 1)
+ static if (functions.length == 1)
{
return e;
}
@@ -2461,14 +2461,14 @@ public:
}
}
- static if(args2.length == 2)
+ static if (args2.length == 2)
{
static assert(isInputRange!(Args2[1]));
alias range = args2[1];
alias seed = args2[0];
enum explicitSeed = true;
- static if(!is(typeof(workUnitSize)))
+ static if (!is(typeof(workUnitSize)))
{
size_t workUnitSize = defaultWorkUnitSize(range.length);
}
@@ -2478,7 +2478,7 @@ public:
static assert(args2.length == 1);
alias range = args2[0];
- static if(!is(typeof(workUnitSize)))
+ static if (!is(typeof(workUnitSize)))
{
size_t workUnitSize = defaultWorkUnitSize(range.length);
}
@@ -2505,10 +2505,10 @@ public:
enum nILP = ilpTuple.length;
immutable subSize = (upperBound - lowerBound) / nILP;
- if(subSize <= 1)
+ if (subSize <= 1)
{
// Handle as a special case.
- static if(explicitSeed)
+ static if (explicitSeed)
{
E result = seed;
}
@@ -2518,7 +2518,7 @@ public:
lowerBound++;
}
- foreach(i; lowerBound..upperBound)
+ foreach (i; lowerBound..upperBound)
{
result = fun(result, range[i]);
}
@@ -2530,11 +2530,11 @@ public:
E[nILP] results;
size_t[nILP] offsets;
- foreach(i; ilpTuple)
+ foreach (i; ilpTuple)
{
offsets[i] = lowerBound + subSize * i;
- static if(explicitSeed)
+ static if (explicitSeed)
{
results[i] = seed;
}
@@ -2546,9 +2546,9 @@ public:
}
immutable nLoop = subSize - (!explicitSeed);
- foreach(i; 0..nLoop)
+ foreach (i; 0..nLoop)
{
- foreach(j; ilpTuple)
+ foreach (j; ilpTuple)
{
results[j] = fun(results[j], range[offsets[j]]);
offsets[j]++;
@@ -2556,12 +2556,12 @@ public:
}
// Finish the remainder.
- foreach(i; nILP * subSize + lowerBound..upperBound)
+ foreach (i; nILP * subSize + lowerBound..upperBound)
{
results[$ - 1] = fun(results[$ - 1], range[i]);
}
- foreach(i; ilpTuple[1..$])
+ foreach (i; ilpTuple[1..$])
{
results[0] = finishFun(results[0], results[i]);
}
@@ -2570,12 +2570,12 @@ public:
}
immutable len = range.length;
- if(len == 0)
+ if (len == 0)
{
return seed;
}
- if(this.size == 0)
+ if (this.size == 0)
{
return finishFun(seed, reduceOnRange(range, 0, len));
}
@@ -2586,7 +2586,7 @@ public:
// be applied on the results of these to get a final result, but
// it can't be evaluated out of order.
- if(workUnitSize > len)
+ if (workUnitSize > len)
{
workUnitSize = len;
}
@@ -2604,14 +2604,14 @@ public:
immutable size_t nBytesNeeded = nWorkUnits * RTask.sizeof;
import core.stdc.stdlib;
- if(nBytesNeeded < maxStack)
+ if (nBytesNeeded < maxStack)
{
tasks = (cast(RTask*) buf.ptr)[0..nWorkUnits];
}
else
{
auto ptr = cast(RTask*) malloc(nBytesNeeded);
- if(!ptr)
+ if (!ptr)
{
throw new OutOfMemoryError(
"Out of memory in std.parallelism."
@@ -2623,7 +2623,7 @@ public:
scope(exit)
{
- if(nBytesNeeded > maxStack)
+ if (nBytesNeeded > maxStack)
{
free(tasks.ptr);
}
@@ -2651,18 +2651,18 @@ public:
curPos += workUnitSize;
}
- foreach(ref task; tasks)
+ foreach (ref task; tasks)
{
useTask(task);
}
- foreach(i; 1..tasks.length - 1)
+ foreach (i; 1..tasks.length - 1)
{
tasks[i].next = tasks[i + 1].basePtr;
tasks[i + 1].prev = tasks[i].basePtr;
}
- if(tasks.length > 1)
+ if (tasks.length > 1)
{
queueLock();
scope(exit) queueUnlock();
@@ -2673,7 +2673,7 @@ public:
);
}
- if(tasks.length > 0)
+ if (tasks.length > 0)
{
try
{
@@ -2686,7 +2686,7 @@ public:
tasks[0].taskStatus = TaskStatus.done;
// Try to execute each of these in the current thread
- foreach(ref task; tasks[1..$])
+ foreach (ref task; tasks[1..$])
{
tryDeleteExecute(task.basePtr);
}
@@ -2698,7 +2698,7 @@ public:
Throwable firstException, lastException;
- foreach(ref task; tasks)
+ foreach (ref task; tasks)
{
try
{
@@ -2710,10 +2710,10 @@ public:
continue;
}
- if(!firstException) result = finishFun(result, task.returnVal);
+ if (!firstException) result = finishFun(result, task.returnVal);
}
- if(firstException) throw firstException;
+ if (firstException) throw firstException;
return result;
}
@@ -2740,17 +2740,17 @@ public:
{
auto filesHandles = new File[taskPool.size + 1];
scope(exit) {
- foreach(ref handle; fileHandles) {
+ foreach (ref handle; fileHandles) {
handle.close();
}
}
- foreach(i, ref handle; fileHandles)
+ foreach (i, ref handle; fileHandles)
{
handle = File("workerResults" ~ to!string(i) ~ ".txt");
}
- foreach(num; parallel(iota(1_000)))
+ foreach (num; parallel(iota(1_000)))
{
auto outHandle = fileHandles[taskPool.workerIndex];
outHandle.writeln(num, '\t', gcd(num, 42));
@@ -2795,7 +2795,7 @@ public:
immutable delta = 1.0L / n;
auto sums = taskPool.workerLocalStorage(0.0L);
- foreach(i; parallel(iota(n)))
+ foreach (i; parallel(iota(n)))
{
immutable x = ( i - 0.5L ) * delta;
immutable toAdd = delta / ( 1.0 + x * x );
@@ -2804,7 +2804,7 @@ public:
// Add up the results from each worker thread.
real pi = 0;
- foreach(threadResult; sums.toRange)
+ foreach (threadResult; sums.toRange)
{
pi += 4.0L * threadResult;
}
@@ -2821,7 +2821,7 @@ public:
static size_t roundToLine(size_t num) pure nothrow
{
- if(num % cacheLineSize == 0)
+ if (num % cacheLineSize == 0)
{
return num;
}
@@ -2856,7 +2856,7 @@ public:
// Cache line align data ptr.
data = cast(void*) roundToLine(cast(size_t) data);
- foreach(i; 0..nElem)
+ foreach (i; 0..nElem)
{
this.opIndex(i) = T.init;
}
@@ -2923,7 +2923,7 @@ public:
*/
WorkerLocalStorageRange!T toRange() @property
{
- if(*stillThreadLocal)
+ if (*stillThreadLocal)
{
*stillThreadLocal = false;
@@ -2980,7 +2980,7 @@ public:
void popFront()
{
- if(_length > 0)
+ if (_length > 0)
{
beginOffset++;
_length--;
@@ -2989,7 +2989,7 @@ public:
void popBack()
{
- if(_length > 0)
+ if (_length > 0)
{
_length--;
}
@@ -3042,7 +3042,7 @@ public:
{
WorkerLocalStorage!T ret;
ret.initialize(this);
- foreach(i; 0..size + 1)
+ foreach (i; 0..size + 1)
{
ret[i] = initialVal;
}
@@ -3100,7 +3100,7 @@ public:
// Use this thread as a worker until everything is finished.
executeWorkLoop();
- foreach(t; pool)
+ foreach (t; pool)
{
// Maybe there should be something here to prevent a thread
// from calling join() on itself if this function is called
@@ -3156,7 +3156,7 @@ public:
complete and no longer referenced by a $(D TaskPool).
*/
void put(alias fun, Args...)(ref Task!(fun, Args) task)
- if(!isSafeReturn!(typeof(task)))
+ if (!isSafeReturn!(typeof(task)))
{
task.pool = this;
abstractPut(task.basePtr);
@@ -3164,21 +3164,21 @@ public:
/// Ditto
void put(alias fun, Args...)(Task!(fun, Args)* task)
- if(!isSafeReturn!(typeof(*task)))
+ if (!isSafeReturn!(typeof(*task)))
{
enforce(task !is null, "Cannot put a null Task on a TaskPool queue.");
put(*task);
}
@trusted void put(alias fun, Args...)(ref Task!(fun, Args) task)
- if(isSafeReturn!(typeof(task)))
+ if (isSafeReturn!(typeof(task)))
{
task.pool = this;
abstractPut(task.basePtr);
}
@trusted void put(alias fun, Args...)(Task!(fun, Args)* task)
- if(isSafeReturn!(typeof(*task)))
+ if (isSafeReturn!(typeof(*task)))
{
enforce(task !is null, "Cannot put a null Task on a TaskPool queue.");
put(*task);
@@ -3212,7 +3212,7 @@ public:
{
queueLock();
scope(exit) queueUnlock();
- foreach(thread; pool)
+ foreach (thread; pool)
{
thread.isDaemon = newVal;
}
@@ -3236,9 +3236,9 @@ public:
/// Ditto
void priority(int newPriority) @property @trusted
{
- if(size > 0)
+ if (size > 0)
{
- foreach(t; pool)
+ foreach (t; pool)
{
t.priority = newPriority;
}
@@ -3299,7 +3299,7 @@ Example:
// default TaskPool instance.
auto logs = new double[1_000_000];
-foreach(i, ref elem; parallel(logs)) {
+foreach (i, ref elem; parallel(logs)) {
elem = log(i + 1.0);
}
---
@@ -3354,26 +3354,26 @@ private void submitAndExecute(
enum nBuf = 64;
byte[nBuf * PTask.sizeof] buf = void;
PTask[] tasks;
- if(nThreads <= nBuf)
+ if (nThreads <= nBuf)
{
tasks = (cast(PTask*) buf.ptr)[0..nThreads];
}
else
{
auto ptr = cast(PTask*) malloc(nThreads * PTask.sizeof);
- if(!ptr) throw new OutOfMemoryError("Out of memory in std.parallelism.");
+ if (!ptr) throw new OutOfMemoryError("Out of memory in std.parallelism.");
tasks = ptr[0..nThreads];
}
scope(exit)
{
- if(nThreads > nBuf)
+ if (nThreads > nBuf)
{
free(tasks.ptr);
}
}
- foreach(ref t; tasks)
+ foreach (ref t; tasks)
{
import core.stdc.string : memcpy;
@@ -3388,13 +3388,13 @@ private void submitAndExecute(
t.pool = pool;
}
- foreach(i; 1..tasks.length - 1)
+ foreach (i; 1..tasks.length - 1)
{
tasks[i].next = tasks[i + 1].basePtr;
tasks[i + 1].prev = tasks[i].basePtr;
}
- if(tasks.length > 1)
+ if (tasks.length > 1)
{
pool.queueLock();
scope(exit) pool.queueUnlock();
@@ -3405,7 +3405,7 @@ private void submitAndExecute(
);
}
- if(tasks.length > 0)
+ if (tasks.length > 0)
{
try
{
@@ -3418,7 +3418,7 @@ private void submitAndExecute(
tasks[0].taskStatus = TaskStatus.done;
// Try to execute each of these in the current thread
- foreach(ref task; tasks[1..$])
+ foreach (ref task; tasks[1..$])
{
pool.tryDeleteExecute(task.basePtr);
}
@@ -3426,7 +3426,7 @@ private void submitAndExecute(
Throwable firstException, lastException;
- foreach(i, ref task; tasks)
+ foreach (i, ref task; tasks)
{
try
{
@@ -3439,7 +3439,7 @@ private void submitAndExecute(
}
}
- if(firstException) throw firstException;
+ if (firstException) throw firstException;
}
void foreachErr()
@@ -3456,11 +3456,11 @@ int doSizeZeroCase(R, Delegate)(ref ParallelForeach!R p, Delegate dg)
// The explicit ElementType!R in the foreach loops is necessary for
// correct behavior when iterating over strings.
- static if(hasLvalueElements!R)
+ static if (hasLvalueElements!R)
{
- foreach(ref ElementType!R elem; range)
+ foreach (ref ElementType!R elem; range)
{
- static if(Parameters!dg.length == 2)
+ static if (Parameters!dg.length == 2)
{
res = dg(index, elem);
}
@@ -3468,15 +3468,15 @@ int doSizeZeroCase(R, Delegate)(ref ParallelForeach!R p, Delegate dg)
{
res = dg(elem);
}
- if(res) foreachErr();
+ if (res) foreachErr();
index++;
}
}
else
{
- foreach(ElementType!R elem; range)
+ foreach (ElementType!R elem; range)
{
- static if(Parameters!dg.length == 2)
+ static if (Parameters!dg.length == 2)
{
res = dg(index, elem);
}
@@ -3484,7 +3484,7 @@ int doSizeZeroCase(R, Delegate)(ref ParallelForeach!R p, Delegate dg)
{
res = dg(elem);
}
- if(res) foreachErr();
+ if (res) foreachErr();
index++;
}
}
@@ -3494,7 +3494,7 @@ int doSizeZeroCase(R, Delegate)(ref ParallelForeach!R p, Delegate dg)
private enum string parallelApplyMixinRandomAccess = q{
// Handle empty thread pool as special case.
- if(pool.size == 0)
+ if (pool.size == 0)
{
return doSizeZeroCase(this, dg);
}
@@ -3504,7 +3504,7 @@ private enum string parallelApplyMixinRandomAccess = q{
shared size_t workUnitIndex = size_t.max; // Effectively -1: chunkIndex + 1 == 0
immutable len = range.length;
- if(!len) return 0;
+ if (!len) return 0;
shared bool shouldContinue = true;
@@ -3516,11 +3516,11 @@ private enum string parallelApplyMixinRandomAccess = q{
atomicStore(shouldContinue, false);
}
- while(atomicLoad(shouldContinue))
+ while (atomicLoad(shouldContinue))
{
immutable myUnitIndex = atomicOp!"+="(workUnitIndex, 1);
immutable start = workUnitSize * myUnitIndex;
- if(start >= len)
+ if (start >= len)
{
atomicStore(shouldContinue, false);
break;
@@ -3528,15 +3528,15 @@ private enum string parallelApplyMixinRandomAccess = q{
immutable end = min(len, start + workUnitSize);
- foreach(i; start..end)
+ foreach (i; start..end)
{
- static if(withIndex)
+ static if (withIndex)
{
- if(dg(i, range[i])) foreachErr();
+ if (dg(i, range[i])) foreachErr();
}
else
{
- if(dg(range[i])) foreachErr();
+ if (dg(range[i])) foreachErr();
}
}
}
@@ -3549,7 +3549,7 @@ private enum string parallelApplyMixinRandomAccess = q{
enum string parallelApplyMixinInputRange = q{
// Handle empty thread pool as special case.
- if(pool.size == 0)
+ if (pool.size == 0)
{
return doSizeZeroCase(this, dg);
}
@@ -3566,7 +3566,7 @@ enum string parallelApplyMixinInputRange = q{
// This is updated only while protected by rangeMutex;
size_t nPopped = 0;
- static if(
+ static if (
is(typeof(range.buf1)) &&
is(typeof(range.bufPos)) &&
is(typeof(range.doBufSwap()))
@@ -3574,7 +3574,7 @@ enum string parallelApplyMixinInputRange = q{
{
// Make sure we don't have the buffer recycling overload of
// asyncBuf.
- static if(
+ static if (
is(typeof(range.source)) &&
isRoundRobin!(typeof(range.source))
)
@@ -3598,7 +3598,7 @@ enum string parallelApplyMixinInputRange = q{
atomicStore(shouldContinue, false);
}
- static if(hasLvalueElements!R)
+ static if (hasLvalueElements!R)
{
alias Temp = ElementType!R*[];
Temp temp;
@@ -3608,7 +3608,7 @@ enum string parallelApplyMixinInputRange = q{
{
import std.algorithm.internal : addressOf;
- if(temp is null)
+ if (temp is null)
{
temp = uninitializedArray!Temp(workUnitSize);
}
@@ -3636,9 +3636,9 @@ enum string parallelApplyMixinInputRange = q{
Temp temp;
// Returns: The previous value of nPopped.
- static if(!bufferTrick) size_t makeTemp()
+ static if (!bufferTrick) size_t makeTemp()
{
- if(temp is null)
+ if (temp is null)
{
temp = uninitializedArray!Temp(workUnitSize);
}
@@ -3658,7 +3658,7 @@ enum string parallelApplyMixinInputRange = q{
return ret;
}
- static if(bufferTrick) size_t makeTemp()
+ static if (bufferTrick) size_t makeTemp()
{
rangeMutex.lock();
scope(exit) rangeMutex.unlock();
@@ -3671,7 +3671,7 @@ enum string parallelApplyMixinInputRange = q{
// range before entering the parallel foreach loop.
temp = temp[range.bufPos..$];
- static if(is(typeof(range._length)))
+ static if (is(typeof(range._length)))
{
range._length -= (temp.length - range.bufPos);
}
@@ -3683,39 +3683,39 @@ enum string parallelApplyMixinInputRange = q{
}
}
- while(atomicLoad(shouldContinue))
+ while (atomicLoad(shouldContinue))
{
auto overallIndex = makeTemp();
- if(temp.empty)
+ if (temp.empty)
{
atomicStore(shouldContinue, false);
break;
}
- foreach(i; 0..temp.length)
+ foreach (i; 0..temp.length)
{
scope(success) overallIndex++;
- static if(hasLvalueElements!R)
+ static if (hasLvalueElements!R)
{
- static if(withIndex)
+ static if (withIndex)
{
- if(dg(overallIndex, *temp[i])) foreachErr();
+ if (dg(overallIndex, *temp[i])) foreachErr();
}
else
{
- if(dg(*temp[i])) foreachErr();
+ if (dg(*temp[i])) foreachErr();
}
}
else
{
- static if(withIndex)
+ static if (withIndex)
{
- if(dg(overallIndex, temp[i])) foreachErr();
+ if (dg(overallIndex, temp[i])) foreachErr();
}
else
{
- if(dg(temp[i])) foreachErr();
+ if (dg(temp[i])) foreachErr();
}
}
}
@@ -3730,9 +3730,9 @@ enum string parallelApplyMixinInputRange = q{
// Calls e.next until the end of the chain is found.
private Throwable findLastException(Throwable e) pure nothrow
{
- if(e is null) return null;
+ if (e is null) return null;
- while(e.next)
+ while (e.next)
{
e = e.next;
}
@@ -3747,7 +3747,7 @@ private void addToChain(
ref Throwable lastException
) pure nothrow
{
- if(firstException)
+ if (firstException)
{
assert(lastException);
lastException.next = e;
@@ -3767,7 +3767,7 @@ private struct ParallelForeach(R)
size_t workUnitSize;
alias E = ElementType!R;
- static if(hasLvalueElements!R)
+ static if (hasLvalueElements!R)
{
alias NoIndexDg = int delegate(ref E);
alias IndexDg = int delegate(size_t, ref E);
@@ -3780,7 +3780,7 @@ private struct ParallelForeach(R)
int opApply(scope NoIndexDg dg)
{
- static if(randLen!R)
+ static if (randLen!R)
{
mixin(parallelApplyMixinRandomAccess);
}
@@ -3792,7 +3792,7 @@ private struct ParallelForeach(R)
int opApply(scope IndexDg dg)
{
- static if(randLen!R)
+ static if (randLen!R)
{
mixin(parallelApplyMixinRandomAccess);
}
@@ -3834,7 +3834,7 @@ private struct RoundRobinBuffer(C1, C2)
this.emptyDel = emptyDel;
bufs.length = nBuffers;
- foreach(ref buf; bufs)
+ foreach (ref buf; bufs)
{
buf.length = initialBufSize;
}
@@ -3859,13 +3859,13 @@ private struct RoundRobinBuffer(C1, C2)
}
body
{
- if(!primed) prime();
+ if (!primed) prime();
return bufs[index];
}
void popFront()
{
- if(empty || emptyDel())
+ if (empty || emptyDel())
{
_empty = true;
return;
@@ -3978,7 +3978,7 @@ unittest
auto nums = new uint[5];
auto nums2 = new uint[5];
- foreach(i, ref elem; poolInstance.parallel(arr))
+ foreach (i, ref elem; poolInstance.parallel(arr))
{
elem++;
nums[i] = cast(uint) i + 2;
@@ -4006,7 +4006,7 @@ unittest
// Test parallel foreach with non-random access range.
auto range = filter!"a != 666"([0, 1, 2, 3, 4]);
- foreach(i, elem; poolInstance.parallel(range))
+ foreach (i, elem; poolInstance.parallel(range))
{
nums[i] = cast(uint) i;
}
@@ -4014,12 +4014,12 @@ unittest
assert(nums == [0,1,2,3,4]);
auto logs = new double[1_000_000];
- foreach(i, ref elem; poolInstance.parallel(logs))
+ foreach (i, ref elem; poolInstance.parallel(logs))
{
elem = log(i + 1.0);
}
- foreach(i, elem; logs)
+ foreach (i, elem; logs)
{
assert(approxEqual(elem, cast(double) log(i + 1)));
}
@@ -4065,7 +4065,7 @@ unittest
// Test worker-local storage.
auto wl = poolInstance.workerLocalStorage(0);
- foreach(i; poolInstance.parallel(iota(1000), 1))
+ foreach (i; poolInstance.parallel(iota(1000), 1))
{
wl.get = wl.get + i;
}
@@ -4112,7 +4112,7 @@ unittest
assert(taskPool.size == totalCPUs - 1);
nums = new uint[1000];
- foreach(i; parallel(iota(1000)))
+ foreach (i; parallel(iota(1000)))
{
nums[i] = cast(uint) i;
}
@@ -4159,7 +4159,7 @@ unittest
}
auto written = [[1.0, 2, 3], [4.0, 5, 6], [7.0, 8, 9]];
- foreach(row; written)
+ foreach (row; written)
{
file.writeln(join(to!(string[])(row), "\t"));
}
@@ -4176,9 +4176,9 @@ unittest
double[][] read;
auto asyncReader = taskPool.asyncBuf(&next, &file.eof);
- foreach(line; asyncReader)
+ foreach (line; asyncReader)
{
- if(line.length == 0) continue;
+ if (line.length == 0) continue;
auto ls = line.split("\t");
read ~= to!(double[])(ls);
}
@@ -4197,9 +4197,9 @@ unittest
lmchain.popFront();
int ii;
- foreach( elem; (lmchain))
+ foreach ( elem; (lmchain))
{
- if(!approxEqual(elem, ii))
+ if (!approxEqual(elem, ii))
{
stderr.writeln(ii, '\t', elem);
}
@@ -4210,7 +4210,7 @@ unittest
abuf = poolInstance.asyncBuf(iota(-1.0, 1_000_000), 100);
abuf.popFront();
auto bufTrickTest = new size_t[abuf.length];
- foreach(i, elem; parallel(abuf))
+ foreach (i, elem; parallel(abuf))
{
bufTrickTest[i] = i;
}
@@ -4224,12 +4224,12 @@ unittest
// Test that worker local storage from one pool receives an index of 0
// when the index is queried w.r.t. another pool. The only way to do this
// is non-deterministically.
- foreach(i; parallel(iota(1000), 1))
+ foreach (i; parallel(iota(1000), 1))
{
assert(poolInstance.workerIndex == 0);
}
- foreach(i; poolInstance.parallel(iota(1000), 1))
+ foreach (i; poolInstance.parallel(iota(1000), 1))
{
assert(taskPool.workerIndex == 0);
}
@@ -4237,7 +4237,7 @@ unittest
// Test exception handling.
static void parallelForeachThrow()
{
- foreach(elem; parallel(iota(10)))
+ foreach (elem; parallel(iota(10)))
{
throw new Exception("");
}
@@ -4297,20 +4297,20 @@ version(parallelismStressTest)
{
size_t attempt;
for(; attempt < 10; attempt++)
- foreach(poolSize; [0, 4])
+ foreach (poolSize; [0, 4])
{
poolInstance = new TaskPool(poolSize);
uint[] numbers = new uint[1_000];
- foreach(i; poolInstance.parallel( iota(0, numbers.length)) )
+ foreach (i; poolInstance.parallel( iota(0, numbers.length)) )
{
numbers[i] = cast(uint) i;
}
// Make sure it works.
- foreach(i; 0..numbers.length)
+ foreach (i; 0..numbers.length)
{
assert(numbers[i] == i);
}
@@ -4319,7 +4319,7 @@ version(parallelismStressTest)
auto myNumbers = filter!"a % 7 > 0"( iota(0, 1000));
- foreach(num; poolInstance.parallel(myNumbers))
+ foreach (num; poolInstance.parallel(myNumbers))
{
assert(num % 7 > 0 && num < 1000);
}
@@ -4327,7 +4327,7 @@ version(parallelismStressTest)
uint[] squares = poolInstance.amap!"a * a"(numbers, 100);
assert(squares.length == numbers.length);
- foreach(i, number; numbers)
+ foreach (i, number; numbers)
{
assert(squares[i] == number * number);
}
@@ -4337,7 +4337,7 @@ version(parallelismStressTest)
poolInstance.put(sumFuture);
ulong sumSquares = 0;
- foreach(elem; numbers)
+ foreach (elem; numbers)
{
sumSquares += elem * elem;
}
@@ -4358,9 +4358,9 @@ version(parallelismStressTest)
auto nestedOuter = "abcd";
auto nestedInner = iota(0, 10, 2);
- foreach(i, letter; poolInstance.parallel(nestedOuter, 1))
+ foreach (i, letter; poolInstance.parallel(nestedOuter, 1))
{
- foreach(j, number; poolInstance.parallel(nestedInner, 1))
+ foreach (j, number; poolInstance.parallel(nestedInner, 1))
{
synchronized writeln(i, ": ", letter, " ", j, ": ", number);
}
@@ -4378,8 +4378,8 @@ version(parallelismStressTest)
// as examples.
unittest
{
- foreach(attempt; 0..10)
- foreach(poolSize; [0, 4])
+ foreach (attempt; 0..10)
+ foreach (poolSize; [0, 4])
{
poolInstance = new TaskPool(poolSize);
@@ -4389,7 +4389,7 @@ version(parallelismStressTest)
// Test worker-local storage.
auto workerLocalStorage = poolInstance.workerLocalStorage!uint(1);
- foreach(i; poolInstance.parallel(iota(0U, 1_000_000)))
+ foreach (i; poolInstance.parallel(iota(0U, 1_000_000)))
{
workerLocalStorage.get++;
}
@@ -4400,13 +4400,13 @@ version(parallelismStressTest)
// non-deterministic and is more of a sanity check than something that
// has an absolute pass/fail.
shared(uint)[void*] nJobsByThread;
- foreach(thread; poolInstance.pool)
+ foreach (thread; poolInstance.pool)
{
nJobsByThread[cast(void*) thread] = 0;
}
nJobsByThread[ cast(void*) Thread.getThis()] = 0;
- foreach(i; poolInstance.parallel( iota(0, 1_000_000), 100 ))
+ foreach (i; poolInstance.parallel( iota(0, 1_000_000), 100 ))
{
atomicOp!"+="( nJobsByThread[ cast(void*) Thread.getThis() ], 1);
}
@@ -4414,16 +4414,16 @@ version(parallelismStressTest)
stderr.writeln("\nCurrent thread is: ",
cast(void*) Thread.getThis());
stderr.writeln("Workload distribution: ");
- foreach(k, v; nJobsByThread)
+ foreach (k, v; nJobsByThread)
{
stderr.writeln(k, '\t', v);
}
// Test whether amap can be nested.
real[][] matrix = new real[][](1000, 1000);
- foreach(i; poolInstance.parallel( iota(0, matrix.length) ))
+ foreach (i; poolInstance.parallel( iota(0, matrix.length) ))
{
- foreach(j; poolInstance.parallel( iota(0, matrix[0].length) ))
+ foreach (j; poolInstance.parallel( iota(0, matrix[0].length) ))
{
matrix[i][j] = i * j;
}
@@ -4442,9 +4442,9 @@ version(parallelismStressTest)
real[][] sqrtMatrix = poolInstance.amap!parallelSqrt(matrix);
- foreach(i, row; sqrtMatrix)
+ foreach (i, row; sqrtMatrix)
{
- foreach(j, elem; row)
+ foreach (j, elem; row)
{
real shouldBe = sqrt( cast(real) i * j);
assert(approxEqual(shouldBe, elem));
@@ -4482,24 +4482,24 @@ version(parallelismStressTest)
poolInstance.put(nanTask);
assert(nanTask.spinForce == false);
- if(poolInstance.size > 0)
+ if (poolInstance.size > 0)
{
// Test work waiting.
static void uselessFun()
{
- foreach(i; 0..1_000_000) {}
+ foreach (i; 0..1_000_000) {}
}
auto uselessTasks = new typeof(task(&uselessFun))[1000];
- foreach(ref uselessTask; uselessTasks)
+ foreach (ref uselessTask; uselessTasks)
{
uselessTask = task(&uselessFun);
}
- foreach(ref uselessTask; uselessTasks)
+ foreach (ref uselessTask; uselessTasks)
{
poolInstance.put(uselessTask);
}
- foreach(ref uselessTask; uselessTasks)
+ foreach (ref uselessTask; uselessTasks)
{
uselessTask.workForce();
}
@@ -4526,7 +4526,7 @@ version(parallelismStressTest)
}
auto refRange = RemoveRandom(nums);
- foreach(ref elem; poolInstance.parallel(refRange))
+ foreach (ref elem; poolInstance.parallel(refRange))
{
elem++;
}
diff --git a/std/process.d b/std/process.d
index a93197e33..98db3e0b1 100644
--- a/std/process.d
+++ b/std/process.d
@@ -1210,7 +1210,7 @@ private:
{
if (_processID == terminated) return _exitCode;
int exitCode;
- while(true)
+ while (true)
{
int status;
auto check = waitpid(_processID, &status, block ? 0 : WNOHANG);
@@ -1275,7 +1275,7 @@ private:
~this()
{
- if(_handle != INVALID_HANDLE_VALUE)
+ if (_handle != INVALID_HANDLE_VALUE)
{
CloseHandle(_handle);
_handle = INVALID_HANDLE_VALUE;
@@ -3304,7 +3304,7 @@ int system(string command)
private void toAStringz(in string[] a, const(char)**az)
{
import std.string : toStringz;
- foreach(string s; a)
+ foreach (string s; a)
{
*az++ = toStringz(s);
}
@@ -3367,34 +3367,34 @@ int _spawnvp(int mode, in char *pathname, in char **argv)
int retval = 0;
pid_t pid = fork();
- if(!pid)
+ if (!pid)
{ // child
core.sys.posix.unistd.execvp(pathname, argv);
goto Lerror;
}
- else if(pid > 0)
+ else if (pid > 0)
{ // parent
- if(mode == _P_NOWAIT)
+ if (mode == _P_NOWAIT)
{
retval = pid; // caller waits
}
else
{
- while(1)
+ while (1)
{
int status;
pid_t wpid = waitpid(pid, &status, 0);
- if(exited(status))
+ if (exited(status))
{
retval = exitstatus(status);
break;
}
- else if(signaled(status))
+ else if (signaled(status))
{
retval = -termsig(status);
break;
}
- else if(stopped(status)) // ptrace support
+ else if (stopped(status)) // ptrace support
continue;
else
goto Lerror;
@@ -3578,7 +3578,7 @@ version(Posix)
{
import std.array : split;
// Is pathname rooted?
- if(pathname[0] == '/')
+ if (pathname[0] == '/')
{
// Yes, so just call execve()
return execve(pathname, argv, envp);
@@ -3594,13 +3594,13 @@ version(Posix)
// execution, so there's no need to check the execve() result through
// the loop.
- foreach(string pathDir; envPaths)
+ foreach (string pathDir; envPaths)
{
string composite = cast(string) (pathDir ~ "/" ~ pathname);
iRet = execve(composite, argv, envp);
}
- if(0 != iRet)
+ if (0 != iRet)
{
iRet = execve(pathname, argv, envp);
}
diff --git a/std/random.d b/std/random.d
index 19ff3439f..444450f43 100644
--- a/std/random.d
+++ b/std/random.d
@@ -251,7 +251,7 @@ template isSeedable(Rng)
Linear Congruential generator.
*/
struct LinearCongruentialEngine(UIntType, UIntType a, UIntType c, UIntType m)
- if(isUnsigned!UIntType)
+ if (isUnsigned!UIntType)
{
///Mark this as a Rng
enum bool isUniformRandom = true;
@@ -533,7 +533,7 @@ struct MersenneTwisterEngine(UIntType, size_t w, size_t n, size_t m, size_t r,
UIntType a, size_t u, size_t s,
UIntType b, size_t t,
UIntType c, size_t l)
- if(isUnsigned!UIntType)
+ if (isUnsigned!UIntType)
{
static assert(0 < w && w <= UIntType.sizeof * 8);
static assert(1 <= m && m <= n);
@@ -614,7 +614,7 @@ Parameters for the generator.
$(D Exception) if the InputRange didn't provide enough elements to seed the generator.
The number of elements required is the 'n' template parameter of the MersenneTwisterEngine struct.
*/
- void seed(T)(T range) if(isInputRange!T && is(Unqual!(ElementType!T) == UIntType))
+ void seed(T)(T range) if (isInputRange!T && is(Unqual!(ElementType!T) == UIntType))
{
size_t j;
for (j = 0; j < n && !range.empty; ++j, range.popFront())
@@ -795,7 +795,7 @@ unittest
{
import std.range;
// Check .save works
- foreach(Type; std.meta.AliasSeq!(Mt19937))
+ foreach (Type; std.meta.AliasSeq!(Mt19937))
{
auto gen1 = Type(unpredictableSeed);
auto gen2 = gen1.save;
@@ -834,7 +834,7 @@ unittest
* )
*/
struct XorshiftEngine(UIntType, UIntType bits, UIntType a, UIntType b, UIntType c)
- if(isUnsigned!UIntType)
+ if (isUnsigned!UIntType)
{
static assert(bits == 32 || bits == 64 || bits == 96 || bits == 128 || bits == 160 || bits == 192,
"Xorshift supports only 32, 64, 96, 128, 160 and 192 bit versions. "
@@ -1101,7 +1101,7 @@ unittest
*/
unittest
{
- foreach(Rng; PseudoRngTypes)
+ foreach (Rng; PseudoRngTypes)
{
static assert(isUniformRNG!Rng);
auto rng = Rng(unpredictableSeed);
@@ -1175,7 +1175,7 @@ A singleton instance of the default random number generator
static bool initialized;
if (!initialized)
{
- static if(isSeedable!(Random, typeof(map!((a) => unpredictableSeed)(repeat(0)))))
+ static if (isSeedable!(Random, typeof(map!((a) => unpredictableSeed)(repeat(0)))))
result.seed(map!((a) => unpredictableSeed)(repeat(0)));
else
result = Random(unpredictableSeed);
@@ -1239,7 +1239,7 @@ unittest
assert('a' <= x && x < 'z');
}
- foreach(i; 0 .. 20)
+ foreach (i; 0 .. 20)
{
immutable ubyte a = 0;
immutable ubyte b = 15;
@@ -1597,7 +1597,7 @@ if (!is(T == enum) && (isIntegral!T || isSomeChar!T))
@safe unittest
{
- foreach(T; std.meta.AliasSeq!(char, wchar, dchar, byte, ubyte, short, ushort,
+ foreach (T; std.meta.AliasSeq!(char, wchar, dchar, byte, ubyte, short, ushort,
int, uint, long, ulong))
{
T init = uniform!T();
@@ -1654,7 +1654,7 @@ if (is(E == enum))
enum Fruit { Apple = 12, Mango = 29, Pear = 72 }
foreach (_; 0 .. 100)
{
- foreach(f; [uniform!Fruit(), rndGen.uniform!Fruit()])
+ foreach (f; [uniform!Fruit(), rndGen.uniform!Fruit()])
{
assert(f == Fruit.Apple || f == Fruit.Mango || f == Fruit.Pear);
}
@@ -1783,7 +1783,7 @@ array of size $(D n) of positive numbers of type $(D F) that sum to
$(D 1). If $(D useThis) is provided, it is used as storage.
*/
F[] uniformDistribution(F = double)(size_t n, F[] useThis = null)
- if(isFloatingPoint!F)
+ if (isFloatingPoint!F)
{
import std.numeric : normalize;
useThis.length = n;
@@ -1820,14 +1820,14 @@ Params:
*/
void randomShuffle(Range, RandomGen)(Range r, ref RandomGen gen)
- if(isRandomAccessRange!Range && isUniformRNG!RandomGen)
+ if (isRandomAccessRange!Range && isUniformRNG!RandomGen)
{
return partialShuffle!(Range, RandomGen)(r, r.length, gen);
}
/// ditto
void randomShuffle(Range)(Range r)
- if(isRandomAccessRange!Range)
+ if (isRandomAccessRange!Range)
{
return randomShuffle(r, rndGen);
}
@@ -1835,7 +1835,7 @@ void randomShuffle(Range)(Range r)
unittest
{
import std.algorithm;
- foreach(RandomGen; PseudoRngTypes)
+ foreach (RandomGen; PseudoRngTypes)
{
// Also tests partialShuffle indirectly.
auto a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
@@ -1869,7 +1869,7 @@ Params:
specified, defaults to $(D rndGen)
*/
void partialShuffle(Range, RandomGen)(Range r, in size_t n, ref RandomGen gen)
- if(isRandomAccessRange!Range && isUniformRNG!RandomGen)
+ if (isRandomAccessRange!Range && isUniformRNG!RandomGen)
{
import std.exception : enforce;
import std.algorithm : swapAt;
@@ -1882,7 +1882,7 @@ void partialShuffle(Range, RandomGen)(Range r, in size_t n, ref RandomGen gen)
/// ditto
void partialShuffle(Range)(Range r, in size_t n)
- if(isRandomAccessRange!Range)
+ if (isRandomAccessRange!Range)
{
return partialShuffle(r, n, rndGen);
}
@@ -1890,7 +1890,7 @@ void partialShuffle(Range)(Range r, in size_t n)
unittest
{
import std.algorithm;
- foreach(RandomGen; PseudoRngTypes)
+ foreach (RandomGen; PseudoRngTypes)
{
auto a = [0, 1, 1, 2, 3];
auto b = a.dup;
@@ -1903,7 +1903,7 @@ unittest
immutable int LEN = 2;
immutable int NUM = 750;
int[][] chk;
- foreach(step; 0..NUM)
+ foreach (step; 0..NUM)
{
partialShuffle(a, LEN, gen);
chk ~= a[0..LEN].dup;
@@ -2614,7 +2614,7 @@ Variable names are chosen to match those in Vitter's paper.
while (true)
{
// Step D2: set values of x and u.
- while(1)
+ while (1)
{
x = _available * (1-_Vprime);
s = cast(size_t) trunc(x);
@@ -2954,16 +2954,16 @@ unittest
* This is a rough-and-ready check that the statistical properties
* are in the ballpark -- not a proper validation of statistical
* quality! This incidentally also checks for reference-type
- * initialization bugs, as the foreach() loop will operate on a
+ * initialization bugs, as the foreach () loop will operate on a
* copy of the popFronted (and hence initialized) sample.
*/
{
size_t count0, count1, count99;
- foreach(_; 0 .. 100_000)
+ foreach (_; 0 .. 100_000)
{
auto sample = randomSample(iota(100), 5, &rng);
sample.popFront();
- foreach(s; sample)
+ foreach (s; sample)
{
if (s == 0)
{
diff --git a/std/range/interfaces.d b/std/range/interfaces.d
index f7537de08..5dc37205f 100644
--- a/std/range/interfaces.d
+++ b/std/range/interfaces.d
@@ -481,12 +481,12 @@ unittest
assert(arr.moveBack() == 4);
assert(arr.moveAt(1) == 2);
- foreach(elem; arrWrapped) {}
- foreach(i, elem; arrWrapped) {}
+ foreach (elem; arrWrapped) {}
+ foreach (i, elem; arrWrapped) {}
assert(inputRangeObject(arrWrapped) is arrWrapped);
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
auto d = DummyType.init;
static assert(propagatesRangeType!(DummyType,
typeof(inputRangeObject(d))));
diff --git a/std/range/package.d b/std/range/package.d
index 3c36c002d..d5da4bc4a 100644
--- a/std/range/package.d
+++ b/std/range/package.d
@@ -241,7 +241,7 @@ if (isBidirectionalRange!(Unqual!Range))
@property auto ref back() { return source.front; }
void popBack() { source.popFront(); }
- static if(is(typeof(source.moveBack())))
+ static if (is(typeof(source.moveBack())))
{
ElementType!R moveFront()
{
@@ -249,7 +249,7 @@ if (isBidirectionalRange!(Unqual!Range))
}
}
- static if(is(typeof(source.moveFront())))
+ static if (is(typeof(source.moveFront())))
{
ElementType!R moveBack()
{
@@ -353,7 +353,7 @@ if (isBidirectionalRange!(Unqual!Range))
{
import std.internal.test.dummyrange;
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
static if (!isBidirectionalRange!DummyType) {
static assert(!__traits(compiles, Retro!DummyType));
} else {
@@ -693,7 +693,7 @@ debug unittest
// Check for infiniteness propagation.
static assert(isInfinite!(typeof(stride(repeat(1), 3))));
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
DummyType dummyRange;
dummyRange.reinit();
@@ -1176,9 +1176,9 @@ unittest
// Check that chain at least instantiates and compiles with every possible
// pair of DummyRange types, in either order.
- foreach(DummyType1; AllDummyRanges) {
+ foreach (DummyType1; AllDummyRanges) {
DummyType1 dummy1;
- foreach(DummyType2; AllDummyRanges) {
+ foreach (DummyType2; AllDummyRanges) {
DummyType2 dummy2;
auto myChain = chain(dummy1, dummy2);
@@ -1187,7 +1187,7 @@ unittest
);
assert(myChain.front == 1);
- foreach(i; 0..dummyLength) {
+ foreach (i; 0..dummyLength) {
myChain.popFront();
}
assert(myChain.front == 1);
@@ -2006,7 +2006,7 @@ if (isInputRange!(Unqual!R) && (isInfinite!(Unqual!R) || !hasSlicing!(Unqual!R)
takeMyStrAgain = take(takeMyStr, 10);
assert(equal(takeMyStrAgain, "This is"));
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
DummyType dummy;
auto t = take(dummy, 5);
alias T = typeof(t);
@@ -2247,7 +2247,7 @@ if (isInputRange!R)
//define length.
static assert(!is(typeof(take(filter!"true"(a), 3)) == typeof(takeExactly(filter!"true"(a), 3))));
- foreach(DummyType; AllDummyRanges)
+ foreach (DummyType; AllDummyRanges)
{
{
DummyType dummy;
@@ -2257,7 +2257,7 @@ if (isInputRange!R)
assert(takeExactly(t, 4) == takeExactly(dummy, 4));
}
- static if(hasMobileElements!DummyType)
+ static if (hasMobileElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
@@ -2266,7 +2266,7 @@ if (isInputRange!R)
}
}
- static if(hasAssignableElements!DummyType)
+ static if (hasAssignableElements!DummyType)
{
{
auto t = takeExactly(DummyType.init, 4);
@@ -2377,7 +2377,7 @@ unittest
capabilities.
+/
auto takeNone(R)()
- if(isInputRange!R)
+ if (isInputRange!R)
{
return typeof(takeOne(R.init)).init;
}
@@ -2404,20 +2404,20 @@ auto takeNone(R)()
$(D takeExactly(range, 0)).
+/
auto takeNone(R)(R range)
- if(isInputRange!R)
+ if (isInputRange!R)
{
//Makes it so that calls to takeNone which don't use UFCS still work with a
//member version if it's defined.
- static if(is(typeof(R.takeNone)))
+ static if (is(typeof(R.takeNone)))
auto retval = range.takeNone();
//@@@BUG@@@ 8339
- else static if(isDynamicArray!R)/+ ||
+ else static if (isDynamicArray!R)/+ ||
(is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/
{
auto retval = R.init;
}
//An infinite range sliced at [0 .. 0] would likely still not be empty...
- else static if(hasSlicing!R && !isInfinite!R)
+ else static if (hasSlicing!R && !isInfinite!R)
auto retval = range[0 .. 0];
else
auto retval = takeExactly(range, 0);
@@ -2514,7 +2514,7 @@ auto takeNone(R)(R range)
import std.format : format;
- foreach(range; AliasSeq!([1, 2, 3, 4, 5],
+ foreach (range; AliasSeq!([1, 2, 3, 4, 5],
"hello world",
"hello world"w,
"hello world"d,
@@ -2528,7 +2528,7 @@ auto takeNone(R)(R range)
static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof);
}
- foreach(range; AliasSeq!(NormalStruct([1, 2, 3]),
+ foreach (range; AliasSeq!(NormalStruct([1, 2, 3]),
InitStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
@@ -2682,14 +2682,14 @@ pure nothrow @safe /+@nogc+/ unittest
+/
R drop(R)(R range, size_t n)
- if(isInputRange!R)
+ if (isInputRange!R)
{
range.popFrontN(n);
return range;
}
/// ditto
R dropBack(R)(R range, size_t n)
- if(isBidirectionalRange!R)
+ if (isBidirectionalRange!R)
{
range.popBackN(n);
return range;
@@ -2760,14 +2760,14 @@ R dropBack(R)(R range, size_t n)
$(D n) elements.
+/
R dropExactly(R)(R range, size_t n)
- if(isInputRange!R)
+ if (isInputRange!R)
{
popFrontExactly(range, n);
return range;
}
/// ditto
R dropBackExactly(R)(R range, size_t n)
- if(isBidirectionalRange!R)
+ if (isBidirectionalRange!R)
{
popBackExactly(range, n);
return range;
@@ -3349,7 +3349,7 @@ Cycle!R cycle(R)(ref R input, size_t index = 0) @system
immutable int[] immarr = [1, 2, 3];
auto cycleimm = cycle(immarr);
- foreach(DummyType; AllDummyRanges)
+ foreach (DummyType; AllDummyRanges)
{
static if (isForwardRange!DummyType)
{
@@ -3382,7 +3382,7 @@ Cycle!R cycle(R)(ref R input, size_t index = 0) @system
}
}
- static if(hasSlicing!DummyType)
+ static if (hasSlicing!DummyType)
{
auto slice = cy[5 .. 15];
assert(equal(slice, [6, 7, 8, 9, 10, 1, 2, 3, 4, 5]));
@@ -3987,7 +3987,7 @@ unittest
alias FOO = Zip!(immutable(int)[], immutable(float)[]);
- foreach(t; stuff.expand) {
+ foreach (t; stuff.expand) {
auto arr1 = t[0];
auto arr2 = t[1];
auto zShortest = zip(arr1, arr2);
@@ -3996,7 +3996,7 @@ unittest
try {
auto zSame = zip(StoppingPolicy.requireSameLength, arr1, arr2);
- foreach(elem; zSame) {}
+ foreach (elem; zSame) {}
assert(0);
} catch (Throwable) { /* It's supposed to throw.*/ }
@@ -4028,9 +4028,9 @@ unittest
// make -fwin32.mak unittest makes the compiler completely run out of RAM.
// You need to test just this module.
/+
- foreach(DummyType1; AllDummyRanges) {
+ foreach (DummyType1; AllDummyRanges) {
DummyType1 d1;
- foreach(DummyType2; AllDummyRanges) {
+ foreach (DummyType2; AllDummyRanges) {
DummyType2 d2;
auto r = zip(d1, d2);
assert(equal(map!"a[0]"(r), [1,2,3,4,5,6,7,8,9,10]));
@@ -4133,7 +4133,7 @@ private string lockstepMixin(Ranges...)(bool withIndex, bool reverse)
size_t index = ranges[0].length-1;
enforce(_stoppingPolicy == StoppingPolicy.requireSameLength, "lockstep can only be used with foreach_reverse when stoppingPolicy == requireSameLength");
- foreach(range; ranges[1..$])
+ foreach (range; ranges[1..$])
enforce(range.length == ranges[0].length);
};
indexInc = "--index;";
@@ -4183,7 +4183,7 @@ private string lockstepMixin(Ranges...)(bool withIndex, bool reverse)
if (_stoppingPolicy == StoppingPolicy.requireSameLength)
{
- foreach(range; ranges)
+ foreach (range; ranges)
enforce(range.empty);
}
return res;
@@ -4371,12 +4371,12 @@ unittest
auto l = lockstep(foo, bar);
// Should work twice. These are forward ranges with implicit save.
- foreach(i; 0..2)
+ foreach (i; 0..2)
{
uint[] res1;
float[] res2;
- foreach(a, ref b; l) {
+ foreach (a, ref b; l) {
res1 ~= a;
res2 ~= b;
}
@@ -4390,7 +4390,7 @@ unittest
auto arr1 = [1,2,3,4,5];
auto arr2 = [6,7,8,9,10];
- foreach(ref a, ref b; lockstep(arr1, arr2))
+ foreach (ref a, ref b; lockstep(arr1, arr2))
{
a += b;
}
@@ -4400,14 +4400,14 @@ unittest
// Make sure StoppingPolicy.requireSameLength doesn't throw.
auto ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
- foreach(a, b; ls) {}
+ foreach (a, b; ls) {}
// Make sure StoppingPolicy.requireSameLength throws.
arr2.popBack();
ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength);
try {
- foreach(a, b; ls) {}
+ foreach (a, b; ls) {}
assert(0);
} catch (Exception) {}
@@ -4419,7 +4419,7 @@ unittest
uint[] res1;
float[] res2;
size_t[] indices;
- foreach(i, a, b; lockstep(foo, bar))
+ foreach (i, a, b; lockstep(foo, bar))
{
indices ~= i;
res1 ~= a;
@@ -4439,7 +4439,7 @@ unittest
const(int[])[] bar2 = [[4, 5, 6]];
auto c = chain(foo2, bar2);
- foreach(f, b; lockstep(c, c)) {}
+ foreach (f, b; lockstep(c, c)) {}
// Regression 10468
foreach (x, y; lockstep(iota(0, 10), iota(0, 10))) { }
@@ -5264,7 +5264,7 @@ unittest
@safe unittest
{
- foreach(range; AliasSeq!(iota(2, 27, 4),
+ foreach (range; AliasSeq!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
@@ -5646,11 +5646,11 @@ FrontTransversal!(RangeOfRanges, opt) frontTransversal(
static assert(is(FrontTransversal!(immutable int[][])));
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
auto dummies =
[DummyType.init, DummyType.init, DummyType.init, DummyType.init];
- foreach(i, ref elem; dummies) {
+ foreach (i, ref elem; dummies) {
// Just violate the DummyRange abstraction to get what I want.
elem.arr = elem.arr[i..$ - (3 - i)];
}
@@ -5886,7 +5886,7 @@ struct Transversal(Ror,
}
/// Ditto
- static if(hasLength!RangeOfRanges)
+ static if (hasLength!RangeOfRanges)
{
@property size_t length()
{
@@ -5979,7 +5979,7 @@ Transversal!(RangeOfRanges, opt) transversal
// Test w/o ref return.
alias D = DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random);
auto drs = [D.init, D.init];
- foreach(num; 0..10) {
+ foreach (num; 0..10) {
auto t = transversal!(TransverseOptions.enforceNotJagged)(drs, num);
assert(t[0] == t[1]);
assert(t[1] == num + 1);
@@ -6145,7 +6145,7 @@ bidirectional or random-access if $(D Indices) is bidirectional or
random-access, respectively.
*/
struct Indexed(Source, Indices)
- if(isRandomAccessRange!Source && isInputRange!Indices &&
+ if (isRandomAccessRange!Source && isInputRange!Indices &&
is(typeof(Source.init[ElementType!(Indices).init])))
{
this(Source source, Indices indices)
@@ -6168,7 +6168,7 @@ struct Indexed(Source, Indices)
_indices.popFront();
}
- static if(isInfinite!Indices)
+ static if (isInfinite!Indices)
{
enum bool empty = false;
}
@@ -6181,7 +6181,7 @@ struct Indexed(Source, Indices)
}
}
- static if(isForwardRange!Indices)
+ static if (isForwardRange!Indices)
{
/// Ditto
@property typeof(this) save()
@@ -6192,7 +6192,7 @@ struct Indexed(Source, Indices)
}
/// Ditto
- static if(hasAssignableElements!Source)
+ static if (hasAssignableElements!Source)
{
@property auto ref front(ElementType!Source newVal)
{
@@ -6202,7 +6202,7 @@ struct Indexed(Source, Indices)
}
- static if(hasMobileElements!Source)
+ static if (hasMobileElements!Source)
{
/// Ditto
auto moveFront()
@@ -6212,7 +6212,7 @@ struct Indexed(Source, Indices)
}
}
- static if(isBidirectionalRange!Indices)
+ static if (isBidirectionalRange!Indices)
{
/// Ditto
@property auto ref back()
@@ -6229,7 +6229,7 @@ struct Indexed(Source, Indices)
}
/// Ditto
- static if(hasAssignableElements!Source)
+ static if (hasAssignableElements!Source)
{
@property auto ref back(ElementType!Source newVal)
{
@@ -6239,7 +6239,7 @@ struct Indexed(Source, Indices)
}
- static if(hasMobileElements!Source)
+ static if (hasMobileElements!Source)
{
/// Ditto
auto moveBack()
@@ -6250,7 +6250,7 @@ struct Indexed(Source, Indices)
}
}
- static if(hasLength!Indices)
+ static if (hasLength!Indices)
{
/// Ditto
@property size_t length()
@@ -6261,7 +6261,7 @@ struct Indexed(Source, Indices)
alias opDollar = length;
}
- static if(isRandomAccessRange!Indices)
+ static if (isRandomAccessRange!Indices)
{
/// Ditto
auto ref opIndex(size_t index)
@@ -6276,7 +6276,7 @@ struct Indexed(Source, Indices)
}
- static if(hasAssignableElements!Source)
+ static if (hasAssignableElements!Source)
{
/// Ditto
auto opIndexAssign(ElementType!Source newVal, size_t index)
@@ -6286,7 +6286,7 @@ struct Indexed(Source, Indices)
}
- static if(hasMobileElements!Source)
+ static if (hasMobileElements!Source)
{
/// Ditto
auto moveAt(size_t index)
@@ -6315,7 +6315,7 @@ struct Indexed(Source, Indices)
return _indices;
}
- static if(isRandomAccessRange!Indices)
+ static if (isRandomAccessRange!Indices)
{
/**
Returns the physical index into the source range corresponding to a
@@ -6380,7 +6380,7 @@ Indexed!(Source, Indices) indexed(Source, Indices)(Source source, Indices indice
{
import std.internal.test.dummyrange;
- foreach(DummyType; AllDummyRanges)
+ foreach (DummyType; AllDummyRanges)
{
auto d = DummyType.init;
auto r = indexed([1, 2, 3, 4, 5], d);
@@ -6963,7 +6963,7 @@ private struct OnlyResult(T, size_t arity)
// @@@BUG@@@ 10643
version(none)
{
- static if(hasElaborateAssign!T)
+ static if (hasElaborateAssign!T)
private T[arity] data;
else
private T[arity] data = void;
@@ -7054,7 +7054,7 @@ safely returned from functions. For the same reason, copying
the returned range may be expensive for a large number of arguments.
*/
auto only(Values...)(auto ref Values values)
- if(!is(CommonType!Values == void) || Values.length == 0)
+ if (!is(CommonType!Values == void) || Values.length == 0)
{
return OnlyResult!(CommonType!Values, Values.length)(values);
}
@@ -7166,12 +7166,12 @@ unittest
static assert(is(ElementType!(typeof(nums)) == long));
assert(nums.length == 3);
- foreach(i; 0 .. 3)
+ foreach (i; 0 .. 3)
assert(nums[i] == i + 1);
auto saved = nums.save;
- foreach(i; 1 .. 4)
+ foreach (i; 1 .. 4)
{
assert(nums.front == nums[0]);
assert(nums.front == i);
@@ -7196,7 +7196,7 @@ unittest
["one two", "one two three", "one two three four"];
string[] joinedRange = joined;
- foreach(argCount; AliasSeq!(2, 3, 4))
+ foreach (argCount; AliasSeq!(2, 3, 4))
{
auto values = only(data[0 .. argCount]);
alias Values = typeof(values);
@@ -7288,9 +7288,9 @@ in
alias LengthType = typeof(range.length);
bool overflow;
- static if(isSigned!Enumerator && isSigned!LengthType)
+ static if (isSigned!Enumerator && isSigned!LengthType)
auto result = adds(start, range.length, overflow);
- else static if(isSigned!Enumerator)
+ else static if (isSigned!Enumerator)
{
Largest!(Enumerator, Signed!LengthType) signedLength;
try signedLength = to!(typeof(signedLength))(range.length);
@@ -7303,7 +7303,7 @@ in
}
else
{
- static if(isSigned!LengthType)
+ static if (isSigned!LengthType)
assert(range.length >= 0);
auto result = addu(start, range.length, overflow);
}
@@ -7500,7 +7500,7 @@ pure @safe nothrow unittest
assert(enumerated[0 .. $].front == tuple(0, "zero"));
assert(enumerated[$ - 1 .. $].front == tuple(3, "three"));
- foreach(i; 0 .. 10)
+ foreach (i; 0 .. 10)
{
auto shifted = values[0 .. 2].enumerate(i);
assert(shifted.front == tuple(i, "zero"));
@@ -7514,7 +7514,7 @@ pure @safe nothrow unittest
assert(shifted.empty);
}
- foreach(T; AliasSeq!(ubyte, byte, uint, int))
+ foreach (T; AliasSeq!(ubyte, byte, uint, int))
{
auto inf = 42.repeat().enumerate(T.max);
alias Inf = typeof(inf);
@@ -7541,13 +7541,13 @@ pure @safe unittest
{
import std.algorithm : equal;
static immutable int[] values = [0, 1, 2, 3, 4];
- foreach(T; AliasSeq!(ubyte, ushort, uint, ulong))
+ foreach (T; AliasSeq!(ubyte, ushort, uint, ulong))
{
auto enumerated = values.enumerate!T();
static assert(is(typeof(enumerated.front.index) == T));
assert(enumerated.equal(values[].zip(values)));
- foreach(T i; 0 .. 5)
+ foreach (T i; 0 .. 5)
{
auto subset = values[cast(size_t)i .. $];
auto offsetEnumerated = subset.enumerate(i);
@@ -7582,7 +7582,7 @@ version(none) // @@@BUG@@@ 10939
}
SignedLengthRange svalues;
- foreach(Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long))
+ foreach (Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long))
{
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length));
@@ -7593,7 +7593,7 @@ version(none) // @@@BUG@@@ 10939
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1));
}
- foreach(Enumerator; AliasSeq!(byte, short, int))
+ foreach (Enumerator; AliasSeq!(byte, short, int))
{
assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator());
}
@@ -7724,7 +7724,7 @@ if (isInputRange!Range)
// Assertion only.
private void dbgVerifySorted()
{
- if(!__ctfe)
+ if (!__ctfe)
debug
{
static if (isRandomAccessRange!Range)
@@ -8118,9 +8118,9 @@ sgi.com/tech/stl/binary_search.html, binary_search).
bool contains(V)(V value)
if (isRandomAccessRange!Range)
{
- if(empty) return false;
+ if (empty) return false;
immutable i = getTransitionIndex!(SearchPolicy.binarySearch, geq)(value);
- if(i >= length) return false;
+ if (i >= length) return false;
return !predFun(value, _input[i]);
}
@@ -8409,7 +8409,7 @@ unittest
+/
struct RefRange(R)
- if(isInputRange!R)
+ if (isInputRange!R)
{
public:
@@ -8431,7 +8431,7 @@ public:
+/
auto opAssign(RefRange rhs)
{
- if(_range && rhs._range)
+ if (_range && rhs._range)
*_range = *rhs._range;
else
_range = rhs._range;
@@ -8471,12 +8471,12 @@ public:
return (*_range).front;
}
- static if(is(typeof((*(cast(const R*)_range)).front))) @property auto front() const
+ static if (is(typeof((*(cast(const R*)_range)).front))) @property auto front() const
{
return (*_range).front;
}
- static if(is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value)
+ static if (is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value)
{
return (*_range).front = value;
}
@@ -8488,7 +8488,7 @@ public:
@property bool empty(); ///
@property bool empty() const; ///Ditto
}
- else static if(isInfinite!R)
+ else static if (isInfinite!R)
enum empty = false;
else
{
@@ -8497,7 +8497,7 @@ public:
return (*_range).empty;
}
- static if(is(typeof((*cast(const R*)_range).empty))) @property bool empty() const
+ static if (is(typeof((*cast(const R*)_range).empty))) @property bool empty() const
{
return (*_range).empty;
}
@@ -8524,16 +8524,16 @@ public:
/++ Ditto +/
auto opSlice() const {assert(0);}
}
- else static if(isForwardRange!R)
+ else static if (isForwardRange!R)
{
- static if(isSafe!((R* r) => (*r).save))
+ static if (isSafe!((R* r) => (*r).save))
{
@property auto save() @trusted
{
mixin(_genSave());
}
- static if(is(typeof((*cast(const R*)_range).save))) @property auto save() @trusted const
+ static if (is(typeof((*cast(const R*)_range).save))) @property auto save() @trusted const
{
mixin(_genSave());
}
@@ -8545,7 +8545,7 @@ public:
mixin(_genSave());
}
- static if(is(typeof((*cast(const R*)_range).save))) @property auto save() const
+ static if (is(typeof((*cast(const R*)_range).save))) @property auto save() const
{
mixin(_genSave());
}
@@ -8586,19 +8586,19 @@ public:
/++ Ditto +/
@property auto back(ElementType!R value) {assert(0);}
}
- else static if(isBidirectionalRange!R)
+ else static if (isBidirectionalRange!R)
{
@property auto back()
{
return (*_range).back;
}
- static if(is(typeof((*(cast(const R*)_range)).back))) @property auto back() const
+ static if (is(typeof((*(cast(const R*)_range)).back))) @property auto back() const
{
return (*_range).back;
}
- static if(is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value)
+ static if (is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value)
{
return (*_range).back = value;
}
@@ -8606,7 +8606,7 @@ public:
/++ Ditto +/
- static if(isBidirectionalRange!R) void popBack()
+ static if (isBidirectionalRange!R) void popBack()
{
return (*_range).popBack();
}
@@ -8622,16 +8622,16 @@ public:
/++ Ditto +/
auto ref opIndex(IndexType)(IndexType index) const {assert(0);}
}
- else static if(isRandomAccessRange!R)
+ else static if (isRandomAccessRange!R)
{
auto ref opIndex(IndexType)(IndexType index)
- if(is(typeof((*_range)[index])))
+ if (is(typeof((*_range)[index])))
{
return (*_range)[index];
}
auto ref opIndex(IndexType)(IndexType index) const
- if(is(typeof((*cast(const R*)_range)[index])))
+ if (is(typeof((*cast(const R*)_range)[index])))
{
return (*_range)[index];
}
@@ -8642,7 +8642,7 @@ public:
Only defined if $(D hasMobileElements!R) and $(D isForwardRange!R) are
$(D true).
+/
- static if(hasMobileElements!R && isForwardRange!R) auto moveFront()
+ static if (hasMobileElements!R && isForwardRange!R) auto moveFront()
{
return (*_range).moveFront();
}
@@ -8652,7 +8652,7 @@ public:
Only defined if $(D hasMobileElements!R) and $(D isBidirectionalRange!R)
are $(D true).
+/
- static if(hasMobileElements!R && isBidirectionalRange!R) auto moveBack()
+ static if (hasMobileElements!R && isBidirectionalRange!R) auto moveBack()
{
return (*_range).moveBack();
}
@@ -8662,7 +8662,7 @@ public:
Only defined if $(D hasMobileElements!R) and $(D isRandomAccessRange!R)
are $(D true).
+/
- static if(hasMobileElements!R && isRandomAccessRange!R) auto moveAt(size_t index)
+ static if (hasMobileElements!R && isRandomAccessRange!R) auto moveAt(size_t index)
{
return (*_range).moveAt(index);
}
@@ -8678,14 +8678,14 @@ public:
/++ Ditto +/
@property auto length() const {assert(0);}
}
- else static if(hasLength!R)
+ else static if (hasLength!R)
{
@property auto length()
{
return (*_range).length;
}
- static if(is(typeof((*cast(const R*)_range).length))) @property auto length() const
+ static if (is(typeof((*cast(const R*)_range).length))) @property auto length() const
{
return (*_range).length;
}
@@ -8704,18 +8704,18 @@ public:
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const {assert(0);}
}
- else static if(hasSlicing!R)
+ else static if (hasSlicing!R)
{
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end)
- if(is(typeof((*_range)[begin .. end])))
+ if (is(typeof((*_range)[begin .. end])))
{
mixin(_genOpSlice());
}
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) const
- if(is(typeof((*cast(const R*)_range)[begin .. end])))
+ if (is(typeof((*cast(const R*)_range)[begin .. end])))
{
mixin(_genOpSlice());
}
@@ -9113,14 +9113,14 @@ unittest // issue 14575
then the original range is returned rather than a $(LREF RefRange).
+/
auto refRange(R)(R* range)
- if(isInputRange!R && !is(R == class))
+ if (isInputRange!R && !is(R == class))
{
return RefRange!R(range);
}
/// ditto
auto refRange(R)(R* range)
- if(isInputRange!R && is(R == class))
+ if (isInputRange!R && is(R == class))
{
return *range;
}
diff --git a/std/range/primitives.d b/std/range/primitives.d
index a98abfb8a..9fd8bfd56 100644
--- a/std/range/primitives.d
+++ b/std/range/primitives.d
@@ -188,7 +188,7 @@ guarantees that no more than a single element will be placed.
+/
private void doPut(R, E)(ref R r, auto ref E e)
{
- static if(is(PointerTarget!R == struct))
+ static if (is(PointerTarget!R == struct))
enum usingPut = hasMember!(PointerTarget!R, "put");
else
enum usingPut = hasMember!(R, "put");
@@ -321,7 +321,7 @@ void put(R, E)(ref R r, E e)
(is(E : const char[]) && is(typeof(doPut(r, char.max))) && !is(typeof(doPut(r, dchar.max))) && !is(typeof(doPut(r, wchar.max)))) ||
(is(E : const wchar[]) && is(typeof(doPut(r, wchar.max))) && !is(typeof(doPut(r, dchar.max)))) ) )
{
- foreach(c; e)
+ foreach (c; e)
doPut(r, c);
}
else
@@ -533,7 +533,7 @@ unittest
string result;
void put(const(C)[][] ss)
{
- foreach(s; ss)
+ foreach (s; ss)
result ~= to!string(s);
}
}
@@ -646,7 +646,7 @@ unittest
}
void foo()
{
- foreach(C; AliasSeq!(char, wchar, dchar))
+ foreach (C; AliasSeq!(char, wchar, dchar))
{
formattedWrite((C c){}, "", 1, 'a', cast(wchar)'a', cast(dchar)'a', "a"c, "a"w, "a"d);
formattedWrite((const(C)[]){}, "", 1, 'a', cast(wchar)'a', cast(dchar)'a', "a"c, "a"w, "a"d);
@@ -910,11 +910,11 @@ template isRandomAccessRange(R)
static assert(!isNarrowString!R);
static assert(hasLength!R || isInfinite!R);
- static if(is(typeof(r[$])))
+ static if (is(typeof(r[$])))
{
static assert(is(typeof(f) == typeof(r[$])));
- static if(!isInfinite!R)
+ static if (!isInfinite!R)
static assert(is(typeof(f) == typeof(r[$ - 1])));
}
}));
@@ -937,13 +937,13 @@ unittest
static assert(hasLength!R || isInfinite!R); // must have length or be infinite
// $ must work as it does with arrays if opIndex works with $
- static if(is(typeof(r[$])))
+ static if (is(typeof(r[$])))
{
static assert(is(typeof(f) == typeof(r[$])));
// $ - 1 doesn't make sense with infinite ranges but needs to work
// with finite ones.
- static if(!isInfinite!R)
+ static if (!isInfinite!R)
static assert(is(typeof(f) == typeof(r[$ - 1])));
}
}
@@ -1462,7 +1462,7 @@ The following code must compile for $(D hasSlicing) to be $(D true):
----
R r = void;
-static if(isInfinite!R)
+static if (isInfinite!R)
typeof(take(r, 1)) s = r[1 .. 2];
else
{
@@ -1472,13 +1472,13 @@ else
s = r[1 .. 2];
-static if(is(typeof(r[0 .. $])))
+static if (is(typeof(r[0 .. $])))
{
static assert(is(typeof(r[0 .. $]) == R));
R t = r[0 .. $];
t = r[0 .. $];
- static if(!isInfinite!R)
+ static if (!isInfinite!R)
{
static assert(is(typeof(r[0 .. $ - 1]) == R));
R u = r[0 .. $ - 1];
@@ -1497,7 +1497,7 @@ template hasSlicing(R)
{
R r = R.init;
- static if(isInfinite!R)
+ static if (isInfinite!R)
{
typeof(r[1 .. 1]) s = r[1 .. 2];
}
@@ -1509,13 +1509,13 @@ template hasSlicing(R)
s = r[1 .. 2];
- static if(is(typeof(r[0 .. $])))
+ static if (is(typeof(r[0 .. $])))
{
static assert(is(typeof(r[0 .. $]) == R));
R t = r[0 .. $];
t = r[0 .. $];
- static if(!isInfinite!R)
+ static if (!isInfinite!R)
{
static assert(is(typeof(r[0 .. $ - 1]) == R));
R u = r[0 .. $ - 1];
@@ -1964,7 +1964,7 @@ ElementType!R moveAt(R)(R r, size_t i)
@safe unittest
{
auto a = [1,2,3,4];
- foreach(idx, it; a)
+ foreach (idx, it; a)
{
assert(it == moveAt(a, idx));
}
@@ -1974,7 +1974,7 @@ ElementType!R moveAt(R)(R r, size_t i)
{
import std.internal.test.dummyrange;
- foreach(DummyType; AllDummyRanges) {
+ foreach (DummyType; AllDummyRanges) {
auto d = DummyType.init;
assert(moveFront(d) == 1);
@@ -2066,10 +2066,10 @@ if (isNarrowString!(C[]))
{
assert(str.length, "Attempting to popFront() past the end of an array of " ~ C.stringof);
- static if(is(Unqual!C == char))
+ static if (is(Unqual!C == char))
{
immutable c = str[0];
- if(c < 0x80)
+ if (c < 0x80)
{
//ptr is used to avoid unnnecessary bounds checking.
str = str.ptr[1 .. str.length];
@@ -2078,7 +2078,7 @@ if (isNarrowString!(C[]))
{
import core.bitop : bsr;
auto msbs = 7 - bsr(~c);
- if((msbs < 2) | (msbs > 6))
+ if ((msbs < 2) | (msbs > 6))
{
//Invalid UTF-8
msbs = 1;
@@ -2086,7 +2086,7 @@ if (isNarrowString!(C[]))
str = str[msbs .. $];
}
}
- else static if(is(Unqual!C == wchar))
+ else static if (is(Unqual!C == wchar))
{
immutable u = str[0];
str = str[1 + (u >= 0xD800 && u <= 0xDBFF) .. $];
@@ -2098,14 +2098,14 @@ if (isNarrowString!(C[]))
{
import std.meta : AliasSeq;
- foreach(S; AliasSeq!(string, wstring, dstring))
+ foreach (S; AliasSeq!(string, wstring, dstring))
{
S s = "\xC2\xA9hello";
s.popFront();
assert(s == "hello");
S str = "hello\U00010143\u0100\U00010143";
- foreach(dchar c; ['h', 'e', 'l', 'l', 'o', '\U00010143', '\u0100', '\U00010143'])
+ foreach (dchar c; ['h', 'e', 'l', 'l', 'o', '\U00010143', '\u0100', '\U00010143'])
{
assert(str.front == c);
str.popFront();
@@ -2118,7 +2118,7 @@ if (isNarrowString!(C[]))
C[] _eatString(C)(C[] str)
{
- while(!str.empty)
+ while (!str.empty)
str.popFront();
return str;
@@ -2172,7 +2172,7 @@ if (isNarrowString!(T[]))
{
import std.meta : AliasSeq;
- foreach(S; AliasSeq!(string, wstring, dstring))
+ foreach (S; AliasSeq!(string, wstring, dstring))
{
S s = "hello\xE2\x89\xA0";
s.popBack();
@@ -2184,7 +2184,7 @@ if (isNarrowString!(T[]))
assert(s3 == "");
S str = "\U00010143\u0100\U00010143hello";
- foreach(dchar ch; ['o', 'l', 'l', 'e', 'h', '\U00010143', '\u0100', '\U00010143'])
+ foreach (dchar ch; ['o', 'l', 'l', 'e', 'h', '\U00010143', '\u0100', '\U00010143'])
{
assert(str.back == ch);
str.popBack();
diff --git a/std/regex/internal/backtracking.d b/std/regex/internal/backtracking.d
index 613ac2816..f2d935f37 100644
--- a/std/regex/internal/backtracking.d
+++ b/std/regex/internal/backtracking.d
@@ -16,7 +16,7 @@ import std.range, std.typecons, std.traits, core.stdc.stdlib;
template BacktrackingMatcher(bool CTregex)
{
@trusted struct BacktrackingMatcher(Char, Stream = Input!Char)
- if(is(Char : dchar))
+ if (is(Char : dchar))
{
alias DataIndex = Stream.DataIndex;
struct State
@@ -31,7 +31,7 @@ template BacktrackingMatcher(bool CTregex)
alias RegEx = Regex!Char;
alias MatchFn = bool function (ref BacktrackingMatcher!(Char, Stream));
RegEx re; //regex program
- static if(CTregex)
+ static if (CTregex)
MatchFn nativeFn; //native code for that program
//Stream state
Stream s;
@@ -41,7 +41,7 @@ template BacktrackingMatcher(bool CTregex)
//backtracking machine state
uint pc, counter;
DataIndex lastState = 0; //top of state stack
- static if(!CTregex)
+ static if (!CTregex)
uint infiniteNesting;
size_t[] memory;
Trace[] merge;
@@ -53,7 +53,7 @@ template BacktrackingMatcher(bool CTregex)
bool mark(size_t idx)
{
auto d = idx - offset;
- if(d < 64) // including overflow
+ if (d < 64) // including overflow
{
auto p = mask & (1UL< 0)
+ static if (args.length > 0)
{
return format[0 .. i - 1] ~ to!string(args[0])
~ ctSub(format[i + 1 .. $], args[1 .. $]);
@@ -819,7 +819,7 @@ struct CtContext
stackPop(counter);"
: "
counter = 0;";
- if(match < total_matches)
+ if (match < total_matches)
{
text ~= ctSub("
stackPop(matches[$$..$$]);", reserved, match);
@@ -836,12 +836,12 @@ struct CtContext
string saveCode(uint pc, string count_expr="counter")
{
string text = ctSub("
- if(stackAvail < $$*(Group!(DataIndex)).sizeof/size_t.sizeof + $$)
+ if (stackAvail < $$*(Group!(DataIndex)).sizeof/size_t.sizeof + $$)
{
newStack();
lastState = 0;
}", match - reserved, cast(int)counter + 2);
- if(match < total_matches)
+ if (match < total_matches)
text ~= ctSub("
stackPush(matches[$$..$$]);", reserved, match);
else
@@ -859,7 +859,7 @@ struct CtContext
{
CtState result;
result.addr = addr;
- while(!ir.empty)
+ while (!ir.empty)
{
auto n = ctGenGroup(ir, result.addr);
result.code ~= n.code;
@@ -876,7 +876,7 @@ struct CtContext
auto nextInstr = ctSub("goto case $$;", addr+1);
CtState r;
assert(!ir.empty);
- switch(ir[0].code)
+ switch (ir[0].code)
{
case IR.InfiniteStart, IR.InfiniteBloomStart,IR.InfiniteQStart, IR.RepeatStart, IR.RepeatQStart:
bool infLoop =
@@ -921,7 +921,7 @@ struct CtContext
auto slice = ir[start .. end];
r.code ~= ctSub(`
case $$: //fake lookaround "atom"
- static if(typeof(matcher.s).isLoopback)
+ static if (typeof(matcher.s).isLoopback)
alias Lookaround = $$;
else
alias Lookaround = $$;
@@ -934,7 +934,7 @@ struct CtContext
auto save = index;
auto mem = malloc(initialMemory(re))[0..initialMemory(re)];
scope(exit) free(mem.ptr);
- static if(typeof(matcher.s).isLoopback)
+ static if (typeof(matcher.s).isLoopback)
auto lookaround = $$;
else
auto lookaround = $$;
@@ -944,7 +944,7 @@ struct CtContext
int match = $$;
s.reset(save);
next();
- if(match)
+ if (match)
$$
else
$$`, addr,
@@ -980,7 +980,7 @@ struct CtContext
{
assert(ir[0].code == IR.Option);
auto len = ir[0].data;
- if(optL+len < ir.length && ir[optL+len].code == IR.Option)//not a last option
+ if (optL+len < ir.length && ir[optL+len].code == IR.Option)//not a last option
{
auto nir = ir[optL .. optL+len-IRL!(IR.GotoEndOr)];
r = ctGenBlock(nir, addr+2);//space for Option + restore state
@@ -1022,7 +1022,7 @@ struct CtContext
r = ctSub(`
case $$: debug(std_regex_matcher) writeln("#$$");`,
addr, addr);
- switch(ir[0].code)
+ switch (ir[0].code)
{
case IR.InfiniteStart, IR.InfiniteQStart, IR.InfiniteBloomStart:
r ~= ctSub( `
@@ -1032,7 +1032,7 @@ struct CtContext
case IR.InfiniteEnd:
testCode = ctQuickTest(ir[IRL!(IR.InfiniteEnd) .. $],addr + 1);
r ~= ctSub( `
- if(merge[$$+counter].mark(index))
+ if (merge[$$+counter].mark(index))
{
// merged!
goto L_backtrack;
@@ -1053,7 +1053,7 @@ struct CtContext
//TODO: check bloom filter and skip on failure
testCode = ctQuickTest(ir[IRL!(IR.InfiniteBloomEnd) .. $],addr + 1);
r ~= ctSub( `
- if(merge[$$+counter].mark(index))
+ if (merge[$$+counter].mark(index))
{
// merged!
goto L_backtrack;
@@ -1074,7 +1074,7 @@ struct CtContext
testCode = ctQuickTest(ir[IRL!(IR.InfiniteEnd) .. $],addr + 1);
auto altCode = testCode.length ? ctSub("else goto case $$;", fixup) : "";
r ~= ctSub( `
- if(merge[$$+counter].mark(index))
+ if (merge[$$+counter].mark(index))
{
// merged!
goto L_backtrack;
@@ -1105,22 +1105,22 @@ struct CtContext
uint min = ir[3].raw;
uint max = ir[4].raw;
r ~= ctSub(`
- if(merge[$$+counter].mark(index))
+ if (merge[$$+counter].mark(index))
{
// merged!
goto L_backtrack;
}
- if(counter < $$)
+ if (counter < $$)
{
debug(std_regex_matcher) writeln("RepeatEnd min case pc=", $$);
counter += $$;
goto case $$;
}`, ir[1].raw, min, addr, step, fixup);
- if(ir[0].code == IR.RepeatEnd)
+ if (ir[0].code == IR.RepeatEnd)
{
string counter_expr = ctSub("counter % $$", step);
r ~= ctSub(`
- else if(counter < $$)
+ else if (counter < $$)
{
$$
counter += $$;
@@ -1131,7 +1131,7 @@ struct CtContext
{
string counter_expr = ctSub("counter % $$", step);
r ~= ctSub(`
- else if(counter < $$)
+ else if (counter < $$)
{
$$
counter = counter % $$;
@@ -1172,13 +1172,13 @@ struct CtContext
string ctQuickTest(Bytecode[] ir, int id)
{
uint pc = 0;
- while(pc < ir.length && ir[pc].isAtom)
+ while (pc < ir.length && ir[pc].isAtom)
{
- if(ir[pc].code == IR.GroupStart || ir[pc].code == IR.GroupEnd)
+ if (ir[pc].code == IR.GroupStart || ir[pc].code == IR.GroupEnd)
{
pc++;
}
- else if(ir[pc].code == IR.Backref)
+ else if (ir[pc].code == IR.Backref)
break;
else
{
@@ -1188,7 +1188,7 @@ struct CtContext
{
$$ //$$
}
- if(test_$$() >= 0)`, id, code.ptr ? code : "return 0;",
+ if (test_$$() >= 0)`, id, code.ptr ? code : "return 0;",
ir[pc].mnemonic, id);
}
}
@@ -1210,7 +1210,7 @@ struct CtContext
{
string code;
string bailOut, nextInstr;
- if(addr < 0)
+ if (addr < 0)
{
bailOut = "return -1;";
nextInstr = "return 0;";
@@ -1223,17 +1223,17 @@ struct CtContext
case $$: debug(std_regex_matcher) writeln("#$$");
`, addr, addr);
}
- switch(ir[0].code)
+ switch (ir[0].code)
{
case IR.OrChar://assumes IRL!(OrChar) == 1
code ~= ctSub(`
- if(atEnd)
+ if (atEnd)
$$`, bailOut);
uint len = ir[0].sequence;
for(uint i = 0; i < len; i++)
{
code ~= ctSub( `
- if(front == $$)
+ if (front == $$)
{
$$
$$
@@ -1244,43 +1244,43 @@ struct CtContext
break;
case IR.Char:
code ~= ctSub( `
- if(atEnd || front != $$)
+ if (atEnd || front != $$)
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
break;
case IR.Any:
code ~= ctSub( `
- if(atEnd || (!(re.flags & RegexOption.singleline)
+ if (atEnd || (!(re.flags & RegexOption.singleline)
&& (front == '\r' || front == '\n')))
$$
$$
$$`, bailOut, addr >= 0 ? "next();" :"",nextInstr);
break;
case IR.CodepointSet:
- if(charsets.length)
+ if (charsets.length)
{
string name = `func_`~to!string(addr+1);
string funcCode = charsets[ir[0].data].toSourceCode(name);
code ~= ctSub( `
static $$
- if(atEnd || !$$(front))
+ if (atEnd || !$$(front))
$$
$$
$$`, funcCode, name, bailOut, addr >= 0 ? "next();" :"", nextInstr);
}
else
code ~= ctSub( `
- if(atEnd || !re.charsets[$$].scanFor(front))
+ if (atEnd || !re.charsets[$$].scanFor(front))
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
break;
case IR.Trie:
- if(charsets.length && charsets[ir[0].data].byInterval.length <= 8)
+ if (charsets.length && charsets[ir[0].data].byInterval.length <= 8)
goto case IR.CodepointSet;
code ~= ctSub( `
- if(atEnd || !re.matchers[$$][front])
+ if (atEnd || !re.matchers[$$][front])
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
@@ -1289,20 +1289,20 @@ struct CtContext
code ~= ctSub( `
dchar back;
DataIndex bi;
- if(atStart && wordMatcher[front])
+ if (atStart && wordMatcher[front])
{
$$
}
- else if(atEnd && s.loopBack(index).nextChar(back, bi)
+ else if (atEnd && s.loopBack(index).nextChar(back, bi)
&& wordMatcher[back])
{
$$
}
- else if(s.loopBack(index).nextChar(back, bi))
+ else if (s.loopBack(index).nextChar(back, bi))
{
bool af = wordMatcher[front];
bool ab = wordMatcher[back];
- if(af ^ ab)
+ if (af ^ ab)
{
$$
}
@@ -1314,16 +1314,16 @@ struct CtContext
dchar back;
DataIndex bi;
//at start & end of input
- if(atStart && wordMatcher[front])
+ if (atStart && wordMatcher[front])
$$
- else if(atEnd && s.loopBack(index).nextChar(back, bi)
+ else if (atEnd && s.loopBack(index).nextChar(back, bi)
&& wordMatcher[back])
$$
- else if(s.loopBack(index).nextChar(back, bi))
+ else if (s.loopBack(index).nextChar(back, bi))
{
bool af = wordMatcher[front];
bool ab = wordMatcher[back];
- if(af ^ ab)
+ if (af ^ ab)
$$
}
$$`, bailOut, bailOut, bailOut, nextInstr);
@@ -1333,7 +1333,7 @@ struct CtContext
code ~= ctSub(`
dchar back;
DataIndex bi;
- if(atStart || ((re.flags & RegexOption.multiline)
+ if (atStart || ((re.flags & RegexOption.multiline)
&& s.loopBack(index).nextChar(back,bi)
&& endOfLine(back, front == '\n')))
{
@@ -1350,7 +1350,7 @@ struct CtContext
DataIndex bi;
debug(std_regex_matcher) writefln("EOL (front 0x%x) %s", front, s[index..s.lastIndex]);
//no matching inside \r\n
- if(atEnd || ((re.flags & RegexOption.multiline)
+ if (atEnd || ((re.flags & RegexOption.multiline)
&& endOfLine(front, s.loopBack(index).nextChar(back,bi)
&& back == '\r')))
{
@@ -1381,12 +1381,12 @@ struct CtContext
ir[0].data, ir[0].data);
code ~= ctSub( `
$$
- while(!atEnd && !referenced.empty && front == referenced.front)
+ while (!atEnd && !referenced.empty && front == referenced.front)
{
next();
referenced.popFront();
}
- if(referenced.empty)
+ if (referenced.empty)
$$
else
$$`, mStr, nextInstr, bailOut);
@@ -1416,7 +1416,7 @@ struct CtContext
goto StartLoop;
debug(std_regex_matcher) writeln("Try CT matching starting at ",s[index..s.lastIndex]);
L_backtrack:
- if(lastState || prevStack())
+ if (lastState || prevStack())
{
stackPop(pc);
stackPop(index);
@@ -1429,7 +1429,7 @@ struct CtContext
return false;
}
StartLoop:
- switch(pc)
+ switch (pc)
{
`;
r ~= bdy.code;
diff --git a/std/regex/internal/generator.d b/std/regex/internal/generator.d
index bc4871947..797ae42c8 100644
--- a/std/regex/internal/generator.d
+++ b/std/regex/internal/generator.d
@@ -41,7 +41,7 @@ module std.regex.internal.generator;
uint pc = 0, counter = 0, dataLenOld = uint.max;
for(;;)
{
- switch(re.ir[pc].code)
+ switch (re.ir[pc].code)
{
case IR.Char:
formattedWrite(app,"%s", cast(dchar)re.ir[pc].data);
@@ -65,7 +65,7 @@ module std.regex.internal.generator;
do
{
x = rand(0x11_000);
- }while(x == '\r' || x == '\n' || !isValidDchar(x));
+ }while (x == '\r' || x == '\n' || !isValidDchar(x));
formattedWrite(app, "%s", cast(dchar)x);
pc += IRL!(IR.Any);
break;
@@ -83,7 +83,7 @@ module std.regex.internal.generator;
uint next = pc + re.ir[pc].data + IRL!(IR.Option);
uint nOpt = 0;
//queue next Option
- while(re.ir[next].code == IR.Option)
+ while (re.ir[next].code == IR.Option)
{
nOpt++;
next += re.ir[next].data + IRL!(IR.Option);
@@ -105,16 +105,16 @@ module std.regex.internal.generator;
uint len = re.ir[pc].data;
uint step = re.ir[pc+2].raw;
uint min = re.ir[pc+3].raw;
- if(counter < min)
+ if (counter < min)
{
counter += step;
pc -= len;
break;
}
uint max = re.ir[pc+4].raw;
- if(counter < max)
+ if (counter < max)
{
- if(app.data.length < limit && rand(3) > 0)
+ if (app.data.length < limit && rand(3) > 0)
{
pc -= len;
counter += step;
@@ -136,13 +136,13 @@ module std.regex.internal.generator;
goto case IR.InfiniteEnd; //both Q and non-Q
case IR.InfiniteEnd, IR.InfiniteBloomEnd, IR.InfiniteQEnd:
uint len = re.ir[pc].data;
- if(app.data.length == dataLenOld)
+ if (app.data.length == dataLenOld)
{
pc += IRL!(IR.InfiniteEnd);
break;
}
dataLenOld = cast(uint)app.data.length;
- if(app.data.length < limit && rand(3) > 0)
+ if (app.data.length < limit && rand(3) > 0)
pc = pc - len;
else
pc = pc + re.ir[pc].length;
@@ -179,6 +179,6 @@ unittest
auto gen = SampleGenerator!char(re, 20, 3141592);
static assert(isInputRange!(typeof(gen)));
//@@@BUG@@@ somehow gen.take(1_000) doesn't work
- foreach(v; take(gen, 1_000))
+ foreach (v; take(gen, 1_000))
assert(v.match(re));
}
diff --git a/std/regex/internal/ir.d b/std/regex/internal/ir.d
index b890611b3..2792c61eb 100644
--- a/std/regex/internal/ir.d
+++ b/std/regex/internal/ir.d
@@ -31,14 +31,14 @@ CharMatcher[CodepointSet] matcherCache;
//accessor with caching
@trusted CharMatcher getMatcher(CodepointSet set)
{// @@@BUG@@@ 6357 almost all properties of AA are not @safe
- if(__ctfe || maxCachedMatchers == 0)
+ if (__ctfe || maxCachedMatchers == 0)
return CharMatcher(set);
else
{
auto p = set in matcherCache;
- if(p)
+ if (p)
return *p;
- if(matcherCache.length == maxCachedMatchers)
+ if (matcherCache.length == maxCachedMatchers)
{
// flush enmatchers in trieCache
matcherCache = null;
@@ -49,12 +49,12 @@ CharMatcher[CodepointSet] matcherCache;
@trusted auto memoizeExpr(string expr)()
{
- if(__ctfe)
+ if (__ctfe)
return mixin(expr);
alias T = typeof(mixin(expr));
static T slot;
static bool initialized;
- if(!initialized)
+ if (!initialized)
{
slot = mixin(expr);
initialized = true;
@@ -382,7 +382,7 @@ struct Group(DataIndex)
import std.array, std.format;
auto output = appender!string();
formattedWrite(output,"%s", irb[pc].mnemonic);
- switch(irb[pc].code)
+ switch (irb[pc].code)
{
case IR.Char:
formattedWrite(output, " %s (0x%x)",cast(dchar)irb[pc].data, irb[pc].data);
@@ -412,8 +412,8 @@ struct Group(DataIndex)
case IR.GroupStart, IR.GroupEnd:
uint n = irb[pc].data;
string name;
- foreach(v;dict)
- if(v.group == n)
+ foreach (v;dict)
+ if (v.group == n)
{
name = "'"~v.name~"'";
break;
@@ -429,12 +429,12 @@ struct Group(DataIndex)
case IR.Backref: case IR.CodepointSet: case IR.Trie:
uint n = irb[pc].data;
formattedWrite(output, " %u", n);
- if(irb[pc].code == IR.Backref)
+ if (irb[pc].code == IR.Backref)
formattedWrite(output, " %s", irb[pc].localRef ? "local" : "global");
break;
default://all data-free instructions
}
- if(irb[pc].hotspot)
+ if (irb[pc].hotspot)
formattedWrite(output, " Hotspot %u", irb[pc+1].raw);
return output.data;
}
@@ -523,7 +523,7 @@ package(std.regex):
//bit access helper
uint isBackref(uint n)
{
- if(n/32 >= backrefed.length)
+ if (n/32 >= backrefed.length)
return 0;
return backrefed[n / 32] & (1 << (n & 31));
}
@@ -531,12 +531,12 @@ package(std.regex):
//check if searching is not needed
void checkIfOneShot()
{
- if(flags & RegexOption.multiline)
+ if (flags & RegexOption.multiline)
return;
L_CheckLoop:
for(uint i = 0; i < ir.length; i += ir[i].length)
{
- switch(ir[i].code)
+ switch (ir[i].code)
{
case IR.Bol:
flags |= RegexInfo.oneShot;
@@ -588,7 +588,7 @@ package(std.regex):
//Simple UTF-string abstraction compatible with stream interface
struct Input(Char)
- if(is(Char :dchar))
+ if (is(Char :dchar))
{
import std.utf;
alias DataIndex = size_t;
@@ -610,7 +610,7 @@ struct Input(Char)
pos = _index;
// DMD's inliner hates multiple return functions
// but can live with single statement if/else bodies
- if(_index == _origin.length)
+ if (_index == _origin.length)
return false;
else
return res = std.utf.decode(_origin, _index), true;
@@ -652,7 +652,7 @@ struct BackLooperImpl(Input)
@trusted bool nextChar(ref dchar res,ref size_t pos)
{
pos = _index;
- if(_index == 0)
+ if (_index == 0)
return false;
res = _origin[0.._index].back;
@@ -674,7 +674,7 @@ struct BackLooperImpl(Input)
template BackLooper(E)
{
- static if(is(E : BackLooperImpl!U, U))
+ static if (is(E : BackLooperImpl!U, U))
{
alias BackLooper = U;
}
@@ -739,8 +739,8 @@ struct BitTable {
uint[4] filter;
this(CodepointSet set){
- foreach(iv; set.byInterval){
- foreach(v; iv.a..iv.b)
+ foreach (iv; set.byInterval){
+ foreach (v; iv.a..iv.b)
add(v);
}
}
diff --git a/std/regex/internal/kickstart.d b/std/regex/internal/kickstart.d
index c5ec01026..ae12925ba 100644
--- a/std/regex/internal/kickstart.d
+++ b/std/regex/internal/kickstart.d
@@ -12,11 +12,11 @@ import std.algorithm, std.range, std.utf;
//utility for shiftOr, returns a minimum number of bytes to test in a Char
uint effectiveSize(Char)()
{
- static if(is(Char == char))
+ static if (is(Char == char))
return 1;
- else static if(is(Char == wchar))
+ else static if (is(Char == wchar))
return 2;
- else static if(is(Char == dchar))
+ else static if (is(Char == dchar))
return 3;
else
static assert(0);
@@ -63,7 +63,7 @@ private:
void set(alias setBits = setInvMask)(dchar ch)
{
- static if(charSize == 3)
+ static if (charSize == 3)
{
uint val = ch, tmask = mask;
setBits(val&0xFF, tmask);
@@ -83,9 +83,9 @@ private:
size_t total = encode(buf, ch);
for(size_t i = 0; i < total; i++, tmask<<=1)
{
- static if(charSize == 1)
+ static if (charSize == 1)
setBits(buf[i], tmask);
- else static if(charSize == 2)
+ else static if (charSize == 2)
{
setBits(buf[i]&0xFF, tmask);
tmask <<= 1;
@@ -115,7 +115,7 @@ private:
{
auto t = worklist[$-1];
worklist.length -= 1;
- if(!__ctfe)
+ if (!__ctfe)
cast(void)worklist.assumeSafeAppend();
return t;
}
@@ -136,7 +136,7 @@ public:
ulong hash(uint[] tab)
{
ulong h = 0xcbf29ce484222325;
- foreach(v; tab){
+ foreach (v; tab){
h ^= v;
h *= 0x100000001b3;
}
@@ -145,11 +145,11 @@ public:
L_FindChar:
for(size_t i = 0;;)
{
- switch(re.ir[i].code)
+ switch (re.ir[i].code)
{
case IR.Char:
fChar = re.ir[i].data;
- static if(charSize != 3)
+ static if (charSize != 3)
{
Char[dchar.sizeof/Char.sizeof] buf;
encode(buf, fChar);
@@ -181,11 +181,11 @@ public:
L_Eval_Thread:
for(;;)
{
- switch(re.ir[t.pc].code)
+ switch (re.ir[t.pc].code)
{
case IR.Char:
uint s = charLen(re.ir[t.pc].data);
- if(t.idx+s > n_length)
+ if (t.idx+s > n_length)
goto L_StopThread;
t.add(re.ir[t.pc].data);
t.advance(s);
@@ -199,7 +199,7 @@ public:
for(uint i = 0; i < len; i++)
{
auto x = charLen(re.ir[t.pc+i].data);
- if(countUntil(s[0..numS], x) < 0)
+ if (countUntil(s[0..numS], x) < 0)
s[numS++] = x;
}
for(uint i = t.pc; i < end; i++)
@@ -209,13 +209,13 @@ public:
for(uint i = 0; i < numS; i++)
{
auto tx = fork(t, t.pc + len, t.counter);
- if(tx.idx + s[i] <= n_length)
+ if (tx.idx + s[i] <= n_length)
{
tx.advance(s[i]);
trs ~= tx;
}
}
- if(!trs.empty)
+ if (!trs.empty)
t = fetch(trs);
else
goto L_StopThread;
@@ -225,7 +225,7 @@ public:
auto set = re.charsets[re.ir[t.pc].data];
uint[4] s;
uint numS;
- static if(charSize == 3)
+ static if (charSize == 3)
{
s[0] = charSize;
numS = 1;
@@ -233,13 +233,13 @@ public:
else
{
- static if(charSize == 1)
+ static if (charSize == 1)
static immutable codeBounds = [0x0, 0x7F, 0x80, 0x7FF, 0x800, 0xFFFF, 0x10000, 0x10FFFF];
else //== 2
static immutable codeBounds = [0x0, 0xFFFF, 0x10000, 0x10FFFF];
uint[] arr = new uint[set.byInterval.length * 2];
size_t ofs = 0;
- foreach(ival; set.byInterval)
+ foreach (ival; set.byInterval)
{
arr[ofs++] = ival.a;
arr[ofs++] = ival.b;
@@ -249,19 +249,19 @@ public:
{
auto start = srange.lowerBound(codeBounds[2*i]).length;
auto end = srange.lowerBound(codeBounds[2*i+1]).length;
- if(end > start || (end == start && (end & 1)))
+ if (end > start || (end == start && (end & 1)))
s[numS++] = (i+1)*charSize;
}
}
- if(numS == 0 || t.idx + s[numS-1] > n_length)
+ if (numS == 0 || t.idx + s[numS-1] > n_length)
goto L_StopThread;
auto chars = set.length;
- if(chars > charsetThreshold)
+ if (chars > charsetThreshold)
goto L_StopThread;
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
{
//avoid surrogate pairs
- if(0xD800 <= ch && ch <= 0xDFFF)
+ if (0xD800 <= ch && ch <= 0xDFFF)
continue;
t.add(ch);
}
@@ -271,7 +271,7 @@ public:
tx.advance(s[i]);
trs ~= tx;
}
- if(!trs.empty)
+ if (!trs.empty)
t = fetch(trs);
else
goto L_StopThread;
@@ -286,7 +286,7 @@ public:
case IR.OrEnd:
auto slot = re.ir[t.pc+1].raw+t.counter;
auto val = hash(t.tab);
- if(val in merge[slot])
+ if (val in merge[slot])
goto L_StopThread; // merge equivalent
merge[slot][val] = true;
t.pc += IRL!(IR.OrEnd);
@@ -297,7 +297,7 @@ public:
case IR.Option:
uint next = t.pc + re.ir[t.pc].data + IRL!(IR.Option);
//queue next Option
- if(re.ir[next].code == IR.Option)
+ if (re.ir[next].code == IR.Option)
{
trs ~= fork(t, next, t.counter);
}
@@ -310,20 +310,20 @@ public:
case IR.RepeatQEnd:
auto slot = re.ir[t.pc+1].raw+t.counter;
auto val = hash(t.tab);
- if(val in merge[slot])
+ if (val in merge[slot])
goto L_StopThread; // merge equivalent
merge[slot][val] = true;
uint len = re.ir[t.pc].data;
uint step = re.ir[t.pc+2].raw;
uint min = re.ir[t.pc+3].raw;
- if(t.counter < min)
+ if (t.counter < min)
{
t.counter += step;
t.pc -= len;
break;
}
uint max = re.ir[t.pc+4].raw;
- if(t.counter < max)
+ if (t.counter < max)
{
trs ~= fork(t, t.pc - len, t.counter + step);
t.counter = t.counter%step;
@@ -342,12 +342,12 @@ public:
case IR.InfiniteQEnd:
auto slot = re.ir[t.pc+1].raw+t.counter;
auto val = hash(t.tab);
- if(val in merge[slot])
+ if (val in merge[slot])
goto L_StopThread; // merge equivalent
merge[slot][val] = true;
uint len = re.ir[t.pc].data;
uint pc1, pc2; //branches to take in priority order
- if(++t.hops == 32)
+ if (++t.hops == 32)
goto L_StopThread;
pc1 = t.pc + IRL!(IR.InfiniteEnd);
pc2 = t.pc - len;
@@ -371,7 +371,7 @@ public:
break L_Eval_Thread;
}
}
- if(trs.empty)
+ if (trs.empty)
break;
t = fetch(trs);
}
@@ -397,28 +397,28 @@ public:
uint state = uint.max;
uint limit = 1u<<(n_length - 1u);
debug(std_regex_search) writefln("Limit: %32b",limit);
- if(fChar != uint.max)
+ if (fChar != uint.max)
{
const(ubyte)* end = cast(ubyte*)(haystack.ptr + haystack.length);
const orginalAlign = cast(size_t)p & (Char.sizeof-1);
- while(p != end)
+ while (p != end)
{
- if(!~state)
+ if (!~state)
{//speed up seeking first matching place
for(;;)
{
assert(p <= end, text(p," vs ", end));
p = cast(ubyte*)memchr(p, fChar, end - p);
- if(!p)
+ if (!p)
return haystack.length;
- if((cast(size_t)p & (Char.sizeof-1)) == orginalAlign)
+ if ((cast(size_t)p & (Char.sizeof-1)) == orginalAlign)
break;
- if(++p == end)
+ if (++p == end)
return haystack.length;
}
state = ~1u;
assert((cast(size_t)p & (Char.sizeof-1)) == orginalAlign);
- static if(charSize == 3)
+ static if (charSize == 3)
{
state = (state<<1) | table[p[1]];
state = (state<<1) | table[p[2]];
@@ -427,14 +427,14 @@ public:
else
p++;
//first char is tested, see if that's all
- if(!(state & limit))
+ if (!(state & limit))
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
else
{//have some bits/states for possible matches,
//use the usual shift-or cycle
- static if(charSize == 3)
+ static if (charSize == 3)
{
state = (state<<1) | table[p[0]];
state = (state<<1) | table[p[1]];
@@ -446,7 +446,7 @@ public:
state = (state<<1) | table[p[0]];
p++;
}
- if(!(state & limit))
+ if (!(state & limit))
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
@@ -456,16 +456,16 @@ public:
else
{
//normal path, partially unrolled for char/wchar
- static if(charSize == 3)
+ static if (charSize == 3)
{
const(ubyte)* end = cast(ubyte*)(haystack.ptr + haystack.length);
- while(p != end)
+ while (p != end)
{
state = (state<<1) | table[p[0]];
state = (state<<1) | table[p[1]];
state = (state<<1) | table[p[2]];
p += 4;
- if(!(state & limit))//division rounds down for dchar
+ if (!(state & limit))//division rounds down for dchar
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
@@ -474,20 +474,20 @@ public:
{
auto len = cast(ubyte*)(haystack.ptr + haystack.length) - p;
size_t i = 0;
- if(len & 1)
+ if (len & 1)
{
state = (state<<1) | table[p[i++]];
- if(!(state & limit))
+ if (!(state & limit))
return idx+i/Char.sizeof-length;
}
- while(i < len)
+ while (i < len)
{
state = (state<<1) | table[p[i++]];
- if(!(state & limit))
+ if (!(state & limit))
return idx+i/Char.sizeof
-length;
state = (state<<1) | table[p[i++]];
- if(!(state & limit))
+ if (!(state & limit))
return idx+i/Char.sizeof
-length;
debug(std_regex_search) writefln("State: %32b", state);
@@ -512,7 +512,7 @@ unittest
import std.conv, std.regex;
@trusted void test_fixed(alias Kick)()
{
- foreach(i, v; AliasSeq!(char, wchar, dchar))
+ foreach (i, v; AliasSeq!(char, wchar, dchar))
{
alias Char = v;
alias String = immutable(v)[];
@@ -538,7 +538,7 @@ unittest
}
@trusted void test_flex(alias Kick)()
{
- foreach(i, v; AliasSeq!(char, wchar, dchar))
+ foreach (i, v; AliasSeq!(char, wchar, dchar))
{
alias Char = v;
alias String = immutable(v)[];
diff --git a/std/regex/internal/parser.d b/std/regex/internal/parser.d
index de9b43fa3..9bd62a2f6 100644
--- a/std/regex/internal/parser.d
+++ b/std/regex/internal/parser.d
@@ -38,7 +38,7 @@ auto makeRegex(S, CG)(Parser!(S, CG) p)
// helper for unittest
auto makeRegex(S)(S arg)
- if(isSomeString!S)
+ if (isSomeString!S)
{
return makeRegex(Parser!(S, CodeGen)(arg, ""));
}
@@ -88,18 +88,18 @@ unittest
for(uint pc = start; pc < end; )
{
uint len = code[pc].length;
- if(code[pc].code == IR.GotoEndOr)
+ if (code[pc].code == IR.GotoEndOr)
break; //pick next alternation branch
- if(code[pc].isAtom)
+ if (code[pc].isAtom)
{
rev[revPc - len .. revPc] = code[pc .. pc + len];
revPc -= len;
pc += len;
}
- else if(code[pc].isStart || code[pc].isEnd)
+ else if (code[pc].isStart || code[pc].isEnd)
{
//skip over other embedded lookbehinds they are reversed
- if(code[pc].code == IR.LookbehindStart
+ if (code[pc].code == IR.LookbehindStart
|| code[pc].code == IR.NeglookbehindStart)
{
uint blockLen = len + code[pc].data
@@ -113,15 +113,15 @@ unittest
uint secLen = code[second].length;
rev[revPc - secLen .. revPc] = code[second .. second + secLen];
revPc -= secLen;
- if(code[pc].code == IR.OrStart)
+ if (code[pc].code == IR.OrStart)
{
//we pass len bytes forward, but secLen in reverse
uint revStart = revPc - (second + len - secLen - pc);
uint r = revStart;
uint i = pc + IRL!(IR.OrStart);
- while(code[i].code == IR.Option)
+ while (code[i].code == IR.Option)
{
- if(code[i - 1].code != IR.OrStart)
+ if (code[i - 1].code != IR.OrStart)
{
assert(code[i - 1].code == IR.GotoEndOr);
rev[r - 1] = code[i - 1];
@@ -130,7 +130,7 @@ unittest
auto newStart = i + IRL!(IR.Option);
auto newEnd = newStart + code[i].data;
auto newRpc = r + code[i].data + IRL!(IR.Option);
- if(code[newEnd].code != IR.OrEnd)
+ if (code[newEnd].code != IR.OrEnd)
{
newRpc--;
}
@@ -146,7 +146,7 @@ unittest
pc += len;
}
}
- if(stack.empty)
+ if (stack.empty)
break;
start = stack.top[0];
end = stack.top[1];
@@ -166,11 +166,11 @@ dchar parseUniHex(Char)(ref Char[] str, size_t maxDigit)
for(int k = 0; k < maxDigit; k++)
{
auto current = str[k];//accepts ascii only, so it's OK to index directly
- if('0' <= current && current <= '9')
+ if ('0' <= current && current <= '9')
val = val * 16 + current - '0';
- else if('a' <= current && current <= 'f')
+ else if ('a' <= current && current <= 'f')
val = val * 16 + current -'a' + 10;
- else if('A' <= current && current <= 'F')
+ else if ('A' <= current && current <= 'F')
val = val * 16 + current - 'A' + 10;
else
throw new Exception("invalid escape sequence");
@@ -185,10 +185,10 @@ dchar parseUniHex(Char)(ref Char[] str, size_t maxDigit)
string[] non_hex = [ "000j", "000z", "FffG", "0Z"];
string[] hex = [ "01", "ff", "00af", "10FFFF" ];
int[] value = [ 1, 0xFF, 0xAF, 0x10FFFF ];
- foreach(v; non_hex)
+ foreach (v; non_hex)
assert(collectException(parseUniHex(v, v.length)).msg
.canFind("invalid escape sequence"));
- foreach(i, v; hex)
+ foreach (i, v; hex)
assert(parseUniHex(v, v.length) == value[i]);
string over = "0011FFFF";
assert(collectException(parseUniHex(over, over.length)).msg
@@ -200,7 +200,7 @@ auto caseEnclose(CodepointSet set)
auto cased = set & unicode.LC;
foreach (dchar ch; cased.byCodepoint)
{
- foreach(c; simpleCaseFoldings(ch))
+ foreach (c; simpleCaseFoldings(ch))
set |= c;
}
return set;
@@ -213,9 +213,9 @@ auto caseEnclose(CodepointSet set)
{
CodepointSet s = unicode(name);
//FIXME: caseEnclose for new uni as Set | CaseEnclose(SET && LC)
- if(casefold)
+ if (casefold)
s = caseEnclose(s);
- if(negated)
+ if (negated)
s = s.inverted;
return s;
}
@@ -235,7 +235,7 @@ auto caseEnclose(CodepointSet set)
assert(!empty);
auto val = data[$ - 1];
data = data[0 .. $ - 1];
- if(!__ctfe)
+ if (!__ctfe)
cast(void)data.assumeSafeAppend();
return val;
}
@@ -263,7 +263,7 @@ struct CodeGen
void start(uint length)
{
- if(!__ctfe)
+ if (!__ctfe)
ir.reserve((length*5+2)/4);
fixupStack.push(0);
groupStack.push(1);//0 - whole match
@@ -272,7 +272,7 @@ struct CodeGen
//mark referenced groups for latter processing
void markBackref(uint n)
{
- if(n/32 >= backrefed.length)
+ if (n/32 >= backrefed.length)
backrefed.length = n/32 + 1;
backrefed[n / 32] |= 1 << (n & 31);
}
@@ -303,9 +303,9 @@ struct CodeGen
@trusted void charsetToIr(CodepointSet set)
{//@@@BUG@@@ writeln is @system
uint chars = cast(uint)set.length;
- if(chars < Bytecode.maxSequence)
+ if (chars < Bytecode.maxSequence)
{
- switch(chars)
+ switch (chars)
{
case 1:
put(Bytecode(IR.Char, set.byCodepoint.front));
@@ -313,7 +313,7 @@ struct CodeGen
case 0:
throw new RegexException("empty CodepointSet not allowed");
default:
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
put(Bytecode(IR.OrChar, ch, chars));
}
}
@@ -322,15 +322,15 @@ struct CodeGen
import std.algorithm : countUntil;
auto ivals = set.byInterval;
auto n = charsets.countUntil(set);
- if(n >= 0)
+ if (n >= 0)
{
- if(ivals.length*2 > maxCharsetUsed)
+ if (ivals.length*2 > maxCharsetUsed)
put(Bytecode(IR.Trie, cast(uint)n));
else
put(Bytecode(IR.CodepointSet, cast(uint)n));
return;
}
- if(ivals.length*2 > maxCharsetUsed)
+ if (ivals.length*2 > maxCharsetUsed)
{
auto t = getMatcher(set);
put(Bytecode(IR.Trie, cast(uint)matchers.length));
@@ -409,7 +409,7 @@ struct CodeGen
//groups are cumulative across lookarounds
ir[fix+2] = Bytecode.fromRaw(groupStack.top+g);
groupStack.top += g;
- if(ir[fix].code == IR.LookbehindStart || ir[fix].code == IR.NeglookbehindStart)
+ if (ir[fix].code == IR.LookbehindStart || ir[fix].code == IR.NeglookbehindStart)
{
reverseBytecode(ir[fix + IRL!(IR.LookbehindStart) .. $]);
}
@@ -420,7 +420,7 @@ struct CodeGen
void fixRepetition(uint offset)
{
bool replace = ir[offset].code == IR.Nop;
- if(replace)
+ if (replace)
{
copy(ir[offset + 1 .. $], ir[offset .. $ - 1]);
ir.length -= 1;
@@ -432,12 +432,12 @@ struct CodeGen
{
bool replace = ir[offset].code == IR.Nop;
uint len = cast(uint)ir.length - offset - replace;
- if(max != infinite)
+ if (max != infinite)
{
- if(min != 1 || max != 1)
+ if (min != 1 || max != 1)
{
Bytecode op = Bytecode(greedy ? IR.RepeatStart : IR.RepeatQStart, len);
- if(replace)
+ if (replace)
ir[offset] = op;
else
insertInPlace(ir, offset, op);
@@ -449,12 +449,12 @@ struct CodeGen
counterDepth = std.algorithm.max(counterDepth, nesting+1);
}
}
- else if(min) //&& max is infinite
+ else if (min) //&& max is infinite
{
- if(min != 1)
+ if (min != 1)
{
Bytecode op = Bytecode(greedy ? IR.RepeatStart : IR.RepeatQStart, len);
- if(replace)
+ if (replace)
ir[offset] = op;
else
insertInPlace(ir, offset, op);
@@ -466,7 +466,7 @@ struct CodeGen
putRaw(min);
counterDepth = std.algorithm.max(counterDepth, nesting+1);
}
- else if(replace)
+ else if (replace)
{
copy(ir[offset+1 .. $], ir[offset .. $-1]);
ir.length -= 1;
@@ -481,7 +481,7 @@ struct CodeGen
else//vanila {0,inf}
{
Bytecode op = Bytecode(greedy ? IR.InfiniteStart : IR.InfiniteQStart, len);
- if(replace)
+ if (replace)
ir[offset] = op;
else
insertInPlace(ir, offset, op);
@@ -494,7 +494,7 @@ struct CodeGen
void fixAlternation()
{
uint fix = fixupStack.top;
- if(ir.length > fix && ir[fix].code == IR.Option)
+ if (ir.length > fix && ir[fix].code == IR.Option)
{
ir[fix] = Bytecode(ir[fix].code, cast(uint)ir.length - fix);
put(Bytecode(IR.GotoEndOr, 0));
@@ -504,7 +504,7 @@ struct CodeGen
}
uint len, orStart;
//start a new option
- if(fixupStack.length == 1)
+ if (fixupStack.length == 1)
{//only root entry, effectively no fixup
len = cast(uint)ir.length + IRL!(IR.GotoEndOr);
orStart = 0;
@@ -532,10 +532,10 @@ struct CodeGen
ir[fix] = Bytecode(IR.OrStart, cast(uint)ir.length - fix - IRL!(IR.OrStart));
put(Bytecode(IR.OrEnd, cast(uint)ir.length - fix - IRL!(IR.OrStart)));
uint pc = fix + IRL!(IR.OrStart);
- while(ir[pc].code == IR.Option)
+ while (ir[pc].code == IR.Option)
{
pc = pc + ir[pc].data;
- if(ir[pc].code != IR.GotoEndOr)
+ if (ir[pc].code != IR.GotoEndOr)
break;
ir[pc] = Bytecode(IR.GotoEndOr, cast(uint)(ir.length - pc - IRL!(IR.OrEnd)));
pc += IRL!(IR.GotoEndOr);
@@ -548,7 +548,7 @@ struct CodeGen
{
nesting--;
uint fix = popFixup();
- switch(ir[fix].code)
+ switch (ir[fix].code)
{
case IR.GroupStart:
put(Bytecode(IR.GroupEnd, ir[fix].data));
@@ -561,7 +561,7 @@ struct CodeGen
//two fixups: last option + full OR
finishAlternation(fix);
fix = topFixup;
- switch(ir[fix].code)
+ switch (ir[fix].code)
{
case IR.GroupStart:
popFixup();
@@ -612,7 +612,7 @@ struct Parser(R, Generator)
Generator g;
@trusted this(S)(R pattern, S flags)
- if(isSomeString!S)
+ if (isSomeString!S)
{
pat = origin = pattern;
//reserve slightly more then avg as sampled from unittests
@@ -635,7 +635,7 @@ struct Parser(R, Generator)
bool _next()
{
- if(pat.empty)
+ if (pat.empty)
{
empty = true;
return false;
@@ -647,12 +647,12 @@ struct Parser(R, Generator)
void skipSpace()
{
- while(isWhite(current) && _next()){ }
+ while (isWhite(current) && _next()){ }
}
bool next()
{
- if(re_flags & RegexOption.freeform)
+ if (re_flags & RegexOption.freeform)
{
bool r = _next();
skipSpace();
@@ -666,12 +666,12 @@ struct Parser(R, Generator)
uint parseDecimal()
{
uint r = 0;
- while(std.ascii.isDigit(current))
+ while (std.ascii.isDigit(current))
{
- if(r >= (uint.max/10))
+ if (r >= (uint.max/10))
error("Overflow in decimal number");
r = 10*r + cast(uint)(current-'0');
- if(!next())
+ if (!next())
break;
}
return r;
@@ -690,16 +690,16 @@ struct Parser(R, Generator)
@trusted void parseFlags(S)(S flags)
{//@@@BUG@@@ text is @system
import std.conv;
- foreach(ch; flags)//flags are ASCII anyway
+ foreach (ch; flags)//flags are ASCII anyway
{
L_FlagSwitch:
- switch(ch)
+ switch (ch)
{
- foreach(i, op; __traits(allMembers, RegexOption))
+ foreach (i, op; __traits(allMembers, RegexOption))
{
case RegexOptionNames[i]:
- if(re_flags & mixin("RegexOption."~op))
+ if (re_flags & mixin("RegexOption."~op))
throw new RegexException(text("redundant flag specified: ",ch));
re_flags |= mixin("RegexOption."~op);
break L_FlagSwitch;
@@ -715,25 +715,25 @@ struct Parser(R, Generator)
{
uint fix;//fixup pointer
- while(!empty)
+ while (!empty)
{
debug(std_regex_parser)
__ctfe || writeln("*LR*\nSource: ", pat, "\nStack: ",fixupStack.data);
- switch(current)
+ switch (current)
{
case '(':
next();
- if(current == '?')
+ if (current == '?')
{
next();
- switch(current)
+ switch (current)
{
case '#':
for(;;)
{
- if(!next())
+ if (!next())
error("Unexpected end of pattern");
- if(current == ')')
+ if (current == ')')
{
next();
break;
@@ -754,27 +754,27 @@ struct Parser(R, Generator)
break;
case 'P':
next();
- if(current != '<')
+ if (current != '<')
error("Expected '<' in named group");
string name;
- if(!next() || !(isAlpha(current) || current == '_'))
+ if (!next() || !(isAlpha(current) || current == '_'))
error("Expected alpha starting a named group");
name ~= current;
- while(next() && (isAlpha(current) ||
+ while (next() && (isAlpha(current) ||
current == '_' || std.ascii.isDigit(current)))
{
name ~= current;
}
- if(current != '>')
+ if (current != '>')
error("Expected '>' closing named group");
next();
g.genNamedGroup(name);
break;
case '<':
next();
- if(current == '=')
+ if (current == '=')
g.genLookaround(IR.LookbehindStart);
- else if(current == '!')
+ else if (current == '!')
g.genLookaround(IR.NeglookbehindStart);
else
error("'!' or '=' expected after '<'");
@@ -793,7 +793,7 @@ struct Parser(R, Generator)
enforce(g.nesting, "Unmatched ')'");
next();
auto pair = g.onClose();
- if(pair[0])
+ if (pair[0])
parseQuantifier(pair[1]);
break;
case '|':
@@ -807,7 +807,7 @@ struct Parser(R, Generator)
}
}
- if(g.fixupLength != 1)
+ if (g.fixupLength != 1)
{
fix = g.popFixup();
g.finishAlternation(fix);
@@ -819,10 +819,10 @@ struct Parser(R, Generator)
//parse and store IR for atom-quantifier pair
@trusted void parseQuantifier(uint offset)
{//copy is @system
- if(empty)
+ if (empty)
return g.fixRepetition(offset);
uint min, max;
- switch(current)
+ switch (current)
{
case '*':
min = 0;
@@ -840,24 +840,24 @@ struct Parser(R, Generator)
enforce(next(), "Unexpected end of regex pattern");
enforce(std.ascii.isDigit(current), "First number required in repetition");
min = parseDecimal();
- if(current == '}')
+ if (current == '}')
max = min;
- else if(current == ',')
+ else if (current == ',')
{
next();
- if(std.ascii.isDigit(current))
+ if (std.ascii.isDigit(current))
max = parseDecimal();
- else if(current == '}')
+ else if (current == '}')
max = infinite;
else
error("Unexpected symbol in regex pattern");
skipSpace();
- if(current != '}')
+ if (current != '}')
error("Unmatched '{' in regex pattern");
}
else
error("Unexpected symbol in regex pattern");
- if(min > max)
+ if (min > max)
error("Illegal {n,m} quantifier");
break;
default:
@@ -866,7 +866,7 @@ struct Parser(R, Generator)
}
bool greedy = true;
//check only if we managed to get new symbol
- if(next() && current == '?')
+ if (next() && current == '?')
{
greedy = false;
next();
@@ -877,9 +877,9 @@ struct Parser(R, Generator)
//parse and store IR for atom
void parseAtom()
{
- if(empty)
+ if (empty)
return;
- switch(current)
+ switch (current)
{
case '*', '?', '+', '|', '{', '}':
error("'*', '+', '?', '{', '}' not allowed in atom");
@@ -905,14 +905,14 @@ struct Parser(R, Generator)
break;
default:
//FIXME: getCommonCasing in new std uni
- if(re_flags & RegexOption.casefold)
+ if (re_flags & RegexOption.casefold)
{
auto range = simpleCaseFoldings(current);
assert(range.length <= 5);
- if(range.length == 1)
+ if (range.length == 1)
g.put(Bytecode(IR.Char, range.front));
else
- foreach(v; range)
+ foreach (v; range)
g.put(Bytecode(IR.OrChar, v, cast(uint)range.length));
}
else
@@ -941,10 +941,10 @@ struct Parser(R, Generator)
static void addWithFlags(ref CodepointSet set, uint ch, uint re_flags)
{
- if(re_flags & RegexOption.casefold)
+ if (re_flags & RegexOption.casefold)
{
auto range = simpleCaseFoldings(ch);
- foreach(v; range)
+ foreach (v; range)
set |= v;
}
else
@@ -953,7 +953,7 @@ struct Parser(R, Generator)
static Operator twinSymbolOperator(dchar symbol)
{
- switch(symbol)
+ switch (symbol)
{
case '|':
return Operator.Union;
@@ -971,10 +971,10 @@ struct Parser(R, Generator)
L_CharTermLoop:
for(;;)
{
- final switch(state)
+ final switch (state)
{
case State.Start:
- switch(current)
+ switch (current)
{
case '|':
case '-':
@@ -998,7 +998,7 @@ struct Parser(R, Generator)
break;
case State.Char:
// xxx last current xxx
- switch(current)
+ switch (current)
{
case '|':
case '~':
@@ -1030,7 +1030,7 @@ struct Parser(R, Generator)
case State.PotentialTwinSymbolOperator:
// xxx last current xxxx
// where last = [|-&~]
- if(current == last)
+ if (current == last)
{
op = twinSymbolOperator(last);
next();//skip second twin char
@@ -1039,7 +1039,7 @@ struct Parser(R, Generator)
goto case State.Char;
case State.Escape:
// xxx \ current xxx
- switch(current)
+ switch (current)
{
case 'f':
last = '\f';
@@ -1065,7 +1065,7 @@ struct Parser(R, Generator)
last = parseControlCode();
state = State.Char;
break;
- foreach(val; Escapables)
+ foreach (val; Escapables)
{
case val:
}
@@ -1122,7 +1122,7 @@ struct Parser(R, Generator)
break;
case State.CharDash:
// xxx last - current xxx
- switch(current)
+ switch (current)
{
case '[':
op = Operator.Union;
@@ -1142,7 +1142,7 @@ struct Parser(R, Generator)
break;
default:
enforce(last <= current, "inverted range");
- if(re_flags & RegexOption.casefold)
+ if (re_flags & RegexOption.casefold)
{
for(uint ch = last; ch <= current; ch++)
addWithFlags(set, ch, re_flags);
@@ -1155,7 +1155,7 @@ struct Parser(R, Generator)
case State.CharDashEscape:
//xxx last - \ current xxx
uint end;
- switch(current)
+ switch (current)
{
case 'f':
end = '\f';
@@ -1172,7 +1172,7 @@ struct Parser(R, Generator)
case 'v':
end = '\v';
break;
- foreach(val; Escapables)
+ foreach (val; Escapables)
{
case val:
}
@@ -1223,7 +1223,7 @@ struct Parser(R, Generator)
//
static bool apply(Operator op, ref ValStack stack)
{
- switch(op)
+ switch (op)
{
case Operator.Negate:
stack.top = stack.top.inverted;
@@ -1255,11 +1255,11 @@ struct Parser(R, Generator)
}
static bool unrollWhile(alias cond)(ref ValStack vstack, ref OpStack opstack)
{
- while(cond(opstack.top))
+ while (cond(opstack.top))
{
- if(!apply(opstack.pop(),vstack))
+ if (!apply(opstack.pop(),vstack))
return false;//syntax error
- if(opstack.empty)
+ if (opstack.empty)
return false;
}
return true;
@@ -1268,12 +1268,12 @@ struct Parser(R, Generator)
L_CharsetLoop:
do
{
- switch(current)
+ switch (current)
{
case '[':
opstack.push(Operator.Open);
enforce(next(), "unexpected end of character class");
- if(current == '^')
+ if (current == '^')
{
opstack.push(Operator.Negate);
enforce(next(), "unexpected end of character class");
@@ -1283,9 +1283,9 @@ struct Parser(R, Generator)
enforce(next(), "wrong character set");
auto pair = parseCharTerm();
pair[0].add(']', ']'+1);
- if(pair[1] != Operator.None)
+ if (pair[1] != Operator.None)
{
- if(opstack.top == Operator.Union)
+ if (opstack.top == Operator.Union)
unrollWhile!(unaryFun!"a == a.Union")(vstack, opstack);
opstack.push(pair[1]);
}
@@ -1298,16 +1298,16 @@ struct Parser(R, Generator)
enforce(!opstack.empty, "unmatched ']'");
opstack.pop();
next();
- if(opstack.empty)
+ if (opstack.empty)
break L_CharsetLoop;
auto pair = parseCharTerm();
- if(!pair[0].empty)//not only operator e.g. -- or ~~
+ if (!pair[0].empty)//not only operator e.g. -- or ~~
{
vstack.top.add(pair[0]);//apply union
}
- if(pair[1] != Operator.None)
+ if (pair[1] != Operator.None)
{
- if(opstack.top == Operator.Union)
+ if (opstack.top == Operator.Union)
unrollWhile!(unaryFun!"a == a.Union")(vstack, opstack);
opstack.push(pair[1]);
}
@@ -1315,17 +1315,17 @@ struct Parser(R, Generator)
//
default://yet another pair of term(op)?
auto pair = parseCharTerm();
- if(pair[1] != Operator.None)
+ if (pair[1] != Operator.None)
{
- if(opstack.top == Operator.Union)
+ if (opstack.top == Operator.Union)
unrollWhile!(unaryFun!"a == a.Union")(vstack, opstack);
opstack.push(pair[1]);
}
vstack.push(pair[0]);
}
- }while(!empty || !opstack.empty);
- while(!opstack.empty)
+ }while (!empty || !opstack.empty);
+ while (!opstack.empty)
apply(opstack.pop(),vstack);
assert(vstack.length == 1);
g.charsetToIr(vstack.top);
@@ -1335,7 +1335,7 @@ struct Parser(R, Generator)
@trusted void parseEscape()
{//accesses array of appender
- switch(current)
+ switch (current)
{
case 'f': next(); g.put(Bytecode(IR.Char, '\f')); break;
case 'n': next(); g.put(Bytecode(IR.Char, '\n')); break;
@@ -1398,15 +1398,15 @@ struct Parser(R, Generator)
enforce(nref < maxBackref, "Backref to unseen group");
//perl's disambiguation rule i.e.
//get next digit only if there is such group number
- while(nref < maxBackref && next() && std.ascii.isDigit(current))
+ while (nref < maxBackref && next() && std.ascii.isDigit(current))
{
nref = nref * 10 + current - '0';
}
- if(nref >= maxBackref)
+ if (nref >= maxBackref)
nref /= 10;
enforce(!g.isOpenGroup(nref), "Backref to open group");
uint localLimit = maxBackref - g.groupStack.top;
- if(nref >= localLimit)
+ if (nref >= localLimit)
{
g.put(Bytecode(IR.Backref, nref-localLimit));
g.ir[$-1].setLocalRef();
@@ -1416,7 +1416,7 @@ struct Parser(R, Generator)
g.markBackref(nref);
break;
default:
- if(current >= privateUseStart && current <= privateUseEnd)
+ if (current >= privateUseStart && current <= privateUseEnd)
{
g.endPattern(current - privateUseStart + 1);
break;
@@ -1435,10 +1435,10 @@ struct Parser(R, Generator)
char[MAX_PROPERTY] result;
uint k = 0;
enforce(next(), "eof parsing unicode property spec");
- if(current == '{')
+ if (current == '{')
{
- while(k < MAX_PROPERTY && next() && current !='}' && current !=':')
- if(current != '-' && current != ' ' && current != '_')
+ while (k < MAX_PROPERTY && next() && current !='}' && current !=':')
+ if (current != '-' && current != ' ' && current != '_')
result[k++] = cast(char)std.ascii.toLower(current);
enforce(k != MAX_PROPERTY, "invalid property name");
enforce(current == '}', "} expected ");
@@ -1495,14 +1495,14 @@ struct Parser(R, Generator)
ulong cumRange = 0;
for(uint i = 0; i < ir.length; i += ir[i].length)
{
- if(ir[i].hotspot)
+ if (ir[i].hotspot)
{
assert(i + 1 < ir.length,
"unexpected end of IR while looking for hotspot");
ir[i+1] = Bytecode.fromRaw(hotspotTableSize);
hotspotTableSize += counterRange.top;
}
- switch(ir[i].code)
+ switch (ir[i].code)
{
case IR.RepeatStart, IR.RepeatQStart:
uint repEnd = cast(uint)(i + ir[i].data + IRL!(IR.RepeatStart));
@@ -1523,12 +1523,12 @@ struct Parser(R, Generator)
counterRange.pop();
break;
case IR.GroupStart:
- if(isBackref(ir[i].data))
+ if (isBackref(ir[i].data))
ir[i].setBackrefence();
threadCount += counterRange.top;
break;
case IR.GroupEnd:
- if(isBackref(ir[i].data))
+ if (isBackref(ir[i].data))
ir[i].setBackrefence();
threadCount += counterRange.top;
break;
@@ -1537,7 +1537,7 @@ struct Parser(R, Generator)
}
}
checkIfOneShot();
- if(!(flags & RegexInfo.oneShot))
+ if (!(flags & RegexInfo.oneShot))
kickstart = Kickstart!Char(zis, new uint[](256));
debug(std_regex_allocation) writefln("IR processed, max threads: %d", threadCount);
optimize(zis);
@@ -1550,9 +1550,9 @@ void fixupBytecode()(Bytecode[] ir)
with(IR) for(uint i=0; i 1)
+ if (patterns.length > 1)
{
auto app = appender!S();
- foreach(i, p; patterns){
- if(i != 0)
+ foreach (i, p; patterns){
+ if (i != 0)
app.put("|");
app.put("(?:");
app.put(patterns[i]);
@@ -343,14 +343,14 @@ public alias StaticRegex(Char) = std.regex.internal.ir.StaticRegex!(Char);
else
pat = patterns[0];
- if(__ctfe)
+ if (__ctfe)
return regexImpl(pat, flags);
return memoize!(regexImpl!S, cacheSize)(pat, flags);
}
///ditto
@trusted public auto regex(S)(S pattern, const(char)[] flags="")
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
return regex([pattern], flags);
}
@@ -370,7 +370,7 @@ unittest
}
public auto regexImpl(S)(S pattern, const(char)[] flags="")
- if(isSomeString!(S))
+ if (isSomeString!(S))
{
import std.regex.internal.parser;
auto parser = Parser!(Unqual!(typeof(pattern)), CodeGen)(pattern, flags);
@@ -417,7 +417,7 @@ enum isRegexFor(RegEx, R) = is(RegEx == Regex!(BasicElementOf!R))
First element of range is the whole match.
+/
@trusted public struct Captures(R, DIndex = size_t)
- if(isSomeString!R)
+ if (isSomeString!R)
{//@trusted because of union inside
alias DataIndex = DIndex;
alias String = R;
@@ -463,7 +463,7 @@ private:
void newMatches(uint n)
{
import core.stdc.stdlib;
- if(n > smallString)
+ if (n > smallString)
{
auto p = cast(Group!DataIndex*)enforce(calloc(Group!DataIndex.sizeof,n), "Failed to allocate Captures struct");
big_matches = p[0..n];
@@ -483,7 +483,7 @@ private:
public:
this(this)
{
- if(!(_refcount & SMALL_MASK))
+ if (!(_refcount & SMALL_MASK))
{
_refcount++;
}
@@ -491,9 +491,9 @@ public:
~this()
{
import core.stdc.stdlib;
- if(!(_refcount & SMALL_MASK))
+ if (!(_refcount & SMALL_MASK))
{
- if(--_refcount == 0)
+ if (--_refcount == 0)
{
free(big_matches.ptr);
big_matches = null;
@@ -603,7 +603,7 @@ public:
----
+/
R opIndex(String)(String i) /*const*/ //@@@BUG@@@
- if(isSomeString!String)
+ if (isSomeString!String)
{
size_t index = lookupNamedGroup(_names, i);
return _input[matches[index].begin .. matches[index].end];
@@ -646,7 +646,7 @@ unittest
and is automatically deduced in a call to $(D match)/$(D bmatch).
+/
@trusted public struct RegexMatch(R, alias Engine = ThompsonMatcher)
- if(isSomeString!R)
+ if (isSomeString!R)
{
private:
import core.stdc.stdlib;
@@ -665,7 +665,7 @@ private:
scope(failure) free(_memory.ptr);
*cast(size_t*)_memory.ptr = 1;
_engine = EngineType(prog, Input!Char(input), _memory[size_t.sizeof..$]);
- static if(is(RegEx == StaticRegex!(BasicElementOf!R)))
+ static if (is(RegEx == StaticRegex!(BasicElementOf!R)))
_engine.nativeFn = prog.nativeFn;
_captures = Captures!(R,EngineType.DataIndex)(this);
_captures._nMatch = _engine.match(_captures.matches);
@@ -676,7 +676,7 @@ private:
public:
this(this)
{
- if(_memory.ptr)
+ if (_memory.ptr)
{
++counter;
debug(std_regex_allocation) writefln("RefCount (postblit): %x %d",
@@ -686,7 +686,7 @@ public:
~this()
{
- if(_memory.ptr && --*cast(size_t*)_memory.ptr == 0)
+ if (_memory.ptr && --*cast(size_t*)_memory.ptr == 0)
{
debug(std_regex_allocation) writefln("RefCount (dtor): %x %d",
_memory.ptr, *cast(size_t*)_memory.ptr);
@@ -733,7 +733,7 @@ public:
void popFront()
{
- if(counter != 1)
+ if (counter != 1)
{//do cow magic first
counter--;//we abandon this reference
immutable size = EngineType.initialMemory(_engine.re)+size_t.sizeof;
@@ -742,7 +742,7 @@ public:
counter = 1;//points to new chunk
}
- if(!_captures.unique)
+ if (!_captures.unique)
{
// has external references - allocate new space
_captures.newMatches(_engine.re.ngroup);
@@ -775,7 +775,7 @@ private @trusted auto matchOnce(alias Engine, RegEx, R)(R input, RegEx re)
scope(exit) free(memory.ptr);
auto captures = Captures!(R, EngineType.DataIndex)(input, re.ngroup, re.dict);
auto engine = EngineType(re, Input!Char(input), memory);
- static if(is(RegEx == StaticRegex!(BasicElementOf!R)))
+ static if (is(RegEx == StaticRegex!(BasicElementOf!R)))
engine.nativeFn = re.nativeFn;
captures._nMatch = engine.match(captures.matches);
return captures;
@@ -802,9 +802,9 @@ private enum isReplaceFunctor(alias fun, R) =
// the lowest level - just stuff replacements into the sink
private @trusted void replaceCapturesInto(alias output, Sink, R, T)
(ref Sink sink, R input, T captures)
- if(isOutputRange!(Sink, dchar) && isSomeString!R)
+ if (isOutputRange!(Sink, dchar) && isSomeString!R)
{
- if(captures.empty)
+ if (captures.empty)
{
sink.put(input);
return;
@@ -812,7 +812,7 @@ private @trusted void replaceCapturesInto(alias output, Sink, R, T)
sink.put(captures.pre);
// a hack to get around bogus errors, should be simply output(captures, sink)
// "is a nested function and cannot be accessed from"
- static if(isReplaceFunctor!(output, R))
+ static if (isReplaceFunctor!(output, R))
sink.put(output(captures)); //"mutator" type of function
else
output(captures, sink); //"output" type of function
@@ -822,14 +822,14 @@ private @trusted void replaceCapturesInto(alias output, Sink, R, T)
// ditto for a range of captures
private void replaceMatchesInto(alias output, Sink, R, T)
(ref Sink sink, R input, T matches)
- if(isOutputRange!(Sink, dchar) && isSomeString!R)
+ if (isOutputRange!(Sink, dchar) && isSomeString!R)
{
size_t offset = 0;
- foreach(cap; matches)
+ foreach (cap; matches)
{
sink.put(cap.pre[offset .. $]);
// same hack, see replaceCapturesInto
- static if(isReplaceFunctor!(output, R))
+ static if (isReplaceFunctor!(output, R))
sink.put(output(cap)); //"mutator" type of function
else
output(cap, sink); //"output" type of function
@@ -840,10 +840,10 @@ private void replaceMatchesInto(alias output, Sink, R, T)
// a general skeleton of replaceFirst
private R replaceFirstWith(alias output, R, RegEx)(R input, RegEx re)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
auto data = matchFirst(input, re);
- if(data.empty)
+ if (data.empty)
return input;
auto app = appender!(R)();
replaceCapturesInto!output(app, input, data);
@@ -854,10 +854,10 @@ private R replaceFirstWith(alias output, R, RegEx)(R input, RegEx re)
// the method parameter allows old API to ride on the back of the new one
private R replaceAllWith(alias output,
alias method=matchAll, R, RegEx)(R input, RegEx re)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
auto matches = method(input, re); //inout(C)[] fails
- if(matches.empty)
+ if (matches.empty)
return input;
auto app = appender!(R)();
replaceMatchesInto!output(app, input, matches);
@@ -882,7 +882,7 @@ private R replaceAllWith(alias output,
+/
public auto match(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
import std.regex.internal.thompson;
return RegexMatch!(Unqual!(typeof(input)),ThompsonMatcher)(input, re);
@@ -890,14 +890,14 @@ public auto match(R, RegEx)(R input, RegEx re)
///ditto
public auto match(R, String)(R input, String re)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.thompson;
return RegexMatch!(Unqual!(typeof(input)),ThompsonMatcher)(input, regex(re));
}
public auto match(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
import std.regex.internal.backtracking;
return RegexMatch!(Unqual!(typeof(input)),BacktrackingMatcher!true)(input, re);
@@ -922,7 +922,7 @@ public auto match(R, RegEx)(R input, RegEx re)
if there was a match, otherwise an empty $(LREF Captures) object.
+/
public auto matchFirst(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
import std.regex.internal.thompson;
return matchOnce!ThompsonMatcher(input, re);
@@ -930,7 +930,7 @@ public auto matchFirst(R, RegEx)(R input, RegEx re)
///ditto
public auto matchFirst(R, String)(R input, String re)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.thompson;
return matchOnce!ThompsonMatcher(input, regex(re));
@@ -938,14 +938,14 @@ public auto matchFirst(R, String)(R input, String re)
///ditto
public auto matchFirst(R, String)(R input, String[] re...)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.thompson;
return matchOnce!ThompsonMatcher(input, regex(re));
}
public auto matchFirst(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
import std.regex.internal.backtracking;
return matchOnce!(BacktrackingMatcher!true)(input, re);
@@ -973,7 +973,7 @@ public auto matchFirst(R, RegEx)(R input, RegEx re)
after the first match was found or an empty one if not present.
+/
public auto matchAll(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
import std.regex.internal.thompson;
return matchMany!ThompsonMatcher(input, re);
@@ -981,7 +981,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re)
///ditto
public auto matchAll(R, String)(R input, String re)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.thompson;
return matchMany!ThompsonMatcher(input, regex(re));
@@ -989,14 +989,14 @@ public auto matchAll(R, String)(R input, String re)
///ditto
public auto matchAll(R, String)(R input, String[] re...)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.thompson;
return matchMany!ThompsonMatcher(input, regex(re));
}
public auto matchAll(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
import std.regex.internal.backtracking;
return matchMany!(BacktrackingMatcher!true)(input, re);
@@ -1008,7 +1008,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re)
import std.conv : to;
import std.algorithm : map, equal;
- foreach(String; AliasSeq!(string, wstring, const(dchar)[]))
+ foreach (String; AliasSeq!(string, wstring, const(dchar)[]))
{
auto str1 = "blah-bleh".to!String();
auto pat1 = "bl[ae]h".to!String();
@@ -1061,7 +1061,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re)
+/
public auto bmatch(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
import std.regex.internal.backtracking;
return RegexMatch!(Unqual!(typeof(input)), BacktrackingMatcher!false)(input, re);
@@ -1069,14 +1069,14 @@ public auto bmatch(R, RegEx)(R input, RegEx re)
///ditto
public auto bmatch(R, String)(R input, String re)
- if(isSomeString!R && isSomeString!String)
+ if (isSomeString!R && isSomeString!String)
{
import std.regex.internal.backtracking;
return RegexMatch!(Unqual!(typeof(input)), BacktrackingMatcher!false)(input, regex(re));
}
public auto bmatch(R, RegEx)(R input, RegEx re)
- if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
+ if (isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
import std.regex.internal.backtracking;
return RegexMatch!(Unqual!(typeof(input)),BacktrackingMatcher!true)(input, re);
@@ -1085,7 +1085,7 @@ public auto bmatch(R, RegEx)(R input, RegEx re)
// produces replacement string from format using captures for substitution
package void replaceFmt(R, Capt, OutR)
(R format, Capt captures, OutR sink, bool ignoreBadSubs = false)
- if(isOutputRange!(OutR, ElementEncodingType!R[]) &&
+ if (isOutputRange!(OutR, ElementEncodingType!R[]) &&
isOutputRange!(OutR, ElementEncodingType!(Capt.String)[]))
{
import std.algorithm, std.conv;
@@ -1094,13 +1094,13 @@ package void replaceFmt(R, Capt, OutR)
auto state = State.Normal;
size_t offset;
L_Replace_Loop:
- while(!format.empty)
- final switch(state)
+ while (!format.empty)
+ final switch (state)
{
case State.Normal:
for(offset = 0; offset < format.length; offset++)//no decoding
{
- if(format[offset] == '$')
+ if (format[offset] == '$')
{
state = State.Dollar;
sink.put(format[0 .. offset]);
@@ -1112,14 +1112,14 @@ L_Replace_Loop:
format = format[offset .. $];
break;
case State.Dollar:
- if(isDigit(format[0]))
+ if (isDigit(format[0]))
{
uint digit = parse!uint(format);
enforce(ignoreBadSubs || digit < captures.length, text("invalid submatch number ", digit));
- if(digit < captures.length)
+ if (digit < captures.length)
sink.put(captures[digit]);
}
- else if(format[0] == '{')
+ else if (format[0] == '{')
{
auto x = find!(a => !isAlpha(a))(format[1..$]);
enforce(!x.empty && x[0] == '}', "no matching '}' in replacement format");
@@ -1128,22 +1128,22 @@ L_Replace_Loop:
enforce(!name.empty, "invalid name in ${...} replacement format");
sink.put(captures[name]);
}
- else if(format[0] == '&')
+ else if (format[0] == '&')
{
sink.put(captures[0]);
format = format[1 .. $];
}
- else if(format[0] == '`')
+ else if (format[0] == '`')
{
sink.put(captures.pre);
format = format[1 .. $];
}
- else if(format[0] == '\'')
+ else if (format[0] == '\'')
{
sink.put(captures.post);
format = format[1 .. $];
}
- else if(format[0] == '$')
+ else if (format[0] == '$')
{
sink.put(format[0 .. 1]);
format = format[1 .. $];
@@ -1171,7 +1171,7 @@ L_Replace_Loop:
If no match is found returns the input string itself.
+/
public R replaceFirst(R, C, RegEx)(R input, RegEx re, const(C)[] format)
- if(isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
+ if (isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
{
return replaceFirstWith!((m, sink) => replaceFmt(format, m, sink))(input, re);
}
@@ -1198,7 +1198,7 @@ unittest
returns the $(D input) itself.
+/
public R replaceFirst(alias fun, R, RegEx)(R input, RegEx re)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceFirstWith!((m, sink) => sink.put(fun(m)))(input, re);
}
@@ -1224,7 +1224,7 @@ unittest
+/
public @trusted void replaceFirstInto(Sink, R, C, RegEx)
(ref Sink sink, R input, RegEx re, const(C)[] format)
- if(isOutputRange!(Sink, dchar) && isSomeString!R
+ if (isOutputRange!(Sink, dchar) && isSomeString!R
&& is(C : dchar) && isRegexFor!(RegEx, R))
{
replaceCapturesInto!((m, sink) => replaceFmt(format, m, sink))
@@ -1234,7 +1234,7 @@ public @trusted void replaceFirstInto(Sink, R, C, RegEx)
///ditto
public @trusted void replaceFirstInto(alias fun, Sink, R, RegEx)
(Sink sink, R input, RegEx re)
- if(isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
+ if (isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
{
replaceCapturesInto!fun(sink, input, matchFirst(input, re));
}
@@ -1289,7 +1289,7 @@ unittest
If no match is found returns the input string itself.
+/
public @trusted R replaceAll(R, C, RegEx)(R input, RegEx re, const(C)[] format)
- if(isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
+ if (isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => replaceFmt(format, m, sink))(input, re);
}
@@ -1323,7 +1323,7 @@ unittest
fun = delegate to use
+/
public @trusted R replaceAll(alias fun, R, RegEx)(R input, RegEx re)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => sink.put(fun(m)))(input, re);
}
@@ -1352,7 +1352,7 @@ unittest
+/
public @trusted void replaceAllInto(Sink, R, C, RegEx)
(Sink sink, R input, RegEx re, const(C)[] format)
- if(isOutputRange!(Sink, dchar) && isSomeString!R
+ if (isOutputRange!(Sink, dchar) && isSomeString!R
&& is(C : dchar) && isRegexFor!(RegEx, R))
{
replaceMatchesInto!((m, sink) => replaceFmt(format, m, sink))
@@ -1362,7 +1362,7 @@ public @trusted void replaceAllInto(Sink, R, C, RegEx)
///ditto
public @trusted void replaceAllInto(alias fun, Sink, R, RegEx)
(Sink sink, R input, RegEx re)
- if(isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
+ if (isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
{
replaceMatchesInto!fun(sink, input, matchAll(input, re));
}
@@ -1389,7 +1389,7 @@ public @trusted void replaceAllInto(alias fun, Sink, R, RegEx)
{
import std.conv;
// try and check first/all simple substitution
- foreach(S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
+ foreach (S; AliasSeq!(string, wstring, dstring, char[], wchar[], dchar[]))
{
S s1 = "curt trial".to!S();
S s2 = "round dome".to!S();
@@ -1433,14 +1433,14 @@ public @trusted void replaceAllInto(alias fun, Sink, R, RegEx)
or $(LREF replaceFirst) explicitly.
+/
public R replace(alias scheme = match, R, C, RegEx)(R input, RegEx re, const(C)[] format)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => replaceFmt(format, m, sink), match)(input, re);
}
///ditto
public R replace(alias fun, R, RegEx)(R input, RegEx re)
- if(isSomeString!R && isRegexFor!(RegEx, R))
+ if (isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!(fun, match)(input, re);
}
@@ -1456,7 +1456,7 @@ Returns:
A lazy range of strings
*/
public struct Splitter(Flag!"keepSeparators" keepSeparators = No.keepSeparators, Range, alias RegEx = Regex)
- if(isSomeString!Range && isRegexFor!(RegEx, Range))
+ if (isSomeString!Range && isRegexFor!(RegEx, Range))
{
private:
Range _input;
@@ -1598,10 +1598,10 @@ unittest
///An eager version of $(D splitter) that creates an array with splitted slices of $(D input).
public @trusted String[] split(String, RegEx)(String input, RegEx rx)
- if(isSomeString!String && isRegexFor!(RegEx, String))
+ if (isSomeString!String && isRegexFor!(RegEx, String))
{
auto a = appender!(String[])();
- foreach(e; splitter(input, rx))
+ foreach (e; splitter(input, rx))
a.put(e);
return a.data;
}
@@ -1623,7 +1623,7 @@ auto escaper(Range)(Range r)
bool escaped;
@property ElementType!Range front(){
- if(escaped)
+ if (escaped)
return '\\';
else
return r.front;
@@ -1632,11 +1632,11 @@ auto escaper(Range)(Range r)
@property bool empty(){ return r.empty; }
void popFront(){
- if(escaped) escaped = false;
+ if (escaped) escaped = false;
else
{
r.popFront();
- if(!r.empty && !escapables.find(r.front).empty)
+ if (!r.empty && !escapables.find(r.front).empty)
escaped = true;
}
}
@@ -1659,7 +1659,7 @@ unittest
unittest
{
import std.conv, std.algorithm;
- foreach(S; AliasSeq!(string, wstring, dstring))
+ foreach (S; AliasSeq!(string, wstring, dstring))
{
auto s = "^".to!S;
assert(s.escaper.equal(`\^`));
diff --git a/std/signals.d b/std/signals.d
index e85076393..c37bd8b6c 100644
--- a/std/signals.d
+++ b/std/signals.d
@@ -225,7 +225,7 @@ unittest
{ // our slot
void watch(string msg, int value)
{
- switch(observedMessageCounter++)
+ switch (observedMessageCounter++)
{
case 0:
assert(msg == "setting new value");
diff --git a/std/socket.d b/std/socket.d
index e55bda037..9709d6041 100644
--- a/std/socket.d
+++ b/std/socket.d
@@ -208,9 +208,9 @@ string formatSocketError(int err) @trusted
auto len = strlen(cs);
- if(cs[len - 1] == '\n')
+ if (cs[len - 1] == '\n')
len--;
- if(cs[len - 1] == '\r')
+ if (cs[len - 1] == '\r')
len--;
return cs[0 .. len].idup;
}
@@ -318,7 +318,7 @@ shared static this() @system
// The version is just a request.
int val;
val = WSAStartup(0x2020, &wd);
- if(val) // Request Winsock 2.2 for IPv6.
+ if (val) // Request Winsock 2.2 for IPv6.
throw new SocketOSException("Unable to initialize socket library", val);
// These functions may not be present on older Windows versions.
@@ -406,7 +406,7 @@ enum ProtocolType: int
* if (proto.getProtocolByType(ProtocolType.TCP))
* {
* writefln(" Name: %s", proto.name);
- * foreach(string s; proto.aliases)
+ * foreach (string s; proto.aliases)
* writefln(" Alias: %s", s);
* }
* else
@@ -429,11 +429,11 @@ class Protocol
int i;
for(i = 0;; i++)
{
- if(!proto.p_aliases[i])
+ if (!proto.p_aliases[i])
break;
}
- if(i)
+ if (i)
{
aliases = new string[i];
for(i = 0; i != aliases.length; i++)
@@ -453,7 +453,7 @@ class Protocol
{
protoent* proto;
proto = getprotobyname(name.tempCString());
- if(!proto)
+ if (!proto)
return false;
populate(proto);
return true;
@@ -466,7 +466,7 @@ class Protocol
{
protoent* proto;
proto = getprotobynumber(type);
- if(!proto)
+ if (!proto)
return false;
populate(proto);
return true;
@@ -484,7 +484,7 @@ unittest
assert(proto.getProtocolByType(ProtocolType.TCP));
//writeln("About protocol TCP:");
//writefln("\tName: %s", proto.name);
- // foreach(string s; proto.aliases)
+ // foreach (string s; proto.aliases)
// {
// writefln("\tAlias: %s", s);
// }
@@ -531,11 +531,11 @@ class Service
int i;
for(i = 0;; i++)
{
- if(!serv.s_aliases[i])
+ if (!serv.s_aliases[i])
break;
}
- if(i)
+ if (i)
{
aliases = new string[i];
for(i = 0; i != aliases.length; i++)
@@ -558,7 +558,7 @@ class Service
{
servent* serv;
serv = getservbyname(name.tempCString(), protocolName.tempCString());
- if(!serv)
+ if (!serv)
return false;
populate(serv);
return true;
@@ -570,7 +570,7 @@ class Service
{
servent* serv;
serv = getservbyport(port, protocolName.tempCString());
- if(!serv)
+ if (!serv)
return false;
populate(serv);
return true;
@@ -582,13 +582,13 @@ unittest
{
softUnittest({
Service serv = new Service;
- if(serv.getServiceByName("epmap", "tcp"))
+ if (serv.getServiceByName("epmap", "tcp"))
{
// writefln("About service epmap:");
// writefln("\tService: %s", serv.name);
// writefln("\tPort: %d", serv.port);
// writefln("\tProtocol: %s", serv.protocolName);
- // foreach(string s; serv.aliases)
+ // foreach (string s; serv.aliases)
// {
// writefln("\tAlias: %s", s);
// }
@@ -684,7 +684,7 @@ class InternetHost
void validHostent(in hostent* he)
{
- if(he.h_addrtype != cast(int)AddressFamily.INET || he.h_length != 4)
+ if (he.h_addrtype != cast(int)AddressFamily.INET || he.h_length != 4)
throw new HostException("Address family mismatch");
}
@@ -699,11 +699,11 @@ class InternetHost
for(i = 0;; i++)
{
p = he.h_aliases[i];
- if(!p)
+ if (!p)
break;
}
- if(i)
+ if (i)
{
aliases = new string[i];
for(i = 0; i != aliases.length; i++)
@@ -720,11 +720,11 @@ class InternetHost
for(i = 0;; i++)
{
p = he.h_addr_list[i];
- if(!p)
+ if (!p)
break;
}
- if(i)
+ if (i)
{
addrList = new uint[i];
for(i = 0; i != addrList.length; i++)
@@ -846,7 +846,7 @@ unittest
ih.name);
// writefln("IP address = %s", ia.toAddrString());
// writefln("name = %s", ih.name);
- // foreach(int i, string s; ih.aliases)
+ // foreach (int i, string s; ih.aliases)
// {
// writefln("aliases[%d] = %s", i, s);
// }
@@ -854,7 +854,7 @@ unittest
//assert(ih.getHostByAddr(ih.addrList[0]));
// writefln("name = %s", ih.name);
- // foreach(int i, string s; ih.aliases)
+ // foreach (int i, string s; ih.aliases)
// {
// writefln("aliases[%d] = %s", i, s);
// }
@@ -1563,10 +1563,10 @@ public:
this(in char[] addr, ushort port)
{
uint uiaddr = parse(addr);
- if(ADDR_NONE == uiaddr)
+ if (ADDR_NONE == uiaddr)
{
InternetHost ih = new InternetHost;
- if(!ih.getHostByName(addr))
+ if (!ih.getHostByName(addr))
//throw new AddressException("Invalid internet address");
throw new AddressException(
text("Unable to resolve host '", addr, "'"));
@@ -2636,7 +2636,7 @@ public:
{
_family = af;
auto handle = cast(socket_t) socket(af, type, protocol);
- if(handle == socket_t.init)
+ if (handle == socket_t.init)
throw new SocketOSException("Unable to create socket");
setSock(handle);
}
@@ -2656,7 +2656,7 @@ public:
{
protoent* proto;
proto = getprotobyname(protocolName.tempCString());
- if(!proto)
+ if (!proto)
throw new SocketOSException("Unable to find the protocol");
this(af, type, cast(ProtocolType)proto.p_proto);
}
@@ -2717,20 +2717,20 @@ public:
version(Windows)
{
uint num = !byes;
- if(_SOCKET_ERROR == ioctlsocket(sock, FIONBIO, &num))
+ if (_SOCKET_ERROR == ioctlsocket(sock, FIONBIO, &num))
goto err;
_blocking = byes;
}
else version(Posix)
{
int x = fcntl(sock, F_GETFL, 0);
- if(-1 == x)
+ if (-1 == x)
goto err;
- if(byes)
+ if (byes)
x &= ~O_NONBLOCK;
else
x |= O_NONBLOCK;
- if(-1 == fcntl(sock, F_SETFL, x))
+ if (-1 == fcntl(sock, F_SETFL, x))
goto err;
}
return; // Success.
@@ -2757,7 +2757,7 @@ public:
/// Associate a local address with this socket.
void bind(Address addr) @trusted
{
- if(_SOCKET_ERROR == .bind(sock, addr.name, addr.nameLen))
+ if (_SOCKET_ERROR == .bind(sock, addr.name, addr.nameLen))
throw new SocketOSException("Unable to bind socket");
}
@@ -2768,21 +2768,21 @@ public:
*/
void connect(Address to) @trusted
{
- if(_SOCKET_ERROR == .connect(sock, to.name, to.nameLen))
+ if (_SOCKET_ERROR == .connect(sock, to.name, to.nameLen))
{
int err;
err = _lasterr();
- if(!blocking)
+ if (!blocking)
{
version(Windows)
{
- if(WSAEWOULDBLOCK == err)
+ if (WSAEWOULDBLOCK == err)
return;
}
else version(Posix)
{
- if(EINPROGRESS == err)
+ if (EINPROGRESS == err)
return;
}
else
@@ -2801,7 +2801,7 @@ public:
*/
void listen(int backlog) @trusted
{
- if(_SOCKET_ERROR == .listen(sock, backlog))
+ if (_SOCKET_ERROR == .listen(sock, backlog))
throw new SocketOSException("Unable to listen on socket");
}
@@ -2827,7 +2827,7 @@ public:
Socket accept() @trusted
{
auto newsock = cast(socket_t).accept(sock, null, null);
- if(socket_t.init == newsock)
+ if (socket_t.init == newsock)
throw new SocketAcceptException("Unable to accept socket connection");
Socket newSocket;
@@ -2890,7 +2890,7 @@ public:
static @property string hostName() @trusted // getter
{
char[256] result; // Host names are limited to 255 chars.
- if(_SOCKET_ERROR == .gethostname(result.ptr, result.length))
+ if (_SOCKET_ERROR == .gethostname(result.ptr, result.length))
throw new SocketOSException("Unable to obtain host name");
return to!string(result.ptr);
}
@@ -2900,9 +2900,9 @@ public:
{
Address addr = createAddress();
socklen_t nameLen = addr.nameLen;
- if(_SOCKET_ERROR == .getpeername(sock, addr.name, &nameLen))
+ if (_SOCKET_ERROR == .getpeername(sock, addr.name, &nameLen))
throw new SocketOSException("Unable to obtain remote socket address");
- if(nameLen > addr.nameLen)
+ if (nameLen > addr.nameLen)
throw new SocketParameterException("Not enough socket address storage");
assert(addr.addressFamily == _family);
return addr;
@@ -2913,9 +2913,9 @@ public:
{
Address addr = createAddress();
socklen_t nameLen = addr.nameLen;
- if(_SOCKET_ERROR == .getsockname(sock, addr.name, &nameLen))
+ if (_SOCKET_ERROR == .getsockname(sock, addr.name, &nameLen))
throw new SocketOSException("Unable to obtain local socket address");
- if(nameLen > addr.nameLen)
+ if (nameLen > addr.nameLen)
throw new SocketParameterException("Not enough socket address storage");
assert(addr.addressFamily == _family);
return addr;
@@ -3042,7 +3042,7 @@ public:
*/
ptrdiff_t receiveFrom(void[] buf, SocketFlags flags, ref Address from) @trusted
{
- if(!buf.length) //return 0 and don't think the connection closed
+ if (!buf.length) //return 0 and don't think the connection closed
return 0;
if (from is null || from.addressFamily != _family)
from = createAddress();
@@ -3051,12 +3051,12 @@ public:
{
auto read = .recvfrom(sock, buf.ptr, to!int(buf.length), cast(int)flags, from.name, &nameLen);
assert(from.addressFamily == _family);
- // if(!read) //connection closed
+ // if (!read) //connection closed
return read;
} else {
auto read = .recvfrom(sock, buf.ptr, buf.length, cast(int)flags, from.name, &nameLen);
assert(from.addressFamily == _family);
- // if(!read) //connection closed
+ // if (!read) //connection closed
return read;
}
}
@@ -3073,16 +3073,16 @@ public:
/// ditto
ptrdiff_t receiveFrom(void[] buf, SocketFlags flags) @trusted
{
- if(!buf.length) //return 0 and don't think the connection closed
+ if (!buf.length) //return 0 and don't think the connection closed
return 0;
version(Windows)
{
auto read = .recvfrom(sock, buf.ptr, to!int(buf.length), cast(int)flags, null, null);
- // if(!read) //connection closed
+ // if (!read) //connection closed
return read;
} else {
auto read = .recvfrom(sock, buf.ptr, buf.length, cast(int)flags, null, null);
- // if(!read) //connection closed
+ // if (!read) //connection closed
return read;
}
}
@@ -3102,7 +3102,7 @@ public:
int getOption(SocketOptionLevel level, SocketOption option, void[] result) @trusted
{
socklen_t len = cast(socklen_t) result.length;
- if(_SOCKET_ERROR == .getsockopt(sock, cast(int)level, cast(int)option, result.ptr, &len))
+ if (_SOCKET_ERROR == .getsockopt(sock, cast(int)level, cast(int)option, result.ptr, &len))
throw new SocketOSException("Unable to get socket option");
return len;
}
@@ -3149,7 +3149,7 @@ public:
/// Set a socket option.
void setOption(SocketOptionLevel level, SocketOption option, void[] value) @trusted
{
- if(_SOCKET_ERROR == .setsockopt(sock, cast(int)level,
+ if (_SOCKET_ERROR == .setsockopt(sock, cast(int)level,
cast(int)option, value.ptr, cast(uint) value.length))
throw new SocketOSException("Unable to set socket option");
}
@@ -3324,12 +3324,12 @@ public:
in
{
//make sure none of the SocketSet's are the same object
- if(checkRead)
+ if (checkRead)
{
assert(checkRead !is checkWrite);
assert(checkRead !is checkError);
}
- if(checkWrite)
+ if (checkWrite)
{
assert(checkWrite !is checkError);
}
@@ -3348,7 +3348,7 @@ public:
}
else
{
- if(checkRead)
+ if (checkRead)
{
fr = checkRead.toFd_set();
n = checkRead.selectn();
@@ -3358,12 +3358,12 @@ public:
fr = null;
}
- if(checkWrite)
+ if (checkWrite)
{
fw = checkWrite.toFd_set();
int _n;
_n = checkWrite.selectn();
- if(_n > n)
+ if (_n > n)
n = _n;
}
else
@@ -3371,12 +3371,12 @@ public:
fw = null;
}
- if(checkError)
+ if (checkError)
{
fe = checkError.toFd_set();
int _n;
_n = checkError.selectn();
- if(_n > n)
+ if (_n > n)
n = _n;
}
else
@@ -3395,12 +3395,12 @@ public:
version(Windows)
{
- if(_SOCKET_ERROR == result && WSAGetLastError() == WSAEINTR)
+ if (_SOCKET_ERROR == result && WSAGetLastError() == WSAEINTR)
return -1;
}
else version(Posix)
{
- if(_SOCKET_ERROR == result && errno == EINTR)
+ if (_SOCKET_ERROR == result && errno == EINTR)
return -1;
}
else
@@ -3408,7 +3408,7 @@ public:
static assert(0);
}
- if(_SOCKET_ERROR == result)
+ if (_SOCKET_ERROR == result)
throw new SocketOSException("Socket select error");
return result;
@@ -3420,7 +3420,7 @@ public:
protected Address createAddress() pure nothrow
{
Address result;
- switch(_family)
+ switch (_family)
{
static if (is(sockaddr_un))
{
diff --git a/std/socketstream.d b/std/socketstream.d
index 59648618c..5968cc741 100644
--- a/std/socketstream.d
+++ b/std/socketstream.d
@@ -57,9 +57,9 @@ class SocketStream: Stream
*/
this(Socket sock, FileMode mode)
{
- if(mode & FileMode.In)
+ if (mode & FileMode.In)
readable = true;
- if(mode & FileMode.Out)
+ if (mode & FileMode.Out)
writeable = true;
this.sock = sock;
diff --git a/std/stdio.d b/std/stdio.d
index 0b2dd8209..8bf09a346 100644
--- a/std/stdio.d
+++ b/std/stdio.d
@@ -700,7 +700,7 @@ Throws: $(D ErrnoException) on error.
scope(exit)
{
assert(_p.refs);
- if(!--_p.refs)
+ if (!--_p.refs)
free(_p);
_p = null; // start a new life
}
@@ -2526,7 +2526,7 @@ $(D Range) that locks the file and allows fast writing to it.
~this() @trusted
{
- if(fps_)
+ if (fps_)
{
FUNLOCK(fps_);
fps_ = null;
@@ -2535,7 +2535,7 @@ $(D Range) that locks the file and allows fast writing to it.
this(this) @trusted
{
- if(fps_)
+ if (fps_)
{
FLOCK(fps_);
}
@@ -2929,7 +2929,7 @@ unittest
@system void systemTests()
{
//system code can write to files/stdout with anything!
- if(false)
+ if (false)
{
auto f = File();
@@ -2984,7 +2984,7 @@ unittest
auto f = File();
//safe code can write to files only with @safe and @trusted code...
- if(false)
+ if (false)
{
f.write("just a string");
f.write("string with arg: ", 47);
@@ -3240,7 +3240,7 @@ unittest // bugzilla 14861
scope (exit) fr.close();
int nom; string fam, nam, ot;
// Error format read
- while(!fr.eof)
+ while (!fr.eof)
fr.readf("%s;%s;%s;%s\n", &nom, &fam, &nam, &ot);
}
@@ -4376,7 +4376,7 @@ private struct ReadlnAppender
char[4] ubuf;
char[] u = toUTF8(ubuf, dc);
reserve(u.length);
- foreach(c; u)
+ foreach (c; u)
buf.ptr[pos++] = c;
}
void putonly(char[] b)
@@ -4445,9 +4445,9 @@ private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orie
*/
L1:
int c;
- while((c = FGETC(fp)) != -1) {
+ while ((c = FGETC(fp)) != -1) {
app.putchar(cast(char) c);
- if(c == terminator) {
+ if (c == terminator) {
buf = app.data;
return buf.length;
}
@@ -4529,9 +4529,9 @@ private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orie
app.initialize(buf);
int c;
- while((c = FGETC(fp)) != -1) {
+ while ((c = FGETC(fp)) != -1) {
app.putchar(cast(char) c);
- if(c == terminator) {
+ if (c == terminator) {
buf = app.data;
return buf.length;
}
diff --git a/std/stream.d b/std/stream.d
index 1078caee9..90b8f26b3 100644
--- a/std/stream.d
+++ b/std/stream.d
@@ -165,7 +165,7 @@ interface InputStream {
* For example, to echo a file line-by-line with line numbers run:
* ------------------------------------
* Stream file = new BufferedFile("sample.txt");
- * foreach(ulong n, char[] line; file)
+ * foreach (ulong n, char[] line; file)
* {
* writefln("line %d: %s", n, line);
* }
@@ -698,7 +698,7 @@ class Stream : InputStream, OutputStream {
char c;
bool firstCharacter = true;
while ((j < arguments.length || i < fmt.length) && !eof) {
- if(firstCharacter) {
+ if (firstCharacter) {
c = getc();
firstCharacter = false;
}
@@ -933,15 +933,15 @@ class Stream : InputStream, OutputStream {
}
}
}
- if(width && (c == 'n' || c == 'N')) {
+ if (width && (c == 'n' || c == 'N')) {
width--;
c = getc();
count++;
- if(width && (c == 'a' || c == 'A')) {
+ if (width && (c == 'a' || c == 'A')) {
width--;
c = getc();
count++;
- if(width && (c == 'n' || c == 'N')) {
+ if (width && (c == 'n' || c == 'N')) {
width--;
c = getc();
count++;
@@ -949,15 +949,15 @@ class Stream : InputStream, OutputStream {
}
}
}
- if(width && (c == 'i' || c == 'I')) {
+ if (width && (c == 'i' || c == 'I')) {
width--;
c = getc();
count++;
- if(width && (c == 'n' || c == 'N')) {
+ if (width && (c == 'n' || c == 'N')) {
width--;
c = getc();
count++;
- if(width && (c == 'f' || c == 'F')) {
+ if (width && (c == 'f' || c == 'F')) {
width--;
c = getc();
count++;
@@ -1770,23 +1770,23 @@ class BufferedStream : FilterStream {
for(;;) {
size_t start = bufferCurPos;
L1:
- foreach(ubyte b; buffer[start .. bufferLen]) {
+ foreach (ubyte b; buffer[start .. bufferLen]) {
bufferCurPos++;
pc[idx] = b;
- if(idx < T.sizeof - 1) {
+ if (idx < T.sizeof - 1) {
idx++;
continue L1;
} else {
idx = 0;
}
- if(c == '\n' || haveCR) {
- if(haveCR && c != '\n') bufferCurPos--;
+ if (c == '\n' || haveCR) {
+ if (haveCR && c != '\n') bufferCurPos--;
break L0;
} else {
- if(c == '\r') {
+ if (c == '\r') {
haveCR = true;
} else {
- if(lineSize < inBuffer.length) {
+ if (lineSize < inBuffer.length) {
inBuffer[lineSize] = c;
} else {
inBuffer ~= c;
@@ -1797,7 +1797,7 @@ class BufferedStream : FilterStream {
}
flush();
size_t res = super.readBlock(buffer.ptr, buffer.length);
- if(!res) break L0; // EOF
+ if (!res) break L0; // EOF
bufferSourcePos = bufferLen = res;
streamPos += res;
}
@@ -2191,7 +2191,7 @@ class File: Stream {
file.writeLine("That was blank");
file.position = 0;
char[][] lines;
- foreach(char[] line; file) {
+ foreach (char[] line; file) {
lines ~= line.dup;
}
assert( lines.length == 4 );
@@ -2201,7 +2201,7 @@ class File: Stream {
assert( lines[3] == "That was blank");
file.position = 0;
lines = new char[][4];
- foreach(ulong n, char[] line; file) {
+ foreach (ulong n, char[] line; file) {
lines[cast(size_t)(n-1)] = line.dup;
}
assert( lines[0] == "Testing stream.d:");
@@ -2540,7 +2540,7 @@ class EndianStream : FilterStream {
override void write(dchar x) { fixBO(&x,x.sizeof); writeExact(&x, x.sizeof); }
override void writeStringW(const(wchar)[] str) {
- foreach(wchar cw;str) {
+ foreach (wchar cw;str) {
fixBO(&cw,2);
s.writeExact(&cw, 2);
}
diff --git a/std/string.d b/std/string.d
index 6ca34281b..6afb3e9cf 100644
--- a/std/string.d
+++ b/std/string.d
@@ -1469,7 +1469,7 @@ private ptrdiff_t indexOfAnyNeitherImpl(bool forward, bool any, Char, Char2)(
{
foreach_reverse (idx, dchar hay; haystack)
{
- if(!canFind(needles, hay))
+ if (!canFind(needles, hay))
{
return idx;
}
@@ -2442,7 +2442,7 @@ S[] splitLines(S)(S s, in KeepTerminator keepTerm = KeepTerminator.no) @safe pur
* NEL is C2 85
*/
case 0xC2:
- if(i + 1 < s.length && s[i + 1] == 0x85)
+ if (i + 1 < s.length && s[i + 1] == 0x85)
{
retval.put(s[iStart .. i + (keepTerm == KeepTerminator.yes) * 2]);
iStart = i + 2;
@@ -2641,7 +2641,7 @@ public:
* NEL is C2 85
*/
case 0xC2:
- if(i + 1 < _input.length && _input[i + 1] == 0x85)
+ if (i + 1 < _input.length && _input[i + 1] == 0x85)
{
iEnd = i + (keepTerm == KeepTerminator.yes) * 2;
iNext = i + 2;
@@ -4822,7 +4822,7 @@ C1[] translate(C1, C2 = immutable char)(C1[] str,
wchar[], const(wchar)[], immutable(wchar)[],
dchar[], const(dchar)[], immutable(dchar)[]))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
- foreach(R; AliasSeq!(dchar[dchar], const dchar[dchar],
+ foreach (R; AliasSeq!(dchar[dchar], const dchar[dchar],
immutable dchar[dchar]))
{
R tt = ['h' : 'q', 'l' : '5'];
@@ -4884,7 +4884,7 @@ C1[] translate(C1, S, C2 = immutable char)(C1[] str,
dchar[], const(dchar)[], immutable(dchar)[]))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
- foreach(R; AliasSeq!(string[dchar], const string[dchar],
+ foreach (R; AliasSeq!(string[dchar], const string[dchar],
immutable string[dchar]))
{
R tt = ['h' : "yellow", 'l' : "42"];
@@ -6588,7 +6588,7 @@ S wrap(S)(S s, in size_t columns = 80, S firstindent = null,
* StringException if indentation is done with different sequences
* of whitespace characters.
*/
-S outdent(S)(S str) @safe pure if(isSomeString!S)
+S outdent(S)(S str) @safe pure if (isSomeString!S)
{
return str.splitLines(KeepTerminator.yes).outdent().join();
}
@@ -6630,7 +6630,7 @@ void main() {
* StringException if indentation is done with different sequences
* of whitespace characters.
*/
-S[] outdent(S)(S[] lines) @safe pure if(isSomeString!S)
+S[] outdent(S)(S[] lines) @safe pure if (isSomeString!S)
{
import std.algorithm : startsWith;
@@ -6799,7 +6799,7 @@ Returns:
See_Also: $(LREF representation)
*/
auto assumeUTF(T)(T[] arr) pure
- if(staticIndexOf!(Unqual!T, ubyte, ushort, uint) != -1)
+ if (staticIndexOf!(Unqual!T, ubyte, ushort, uint) != -1)
{
import std.utf : validate;
alias ToUTFType(U) = AliasSeq!(char, wchar, dchar)[U.sizeof / 2];
@@ -6821,24 +6821,24 @@ auto assumeUTF(T)(T[] arr) pure
pure unittest
{
import std.algorithm : equal;
- foreach(T; AliasSeq!(char[], wchar[], dchar[]))
+ foreach (T; AliasSeq!(char[], wchar[], dchar[]))
{
immutable T jti = "Hello World";
T jt = jti.dup;
- static if(is(T == char[]))
+ static if (is(T == char[]))
{
auto gt = cast(ubyte[])jt;
auto gtc = cast(const(ubyte)[])jt;
auto gti = cast(immutable(ubyte)[])jt;
}
- else static if(is(T == wchar[]))
+ else static if (is(T == wchar[]))
{
auto gt = cast(ushort[])jt;
auto gtc = cast(const(ushort)[])jt;
auto gti = cast(immutable(ushort)[])jt;
}
- else static if(is(T == dchar[]))
+ else static if (is(T == dchar[]))
{
auto gt = cast(uint[])jt;
auto gtc = cast(const(uint)[])jt;
diff --git a/std/traits.d b/std/traits.d
index 58cce4c4d..1c3a707ea 100644
--- a/std/traits.d
+++ b/std/traits.d
@@ -1485,7 +1485,7 @@ private FunctionAttribute extractAttribFlags(Attribs...)()
$(D true) if $(D func) is $(D @safe) or $(D @trusted).
*/
template isSafe(alias func)
- if(isCallable!func)
+ if (isCallable!func)
{
enum isSafe = (functionAttributes!func & FunctionAttribute.safe) != 0 ||
(functionAttributes!func & FunctionAttribute.trusted) != 0;
@@ -2068,7 +2068,7 @@ Determines whether $(D T) has its own context pointer.
$(D T) must be either $(D class), $(D struct), or $(D union).
*/
template isNested(T)
- if(is(T == class) || is(T == struct) || is(T == union))
+ if (is(T == class) || is(T == struct) || is(T == union))
{
enum isNested = __traits(isNested, T);
}
@@ -2090,9 +2090,9 @@ have a context pointer.
*/
template hasNested(T)
{
- static if(isStaticArray!T && T.length)
+ static if (isStaticArray!T && T.length)
enum hasNested = hasNested!(typeof(T.init[0]));
- else static if(is(T == class) || is(T == struct) || is(T == union))
+ else static if (is(T == class) || is(T == struct) || is(T == union))
enum hasNested = isNested!T ||
anySatisfy!(.hasNested, Fields!T);
else
@@ -3076,11 +3076,11 @@ unittest
*/
template hasElaborateCopyConstructor(S)
{
- static if(isStaticArray!S && S.length)
+ static if (isStaticArray!S && S.length)
{
enum bool hasElaborateCopyConstructor = hasElaborateCopyConstructor!(typeof(S.init[0]));
}
- else static if(is(S == struct))
+ else static if (is(S == struct))
{
enum hasElaborateCopyConstructor = hasMember!(S, "__postblit")
|| anySatisfy!(.hasElaborateCopyConstructor, FieldTypeTuple!S);
@@ -3132,11 +3132,11 @@ unittest
*/
template hasElaborateAssign(S)
{
- static if(isStaticArray!S && S.length)
+ static if (isStaticArray!S && S.length)
{
enum bool hasElaborateAssign = hasElaborateAssign!(typeof(S.init[0]));
}
- else static if(is(S == struct))
+ else static if (is(S == struct))
{
enum hasElaborateAssign = is(typeof(S.init.opAssign(rvalueOf!S))) ||
is(typeof(S.init.opAssign(lvalueOf!S))) ||
@@ -3218,11 +3218,11 @@ unittest
*/
template hasElaborateDestructor(S)
{
- static if(isStaticArray!S && S.length)
+ static if (isStaticArray!S && S.length)
{
enum bool hasElaborateDestructor = hasElaborateDestructor!(typeof(S.init[0]));
}
- else static if(is(S == struct))
+ else static if (is(S == struct))
{
enum hasElaborateDestructor = hasMember!(S, "__dtor")
|| anySatisfy!(.hasElaborateDestructor, FieldTypeTuple!S);
@@ -3471,10 +3471,10 @@ unittest // Bugzilla 14561: huge enums
string genEnum()
{
string result = "enum TLAs {";
- foreach(c0; '0'..'2'+1)
- foreach(c1; '0'..'9'+1)
- foreach(c2; '0'..'9'+1)
- foreach(c3; '0'..'9'+1)
+ foreach (c0; '0'..'2'+1)
+ foreach (c1; '0'..'9'+1)
+ foreach (c2; '0'..'9'+1)
+ foreach (c3; '0'..'9'+1)
{
result ~= '_';
result ~= c0;
@@ -3951,7 +3951,7 @@ private template maxAlignment(U...) if (isTypeTuple!U)
/**
Returns class instance alignment.
*/
-template classInstanceAlignment(T) if(is(T == class))
+template classInstanceAlignment(T) if (is(T == class))
{
alias classInstanceAlignment = maxAlignment!(void*, typeof(T.tupleof));
}
@@ -3986,7 +3986,7 @@ template CommonType(T...)
}
else static if (T.length == 1)
{
- static if(is(typeof(T[0])))
+ static if (is(typeof(T[0])))
{
alias CommonType = typeof(T[0]);
}
@@ -4082,7 +4082,7 @@ template ImplicitConversionTargets(T)
TypeTuple!(int, uint, long, ulong, CentTypeList, float, double, real);
else static if (is(T : typeof(null)))
alias ImplicitConversionTargets = TypeTuple!(typeof(null));
- else static if(is(T : Object))
+ else static if (is(T : Object))
alias ImplicitConversionTargets = TransitiveBaseTypeTuple!(T);
else static if (isDynamicArray!T && !is(typeof(T.init[0]) == const))
alias ImplicitConversionTargets =
@@ -4577,7 +4577,7 @@ unittest
static struct S { }
int i;
struct Nested { void f() { ++i; } }
- foreach(T; TypeTuple!(int, immutable int, inout int, string, S, Nested, Object))
+ foreach (T; TypeTuple!(int, immutable int, inout int, string, S, Nested, Object))
{
static assert(!__traits(compiles, needLvalue(rvalueOf!T)));
static assert( __traits(compiles, needLvalue(lvalueOf!T)));
@@ -5548,7 +5548,7 @@ unittest
* that define $(D opApply) with a single loop variable, and builtin dynamic,
* static and associative arrays.
*/
-enum bool isIterable(T) = is(typeof({ foreach(elem; T.init) {} }));
+enum bool isIterable(T) = is(typeof({ foreach (elem; T.init) {} }));
///
unittest
@@ -6187,7 +6187,7 @@ template ForeachType(T)
alias ForeachType = ReturnType!(typeof(
(inout int x = 0)
{
- foreach(elem; T.init)
+ foreach (elem; T.init)
{
return elem;
}
@@ -6324,7 +6324,7 @@ Returns the largest type, i.e. T such that T.sizeof is the largest. If more
than one type is of the same size, the leftmost argument of these in will be
returned.
*/
-template Largest(T...) if(T.length >= 1)
+template Largest(T...) if (T.length >= 1)
{
static if (T.length == 1)
{
@@ -6332,7 +6332,7 @@ template Largest(T...) if(T.length >= 1)
}
else static if (T.length == 2)
{
- static if(T[0].sizeof >= T[1].sizeof)
+ static if (T[0].sizeof >= T[1].sizeof)
{
alias Largest = T[0];
}
@@ -6419,7 +6419,7 @@ unittest
Returns the most negative value of the numeric type T.
*/
template mostNegative(T)
- if(isNumeric!T || isSomeChar!T || isBoolean!T)
+ if (isNumeric!T || isSomeChar!T || isBoolean!T)
{
static if (is(typeof(T.min_normal)))
enum mostNegative = -T.max;
@@ -6441,10 +6441,10 @@ unittest
///
unittest
{
- foreach(T; TypeTuple!(bool, byte, short, int, long))
+ foreach (T; TypeTuple!(bool, byte, short, int, long))
static assert(mostNegative!T == T.min);
- foreach(T; TypeTuple!(ubyte, ushort, uint, ulong, char, wchar, dchar))
+ foreach (T; TypeTuple!(ubyte, ushort, uint, ulong, char, wchar, dchar))
static assert(mostNegative!T == 0);
}
@@ -6694,7 +6694,7 @@ template getUDAs(alias symbol, alias attribute)
import std.typetuple : Filter;
template isDesiredUDA(alias S) {
- static if(__traits(compiles, is(typeof(S) == attribute))) {
+ static if (__traits(compiles, is(typeof(S) == attribute))) {
enum isDesiredUDA = is(typeof(S) == attribute);
} else {
enum isDesiredUDA = isInstanceOf!(attribute, typeof(S));
diff --git a/std/typecons.d b/std/typecons.d
index d0bb3299e..051605bb0 100644
--- a/std/typecons.d
+++ b/std/typecons.d
@@ -293,13 +293,13 @@ unittest
// Used in Tuple.toString
private template sharedToString(alias field)
- if(is(typeof(field) == shared))
+ if (is(typeof(field) == shared))
{
static immutable sharedToString = typeof(field).stringof;
}
private template sharedToString(alias field)
- if(!is(typeof(field) == shared))
+ if (!is(typeof(field) == shared))
{
alias sharedToString = field;
}
@@ -6101,7 +6101,7 @@ template scoped(T)
// As `Scoped` can be unaligned moved in memory class instance should be moved accordingly.
immutable size_t d = alignedStore - Scoped_store.ptr;
size_t* currD = cast(size_t*) &Scoped_store[$ - size_t.sizeof];
- if(d != *currD)
+ if (d != *currD)
{
import core.stdc.string;
memmove(alignedStore, Scoped_store.ptr + *currD, __traits(classInstanceSize, T));
@@ -6221,7 +6221,7 @@ unittest
}
private size_t _alignUp(size_t alignment)(size_t n)
- if(alignment > 0 && !((alignment - 1) & alignment))
+ if (alignment > 0 && !((alignment - 1) & alignment))
{
enum badEnd = alignment - 1; // 0b11, 0b111, ...
return (n + badEnd) & ~badEnd;
@@ -6275,7 +6275,7 @@ unittest // Issue 6580 testcase
alloca(size);
alignmentTest();
}
- foreach(i; 0 .. 10)
+ foreach (i; 0 .. 10)
test(i);
}
else
@@ -6285,7 +6285,7 @@ unittest // Issue 6580 testcase
byte[size] arr;
alignmentTest();
}
- foreach(i; AliasSeq!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
+ foreach (i; AliasSeq!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
test!i();
}
}
@@ -6662,7 +6662,7 @@ enum E
}
E e = E.A | E.B;
// will throw SwitchError
-final switch(e)
+final switch (e)
{
case E.A:
return;
diff --git a/std/uni.d b/std/uni.d
index 5715a15aa..5a13f336d 100644
--- a/std/uni.d
+++ b/std/uni.d
@@ -781,21 +781,21 @@ public enum dchar nelSep = '\u0085'; /// Constant $(CODEPOINT) (0x0085) - next
enum lastDchar = 0x10FFFF;
auto force(T, F)(F from)
- if(isIntegral!T && !is(T == F))
+ if (isIntegral!T && !is(T == F))
{
assert(from <= T.max && from >= T.min);
return cast(T)from;
}
auto force(T, F)(F from)
- if(isBitPacked!T && !is(T == F))
+ if (isBitPacked!T && !is(T == F))
{
assert(from <= 2^^bitSizeOf!T-1);
return T(cast(TypeOfBitPacked!T)from);
}
auto force(T, F)(F from)
- if(is(T == F))
+ if (is(T == F))
{
return from;
}
@@ -803,16 +803,16 @@ auto force(T, F)(F from)
// repeat X times the bit-pattern in val assuming it's length is 'bits'
size_t replicateBits(size_t times, size_t bits)(size_t val) @safe pure nothrow @nogc
{
- static if(times == 1)
+ static if (times == 1)
return val;
- else static if(bits == 1)
+ else static if (bits == 1)
{
- static if(times == size_t.sizeof*8)
+ static if (times == size_t.sizeof*8)
return val ? size_t.max : 0;
else
return val ? (1<= 1)
+ static if (i >= 1)
offsets[i] = offsets[i-1] +
spaceFor!(bitSizeOf!(Types[i-1]))(sizes[i-1]);
}
@@ -876,7 +876,7 @@ struct MultiArray(Types...)
@property void length(size_t new_size)
{
- if(new_size > sz[n])
+ if (new_size > sz[n])
{// extend
size_t delta = (new_size - sz[n]);
sz[n] += delta;
@@ -884,7 +884,7 @@ struct MultiArray(Types...)
storage.length += delta;// extend space at end
// raw_slice!x must follow resize as it could be moved!
// next stmts move all data past this array, last-one-goes-first
- static if(n != dim-1)
+ static if (n != dim-1)
{
auto start = raw_ptr!(n+1);
// len includes delta
@@ -894,24 +894,24 @@ struct MultiArray(Types...)
start[0..delta] = 0;
// offsets are used for raw_slice, ptr etc.
- foreach(i; n+1..dim)
+ foreach (i; n+1..dim)
offsets[i] += delta;
}
}
- else if(new_size < sz[n])
+ else if (new_size < sz[n])
{// shrink
size_t delta = (sz[n] - new_size);
sz[n] -= delta;
delta = spaceFor!(bitSizeOf!(Types[n]))(delta);
// move all data past this array, forward direction
- static if(n != dim-1)
+ static if (n != dim-1)
{
auto start = raw_ptr!(n+1);
size_t len = (storage.ptr+storage.length-start);
copyForward(start[0..len-delta], start[delta..len]);
// adjust offsets last, they affect raw_slice
- foreach(i; n+1..dim)
+ foreach (i; n+1..dim)
offsets[i] -= delta;
}
storage.length -= delta;
@@ -922,16 +922,16 @@ struct MultiArray(Types...)
@property size_t bytes(size_t n=size_t.max)() const
{
- static if(n == size_t.max)
+ static if (n == size_t.max)
return storage.length*size_t.sizeof;
- else static if(n != Types.length-1)
+ else static if (n != Types.length-1)
return (raw_ptr!(n+1)-raw_ptr!n)*size_t.sizeof;
else
return (storage.ptr+storage.length - raw_ptr!n)*size_t.sizeof;
}
void store(OutRange)(scope OutRange sink) const
- if(isOutputRange!(OutRange, char))
+ if (isOutputRange!(OutRange, char))
{
import std.format;
formattedWrite(sink, "[%( 0x%x, %)]", offsets[]);
@@ -942,7 +942,7 @@ struct MultiArray(Types...)
private:
@property auto raw_ptr(size_t n)()inout pure nothrow @nogc
{
- static if(n == 0)
+ static if (n == 0)
return storage.ptr;
else
{
@@ -966,25 +966,25 @@ unittest
static void check(size_t k, T)(ref T m, int n)
{
- foreach(i; 0..n)
+ foreach (i; 0..n)
assert(m.slice!(k)[i] == i+1, text("level:",i," : ",m.slice!(k)[0..n]));
}
static void checkB(size_t k, T)(ref T m, int n)
{
- foreach(i; 0..n)
+ foreach (i; 0..n)
assert(m.slice!(k)[i] == n-i, text("level:",i," : ",m.slice!(k)[0..n]));
}
static void fill(size_t k, T)(ref T m, int n)
{
- foreach(i; 0..n)
+ foreach (i; 0..n)
m.slice!(k)[i] = force!ubyte(i+1);
}
static void fillB(size_t k, T)(ref T m, int n)
{
- foreach(i; 0..n)
+ foreach (i; 0..n)
m.slice!(k)[i] = force!ubyte(n-i);
}
@@ -1097,7 +1097,7 @@ unittest
size_t spaceFor(size_t _bits)(size_t new_len) @safe pure nothrow @nogc
{
enum bits = _bits == 1 ? 1 : ceilPowerOf2(_bits);// see PackedArrayView
- static if(bits > 8*size_t.sizeof)
+ static if (bits > 8*size_t.sizeof)
{
static assert(bits % (size_t.sizeof*8) == 0);
return new_len * bits/(8*size_t.sizeof);
@@ -1117,7 +1117,7 @@ template isBitPackableType(T)
//============================================================================
template PackedArrayView(T)
- if((is(T dummy == BitPacked!(U, sz), U, size_t sz)
+ if ((is(T dummy == BitPacked!(U, sz), U, size_t sz)
&& isBitPackableType!U) || isBitPackableType!T)
{
private enum bits = bitSizeOf!T;
@@ -1126,7 +1126,7 @@ template PackedArrayView(T)
//unsafe and fast access to a chunk of RAM as if it contains packed values
template PackedPtr(T)
- if((is(T dummy == BitPacked!(U, sz), U, size_t sz)
+ if ((is(T dummy == BitPacked!(U, sz), U, size_t sz)
&& isBitPackableType!U) || isBitPackableType!T)
{
private enum bits = bitSizeOf!T;
@@ -1153,7 +1153,7 @@ pure nothrow:
private void simpleWrite(TypeOfBitPacked!T val, size_t n)
in
{
- static if(isIntegral!T)
+ static if (isIntegral!T)
assert(val <= mask);
}
body
@@ -1166,18 +1166,18 @@ pure nothrow:
| (cast(size_t)val << tgt_shift);
}
- static if(factor == bytesPerWord// can safely pack by byte
+ static if (factor == bytesPerWord// can safely pack by byte
|| factor == 1 // a whole word at a time
|| ((factor == bytesPerWord/2 || factor == bytesPerWord/4)
&& hasUnalignedReads)) // this needs unaligned reads
{
- static if(factor == bytesPerWord)
+ static if (factor == bytesPerWord)
alias U = ubyte;
- else static if(factor == bytesPerWord/2)
+ else static if (factor == bytesPerWord/2)
alias U = ushort;
- else static if(factor == bytesPerWord/4)
+ else static if (factor == bytesPerWord/4)
alias U = uint;
- else static if(size_t.sizeof == 8 && factor == bytesPerWord/8)
+ else static if (size_t.sizeof == 8 && factor == bytesPerWord/8)
alias U = ulong;
T opIndex(size_t idx) inout
@@ -1186,7 +1186,7 @@ pure nothrow:
cast(inout(T))(cast(U*)origin)[idx];
}
- static if(isBitPacked!T) // lack of user-defined implicit conversion
+ static if (isBitPacked!T) // lack of user-defined implicit conversion
{
void opIndexAssign(T val, size_t idx)
{
@@ -1196,7 +1196,7 @@ pure nothrow:
void opIndexAssign(TypeOfBitPacked!T val, size_t idx)
{
- if(__ctfe)
+ if (__ctfe)
simpleWrite(val, idx);
else
(cast(U*)origin)[idx] = cast(U)val;
@@ -1209,7 +1209,7 @@ pure nothrow:
return simpleIndex(n);
}
- static if(isBitPacked!T) // lack of user-defined implicit conversion
+ static if (isBitPacked!T) // lack of user-defined implicit conversion
{
void opIndexAssign(T val, size_t idx)
{
@@ -1257,21 +1257,21 @@ pure nothrow:
if ( s >= e)
{
foreach (i; s..e)
- if(ptr[i])
+ if (ptr[i])
return false;
return true;
}
size_t pad_e = roundDown(e);
size_t i;
for(i=s; i= end) //rounded up >= then end of slice
+ if (pad_start >= end) //rounded up >= then end of slice
{
//nothing to gain, use per element assignment
- foreach(i; start..end)
+ foreach (i; start..end)
ptr[i] = val;
return;
}
@@ -1337,7 +1337,7 @@ pure nothrow:
for(i=start; i= max)
+ while (m >= max)
{
- if(pred(range[idx+m], needle))
+ if (pred(range[idx+m], needle))
idx += m;
m /= 2;
}
@@ -1620,16 +1620,16 @@ size_t ceilPowerOf2(size_t arg) @safe pure nothrow @nogc
template sharMethod(alias uniLowerBound)
{
size_t sharMethod(alias _pred="a delta)
+ if (stuff.length > delta)
{// replace increases length
delta = stuff.length - delta;// now, new is > old by delta
- static if(is(Policy == void))
+ static if (is(Policy == void))
dest.length = dest.length+delta;//@@@BUG lame @property
else
dest = Policy.realloc(dest, dest.length+delta);
@@ -1687,7 +1687,7 @@ unittest
dest[to+delta..dest.length]);
copyForward(stuff, dest[from..stuff_end]);
}
- else if(stuff.length == delta)
+ else if (stuff.length == delta)
{
copy(stuff, dest[from..to]);
}
@@ -1697,7 +1697,7 @@ unittest
copy(stuff, dest[from..stuff_end]);
copyForward(dest[to..dest.length],
dest[stuff_end..dest.length-delta]);
- static if(is(Policy == void))
+ static if (is(Policy == void))
dest.length = dest.length - delta;//@@@BUG lame @property
else
dest = Policy.realloc(dest, dest.length-delta);
@@ -1731,19 +1731,19 @@ unittest
}
static void append(T, V)(ref T[] arr, V value)
- if(!isInputRange!V)
+ if (!isInputRange!V)
{
arr ~= force!T(value);
}
static void append(T, V)(ref T[] arr, V value)
- if(isInputRange!V)
+ if (isInputRange!V)
{
insertInPlace(arr, arr.length, value);
}
static void destroy(T)(ref T arr)
- if(isDynamicArray!T && is(Unqual!T == T))
+ if (isDynamicArray!T && is(Unqual!T == T))
{
debug
{
@@ -1753,7 +1753,7 @@ unittest
}
static void destroy(T)(ref T arr)
- if(isDynamicArray!T && !is(Unqual!T == T))
+ if (isDynamicArray!T && !is(Unqual!T == T))
{
arr = null;
}
@@ -1779,7 +1779,7 @@ unittest
static T[] realloc(T)(T[] arr, size_t size)
{
import std.exception : enforce;
- if(!size)
+ if (!size)
{
destroy(arr);
return null;
@@ -1795,14 +1795,14 @@ unittest
}
static void append(T, V)(ref T[] arr, V value)
- if(!isInputRange!V)
+ if (!isInputRange!V)
{
arr = realloc(arr, arr.length+1);
arr[$-1] = force!T(value);
}
static void append(T, V)(ref T[] arr, V value)
- if(isInputRange!V && hasLength!V)
+ if (isInputRange!V && hasLength!V)
{
arr = realloc(arr, arr.length+value.length);
copy(value, arr[$-value.length..$]);
@@ -1810,7 +1810,7 @@ unittest
static void destroy(T)(ref T[] arr)
{
- if(arr.ptr)
+ if (arr.ptr)
free(arr.ptr);
arr = null;
}
@@ -1829,7 +1829,7 @@ unittest
{
replaceImpl(orig, from, to, toReplace);
scope(exit) destroy(orig);
- if(!equalS(orig, result))
+ if (!equalS(orig, result))
return false;
}
return true;
@@ -1852,7 +1852,7 @@ unittest
*/
public template isCodepointSet(T)
{
- static if(is(T dummy == InversionList!(Args), Args...))
+ static if (is(T dummy == InversionList!(Args), Args...))
enum isCodepointSet = true;
else
enum isCodepointSet = false;
@@ -1918,11 +1918,11 @@ pure:
@trusted bool equalS(R1, R2)(R1 lhs, R2 rhs)
{
for(;;){
- if(lhs.empty)
+ if (lhs.empty)
return rhs.empty;
- if(rhs.empty)
+ if (rhs.empty)
return false;
- if(lhs.front != rhs.front)
+ if (lhs.front != rhs.front)
return false;
lhs.popFront();
rhs.popFront();
@@ -1998,10 +1998,10 @@ public:
Construct from another code point set of any type.
*/
this(Set)(Set set) pure
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
uint[] arr;
- foreach(v; set.byInterval)
+ foreach (v; set.byInterval)
{
arr ~= v.a;
arr ~= v.b;
@@ -2013,10 +2013,10 @@ public:
Construct a set from a forward range of code point intervals.
*/
this(Range)(Range intervals) pure
- if(isForwardRange!Range && isIntegralPair!(ElementType!Range))
+ if (isForwardRange!Range && isIntegralPair!(ElementType!Range))
{
uint[] arr;
- foreach(v; intervals)
+ foreach (v; intervals)
{
SP.append(arr, v.a);
SP.append(arr, v.b);
@@ -2081,10 +2081,10 @@ public:
import std.algorithm.comparison : equal;
auto set = CodepointSet('a', 'z'+1, 'а', 'я'+1);
- foreach(v; 'a'..'z'+1)
+ foreach (v; 'a'..'z'+1)
assert(set[v]);
// Cyrillic lowercase interval
- foreach(v; 'а'..'я'+1)
+ foreach (v; 'а'..'я'+1)
assert(set[v]);
//specific order is not required, intervals may interesect
auto set2 = CodepointSet('а', 'я'+1, 'a', 'd', 'b', 'z'+1);
@@ -2138,7 +2138,7 @@ public:
{
immutable len = data.length;
for(size_t i = 0; i < len; i++)
- if(ch < data[i])
+ if (ch < data[i])
return i & 1;
return 0;
}
@@ -2147,7 +2147,7 @@ public:
@property size_t length()
{
size_t sum = 0;
- foreach(iv; byInterval)
+ foreach (iv; byInterval)
{
sum += iv.b - iv.a;
}
@@ -2169,11 +2169,11 @@ public:
)
*/
This opBinary(string op, U)(U rhs)
- if(isCodepointSet!U || is(U:dchar))
+ if (isCodepointSet!U || is(U:dchar))
{
- static if(op == "&" || op == "|" || op == "~")
+ static if (op == "&" || op == "|" || op == "~")
{// symmetric ops thus can swap arguments to reuse r-value
- static if(is(U:dchar))
+ static if (is(U:dchar))
{
auto tmp = this;
mixin("tmp "~op~"= rhs; ");
@@ -2181,7 +2181,7 @@ public:
}
else
{
- static if(is(Unqual!U == U))
+ static if (is(Unqual!U == U))
{
// try hard to reuse r-value
mixin("rhs "~op~"= this;");
@@ -2195,7 +2195,7 @@ public:
}
}
}
- else static if(op == "-") // anti-symmetric
+ else static if (op == "-") // anti-symmetric
{
auto tmp = this;
tmp -= rhs;
@@ -2234,11 +2234,11 @@ public:
/// The 'op=' versions of the above overloaded operators.
ref This opOpAssign(string op, U)(U rhs)
- if(isCodepointSet!U || is(U:dchar))
+ if (isCodepointSet!U || is(U:dchar))
{
- static if(op == "|") // union
+ static if (op == "|") // union
{
- static if(is(U:dchar))
+ static if (is(U:dchar))
{
this.addInterval(rhs, rhs+1);
return this;
@@ -2246,11 +2246,11 @@ public:
else
return this.add(rhs);
}
- else static if(op == "&") // intersection
+ else static if (op == "&") // intersection
return this.intersect(rhs);// overloaded
- else static if(op == "-") // set difference
+ else static if (op == "-") // set difference
return this.sub(rhs);// overloaded
- else static if(op == "~") // symmetric set difference
+ else static if (op == "~") // symmetric set difference
{
auto copy = this & rhs;
this |= rhs;
@@ -2266,7 +2266,7 @@ public:
the same as $(LREF opIndex).
*/
bool opBinaryRight(string op: "in", U)(U ch) const
- if(is(U : dchar))
+ if (is(U : dchar))
{
return this[ch];
}
@@ -2300,7 +2300,7 @@ public:
this(This set)
{
r = set.byInterval;
- if(!r.empty)
+ if (!r.empty)
cur = r.front.a;
}
@@ -2317,10 +2317,10 @@ public:
void popFront()
{
cur++;
- while(cur >= r.front.b)
+ while (cur >= r.front.b)
{
r.popFront();
- if(r.empty)
+ if (r.empty)
break;
cur = r.front.a;
}
@@ -2374,7 +2374,7 @@ public:
{
import std.format;
auto range = byInterval;
- if(range.empty)
+ if (range.empty)
return;
while (1)
@@ -2445,10 +2445,10 @@ private:
package(std) // used from: std.regex.internal.parser
ref intersect(U)(U rhs)
- if(isCodepointSet!U)
+ if (isCodepointSet!U)
{
Marker mark;
- foreach( i; rhs.byInterval)
+ foreach ( i; rhs.byInterval)
{
mark = this.dropUpTo(i.a, mark);
mark = this.skipUpTo(i.b, mark);
@@ -2459,8 +2459,8 @@ private:
ref intersect()(dchar ch)
{
- foreach(i; byInterval)
- if(i.a <= ch && ch < i.b)
+ foreach (i; byInterval)
+ if (i.a <= ch && ch < i.b)
return this = This.init.add(ch, ch+1);
this = This.init;
return this;
@@ -2480,11 +2480,11 @@ private:
// same as the above except that skip & drop parts are swapped
package(std) // used from: std.regex.internal.parser
ref sub(U)(U rhs)
- if(isCodepointSet!U)
+ if (isCodepointSet!U)
{
uint top;
Marker mark;
- foreach(i; rhs.byInterval)
+ foreach (i; rhs.byInterval)
{
mark = this.skipUpTo(i.a, mark);
mark = this.dropUpTo(i.b, mark);
@@ -2494,10 +2494,10 @@ private:
package(std) // used from: std.regex.internal.parse
ref add(U)(U rhs)
- if(isCodepointSet!U)
+ if (isCodepointSet!U)
{
Marker start;
- foreach(i; rhs.byInterval)
+ foreach (i; rhs.byInterval)
{
start = addInterval(i.a, i.b, start);
}
@@ -2515,16 +2515,16 @@ public:
@property auto inverted()
{
InversionList inversion = this;
- if(inversion.data.length == 0)
+ if (inversion.data.length == 0)
{
inversion.addInterval(0, lastDchar+1);
return inversion;
}
- if(inversion.data[0] != 0)
+ if (inversion.data[0] != 0)
genericReplace(inversion.data, 0, 0, [0]);
else
genericReplace(inversion.data, 0, 1, cast(uint[])null);
- if(data[data.length-1] != lastDchar+1)
+ if (data[data.length-1] != lastDchar+1)
genericReplace(inversion.data,
inversion.data.length, inversion.data.length, [lastDchar+1]);
else
@@ -2571,16 +2571,16 @@ public:
---
bool func(dchar ch) @safe pure nothrow @nogc
{
- if(ch < 45)
+ if (ch < 45)
{
- if(ch == 10 || ch == 11) return true;
+ if (ch == 10 || ch == 11) return true;
return false;
}
else if (ch < 65) return true;
else
{
- if(ch < 100) return false;
- if(ch < 200) return true;
+ if (ch < 100) return false;
+ if (ch < 200) return true;
return false;
}
}
@@ -2596,24 +2596,24 @@ public:
{
string result = indent~"{\n";
string deeper = indent~" ";
- foreach(ival; ivals)
+ foreach (ival; ivals)
{
auto span = ival[1] - ival[0];
assert(span != 0);
- if(span == 1)
+ if (span == 1)
{
- result ~= format("%sif(ch == %s) return true;\n", deeper, ival[0]);
+ result ~= format("%sif (ch == %s) return true;\n", deeper, ival[0]);
}
- else if(span == 2)
+ else if (span == 2)
{
- result ~= format("%sif(ch == %s || ch == %s) return true;\n",
+ result ~= format("%sif (ch == %s || ch == %s) return true;\n",
deeper, ival[0], ival[0]+1);
}
else
{
- if(ival[0] != 0) // dchar is unsigned and < 0 is useless
- result ~= format("%sif(ch < %s) return false;\n", deeper, ival[0]);
- result ~= format("%sif(ch < %s) return true;\n", deeper, ival[1]);
+ if (ival[0] != 0) // dchar is unsigned and < 0 is useless
+ result ~= format("%sif (ch < %s) return false;\n", deeper, ival[0]);
+ result ~= format("%sif (ch < %s) return true;\n", deeper, ival[1]);
}
}
result ~= format("%sreturn false;\n%s}\n", deeper, indent); // including empty range of intervals
@@ -2623,7 +2623,7 @@ public:
static string binaryScope(R)(R ivals, string indent)
{
// time to do unrolled comparisons?
- if(ivals.length < maxBinary)
+ if (ivals.length < maxBinary)
return linearScope(ivals, indent);
else
return bisect(ivals, ivals.length/2, indent);
@@ -2633,11 +2633,11 @@ public:
// and GDC is doing fine job either way
static string switchScope(R)(R ivals, string indent)
{
- string result = indent~"switch(ch){\n";
+ string result = indent~"switch (ch){\n";
string deeper = indent~" ";
- foreach(ival; ivals)
+ foreach (ival; ivals)
{
- if(ival[0]+1 == ival[1])
+ if (ival[0]+1 == ival[1])
{
result ~= format("%scase %s: return true;\n",
deeper, ival[0]);
@@ -2658,7 +2658,7 @@ public:
// bisect on one [a, b) interval at idx
string result = indent~"{\n";
// less branch, < a
- result ~= format("%sif(ch < %s)\n%s",
+ result ~= format("%sif (ch < %s)\n%s",
deeper, range[idx][0], binaryScope(range[0..idx], deeper));
// middle point, >= a && < b
result ~= format("%selse if (ch < %s) return true;\n",
@@ -2674,7 +2674,7 @@ public:
auto range = byInterval.array();
// special case first bisection to be on ASCII vs beyond
auto tillAscii = countUntil!"a[0] > 0x80"(range);
- if(tillAscii <= 0) // everything is ASCII or nothing is ascii (-1 & 0)
+ if (tillAscii <= 0) // everything is ASCII or nothing is ascii (-1 & 0)
code ~= binaryScope(range, "");
else
code ~= bisect(range, tillAscii, "");
@@ -2836,7 +2836,7 @@ private:
ref subChar(dchar ch)
{
auto mark = skipUpTo(ch);
- if(mark != data.length
+ if (mark != data.length
&& data[mark] == ch && data[mark-1] == ch)
{
// it has split, meaning that ch happens to be in one of intervals
@@ -2857,7 +2857,7 @@ private:
auto range = assumeSorted(data[]);
size_t pos;
size_t a_idx = hint + range[hint..$].lowerBound!(SearchPolicy.gallop)(a).length;
- if(a_idx == range.length)
+ if (a_idx == range.length)
{
// [---+++----++++----++++++]
// [ a b]
@@ -2871,11 +2871,11 @@ private:
{
writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx);
}
- if(b_idx == range.length)
+ if (b_idx == range.length)
{
// [-------++++++++----++++++-]
// [ s a b]
- if(a_idx & 1)// a in positive
+ if (a_idx & 1)// a in positive
{
buf[0] = b;
to_insert = 1;
@@ -2897,9 +2897,9 @@ private:
writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx);
writefln("a=%s; b=%s; top=%s;", a, b, top);
}
- if(a_idx & 1)
+ if (a_idx & 1)
{// a in positive
- if(b_idx & 1)// b in positive
+ if (b_idx & 1)// b in positive
{
// [-------++++++++----++++++-]
// [ s a b ]
@@ -2910,7 +2910,7 @@ private:
{
// [-------++++++++----++++++-]
// [ s a b ]
- if(top == b)
+ if (top == b)
{
assert(b_idx+1 < data.length);
buf[0] = data[b_idx+1];
@@ -2924,7 +2924,7 @@ private:
}
else
{ // a in negative
- if(b_idx & 1) // b in positive
+ if (b_idx & 1) // b in positive
{
// [----------+++++----++++++-]
// [ a b ]
@@ -2936,7 +2936,7 @@ private:
{
// [----------+++++----++++++-]
// [ a s b ]
- if(top == b)
+ if (top == b)
{
assert(b_idx+1 < data.length);
buf[0] = a;
@@ -2968,7 +2968,7 @@ private:
body
{
auto range = assumeSorted!"a<=b"(data[pos..data.length]);
- if(range.empty)
+ if (range.empty)
return pos;
size_t idx = pos;
idx += range.lowerBound(a).length;
@@ -2978,9 +2978,9 @@ private:
writeln("dropUpTo full length=", data.length);
writeln(pos,"~~~", idx);
}
- if(idx == data.length)
+ if (idx == data.length)
return genericReplace(data, pos, idx, cast(uint[])[]);
- if(idx & 1)
+ if (idx & 1)
{ // a in positive
//[--+++----++++++----+++++++------...]
// |<---si s a t
@@ -3008,17 +3008,17 @@ private:
auto range = assumeSorted!"a<=b"(data[pos..data.length]);
size_t idx = pos+range.lowerBound(a).length;
- if(idx >= data.length) // could have Marker point to recently removed stuff
+ if (idx >= data.length) // could have Marker point to recently removed stuff
return data.length;
- if(idx & 1)// inside of interval, check for split
+ if (idx & 1)// inside of interval, check for split
{
uint top = data[idx];
- if(top == a)// no need to split, it's end
+ if (top == a)// no need to split, it's end
return idx+1;
uint start = data[idx-1];
- if(a == start)
+ if (a == start)
return idx-1;
// split it up
genericReplace(data, idx, idx+1, [a, a, top]);
@@ -3088,7 +3088,7 @@ private:
uint read24(const ubyte* ptr, size_t idx) @safe pure nothrow @nogc
{
- static if(hasUnalignedReads)
+ static if (hasUnalignedReads)
return __ctfe ? safeRead24(ptr, idx) : unalignedRead24(ptr, idx);
else
return safeRead24(ptr, idx);
@@ -3096,7 +3096,7 @@ uint read24(const ubyte* ptr, size_t idx) @safe pure nothrow @nogc
void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
{
- static if(hasUnalignedReads)
+ static if (hasUnalignedReads)
return __ctfe ? safeWrite24(ptr, val, idx) : unalignedWrite24(ptr, val, idx);
else
return safeWrite24(ptr, val, idx);
@@ -3114,7 +3114,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
}
this(Range)(Range range)
- if(isInputRange!Range && hasLength!Range)
+ if (isInputRange!Range && hasLength!Range)
{
import std.algorithm : copy;
length = range.length;
@@ -3122,7 +3122,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
}
this(Range)(Range range)
- if(isForwardRange!Range && !hasLength!Range)
+ if (isForwardRange!Range && !hasLength!Range)
{
import std.algorithm : copy;
auto len = walkLength(range.save);
@@ -3132,7 +3132,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
this(this)
{
- if(!empty)
+ if (!empty)
{
refCount = refCount + 1;
}
@@ -3140,10 +3140,10 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
~this()
{
- if(!empty)
+ if (!empty)
{
auto cnt = refCount;
- if(cnt == 1)
+ if (cnt == 1)
SP.destroy(data);
else
refCount = cnt - 1;
@@ -3163,21 +3163,21 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
@property void length(size_t len)
{
import std.algorithm : min, copy;
- if(len == 0)
+ if (len == 0)
{
- if(!empty)
+ if (!empty)
freeThisReference();
return;
}
immutable total = len + 1; // including ref-count
- if(empty)
+ if (empty)
{
data = SP.alloc!uint(total);
refCount = 1;
return;
}
auto cur_cnt = refCount;
- if(cur_cnt != 1) // have more references to this memory
+ if (cur_cnt != 1) // have more references to this memory
{
refCount = cur_cnt - 1;
auto new_data = SP.alloc!uint(total);
@@ -3205,7 +3205,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
void opIndexAssign(uint val, size_t idx)
{
auto cnt = refCount;
- if(cnt != 1)
+ if (cnt != 1)
dupThisReference(cnt);
data[idx] = val;
}
@@ -3213,10 +3213,10 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
//
auto opSlice(size_t from, size_t to)
{
- if(!empty)
+ if (!empty)
{
auto cnt = refCount;
- if(cnt != 1)
+ if (cnt != 1)
dupThisReference(cnt);
}
return data[from .. to];
@@ -3242,7 +3242,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
}
void append(Range)(Range range)
- if(isInputRange!Range && hasLength!Range && is(ElementType!Range : uint))
+ if (isInputRange!Range && hasLength!Range && is(ElementType!Range : uint))
{
size_t nl = length + range.length;
length = nl;
@@ -3257,7 +3257,7 @@ void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc
bool opEquals()(auto const ref CowArray rhs)const
{
- if(empty ^ rhs.empty)
+ if (empty ^ rhs.empty)
return false; // one is empty and the other isn't
return empty || data[0..$-1] == rhs.data[0..$-1];
}
@@ -3277,7 +3277,7 @@ private:
void freeThisReference()
{
auto count = refCount;
- if(count != 1) // have more references to this memory
+ if (count != 1) // have more references to this memory
{
// dec shared ref-count
refCount = count - 1;
@@ -3358,7 +3358,7 @@ private:
assert(u24 != u24_2);
}
- foreach(Policy; AliasSeq!(GcPolicy, ReallocPolicy))
+ foreach (Policy; AliasSeq!(GcPolicy, ReallocPolicy))
{
alias Range = typeof(CowArray!Policy.init[]);
alias U24A = CowArray!Policy;
@@ -3382,7 +3382,7 @@ private:
assert(arr[0] == 72);
assert(arr2[0] == 11);
// set this to about 100M to stress-test COW memory management
- foreach(v; 0..10_000)
+ foreach (v; 0..10_000)
func2(arr);
assert(equalS(arr[], [72, 0xFE_FEFE, 100]));
@@ -3402,7 +3402,7 @@ version(unittest)
@safe unittest// core set primitives test
{
import std.conv;
- foreach(CodeList; AllSets)
+ foreach (CodeList; AllSets)
{
CodeList a;
//"plug a hole" test
@@ -3482,7 +3482,7 @@ version(unittest)
import std.typecons;
//ensure constructor handles bad ordering and overlap
auto c1 = CodepointSet('а', 'я'+1, 'А','Я'+1);
- foreach(ch; chain(iota('а', 'я'+1), iota('А','Я'+1)))
+ foreach (ch; chain(iota('а', 'я'+1), iota('А','Я'+1)))
assert(ch in c1, to!string(ch));
//contiguos
@@ -3521,7 +3521,7 @@ version(unittest)
@safe unittest
{ // full set operations
import std.conv;
- foreach(CodeList; AllSets)
+ foreach (CodeList; AllSets)
{
CodeList a, b, c, d;
@@ -3635,7 +3635,7 @@ version(unittest)
{
import std.conv;
import std.typecons;
- foreach(CodeList; AliasSeq!(InversionList!(ReallocPolicy)))
+ foreach (CodeList; AliasSeq!(InversionList!(ReallocPolicy)))
{
auto arr = "ABCDEFGHIJKLMabcdefghijklm"d;
auto a = CodeList('A','N','a', 'n');
@@ -3652,13 +3652,13 @@ version(unittest)
}
auto achr = a.byCodepoint;
assert(equalS(achr, arr), text(a.byCodepoint));
- foreach(ch; a.byCodepoint)
+ foreach (ch; a.byCodepoint)
assert(a[ch]);
auto x = CodeList(100, 500, 600, 900, 1200, 1500);
assert(equalS(x.byInterval, [ tuple(100, 500), tuple(600, 900), tuple(1200, 1500)]), text(x.byInterval));
- foreach(ch; x.byCodepoint)
+ foreach (ch; x.byCodepoint)
assert(x[ch]);
- static if(is(CodeList == CodepointSet))
+ static if (is(CodeList == CodepointSet))
{
auto y = CodeList(x.byInterval);
assert(equalS(x.byInterval, y.byInterval));
@@ -3676,7 +3676,7 @@ version(unittest)
auto arrayRepr(T)(T x)
{
import std.conv : text;
- if(x.length > 32)
+ if (x.length > 32)
{
return text(x[0..16],"~...~", x[x.length-16..x.length]);
}
@@ -3695,11 +3695,11 @@ auto arrayRepr(T)(T x)
template mapTrieIndex(Prefix...)
{
size_t mapTrieIndex(Key)(Key key)
- if(isValidPrefixForTrie!(Key, Prefix))
+ if (isValidPrefixForTrie!(Key, Prefix))
{
alias p = Prefix;
size_t idx;
- foreach(i, v; p[0..$-1])
+ foreach (i, v; p[0..$-1])
{
idx |= p[i](key);
idx <<= p[i+1].bitSize;
@@ -3716,25 +3716,25 @@ template mapTrieIndex(Prefix...)
See $(LREF buildTrie) for generic helpers built on top of it.
*/
@trusted struct TrieBuilder(Value, Key, Args...)
- if(isBitPackableType!Value && isValidArgsForTrie!(Key, Args))
+ if (isBitPackableType!Value && isValidArgsForTrie!(Key, Args))
{
import std.exception : enforce;
private:
// last index is not stored in table, it is used as an offset to values in a block.
- static if(is(Value == bool))// always pack bool
+ static if (is(Value == bool))// always pack bool
alias V = BitPacked!(Value, 1);
else
alias V = Value;
static auto deduceMaxIndex(Preds...)()
{
size_t idx = 1;
- foreach(v; Preds)
+ foreach (v; Preds)
idx *= 2^^v.bitSize;
return idx;
}
- static if(is(typeof(Args[0]) : Key)) // Args start with upper bound on Key
+ static if (is(typeof(Args[0]) : Key)) // Args start with upper bound on Key
{
alias Prefix = Args[1..$];
enum lastPageSize = 2^^Prefix[$-1].bitSize;
@@ -3780,12 +3780,12 @@ private:
{
alias j = idx!level;
enum pageSize = 1<= pageSize)
+ while (numVals >= pageSize)
{
numVals -= pageSize;
ptr[j..j+pageSize] = val;
@@ -3834,7 +3834,7 @@ private:
spillToNextPage!level(ptr);
}
}
- if(numVals)
+ if (numVals)
{
// the leftovers, an incomplete page
ptr[j..j+numVals] = val;
@@ -3847,7 +3847,7 @@ private:
{
// last level (i.e. topmost) has 1 "page"
// thus it need not to add a new page on upper level
- static if(level != 0)
+ static if (level != 0)
spillToNextPageImpl!(level)(ptr);
}
@@ -3864,7 +3864,7 @@ private:
size_t j;
for(j=0; j 0)
+ static if (sizes.length > 0)
alias GetBitSlicing =
AliasSeq!(sliceBits!(top - sizes[0], top),
GetBitSlicing!(top - sizes[0], sizes[1..$]));
@@ -4107,7 +4107,7 @@ template callableWith(T)
{
template callableWith(alias Pred)
{
- static if(!is(typeof(Pred(T.init))))
+ static if (!is(typeof(Pred(T.init))))
enum callableWith = false;
else
{
@@ -4134,7 +4134,7 @@ template isValidPrefixForTrie(Key, Prefix...)
*/
template isValidArgsForTrie(Key, Args...)
{
- static if(Args.length > 1)
+ static if (Args.length > 1)
{
enum isValidArgsForTrie = isValidPrefixForTrie!(Key, Args)
|| (isValidPrefixForTrie!(Key, Args[1..$]) && is(typeof(Args[0]) : Key));
@@ -4146,7 +4146,7 @@ template isValidArgsForTrie(Key, Args...)
@property size_t sumOfIntegerTuple(ints...)()
{
size_t count=0;
- foreach(v; ints)
+ foreach (v; ints)
count += v;
return count;
}
@@ -4167,11 +4167,11 @@ template isValidArgsForTrie(Key, Args...)
auto set = unicode("Number");
auto trie = codepointSetTrie!(8, 5, 8)(set);
writeln("Input code points to test:");
- foreach(line; stdin.byLine)
+ foreach (line; stdin.byLine)
{
int count=0;
- foreach(dchar ch; line)
- if(trie[ch])// is number
+ foreach (dchar ch; line)
+ if (trie[ch])// is number
count++;
writefln("Contains %d number code points.", count);
}
@@ -4179,13 +4179,13 @@ template isValidArgsForTrie(Key, Args...)
---
*/
public template codepointSetTrie(sizes...)
- if(sumOfIntegerTuple!sizes == 21)
+ if (sumOfIntegerTuple!sizes == 21)
{
auto codepointSetTrie(Set)(Set set)
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
auto builder = TrieBuilder!(bool, dchar, lastDchar+1, GetBitSlicing!(21, sizes))(false);
- foreach(ival; set.byInterval)
+ foreach (ival; set.byInterval)
builder.putRange(ival[0], ival[1], true);
return builder.build();
}
@@ -4193,7 +4193,7 @@ public template codepointSetTrie(sizes...)
/// Type of Trie generated by codepointSetTrie function.
public template CodepointSetTrie(sizes...)
- if(sumOfIntegerTuple!sizes == 21)
+ if (sumOfIntegerTuple!sizes == 21)
{
alias Prefix = GetBitSlicing!(21, sizes);
alias CodepointSetTrie = typeof(TrieBuilder!(bool, dchar, lastDchar+1, Prefix)(false).build());
@@ -4210,14 +4210,14 @@ public template CodepointSetTrie(sizes...)
only to bool mapping $(D Trie)s.
*/
public template codepointTrie(T, sizes...)
- if(sumOfIntegerTuple!sizes == 21)
+ if (sumOfIntegerTuple!sizes == 21)
{
alias Prefix = GetBitSlicing!(21, sizes);
- static if(is(TypeOfBitPacked!T == bool))
+ static if (is(TypeOfBitPacked!T == bool))
{
auto codepointTrie(Set)(in Set set)
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
return codepointSetTrie(set);
}
@@ -4230,7 +4230,7 @@ public template codepointTrie(T, sizes...)
// unsorted range of pairs
auto codepointTrie(R)(R range, T defValue=T.init)
- if(isInputRange!R
+ if (isInputRange!R
&& is(typeof(ElementType!R.init[0]) : T)
&& is(typeof(ElementType!R.init[1]) : dchar))
{
@@ -4258,13 +4258,13 @@ pure unittest
// e.g. arabic letter DDAL (\u0688) has a "luck factor" of 2
ubyte[6] nibbles; // 6 4-bit chunks of code point
uint value = ch;
- foreach(i; 0..6)
+ foreach (i; 0..6)
{
nibbles[i] = value & 0xF;
value >>= 4;
}
uint luck;
- foreach(n; nibbles)
+ foreach (n; nibbles)
luck = cast(uint)max(luck, count(nibbles[], n));
return luck;
}
@@ -4274,14 +4274,14 @@ pure unittest
// create a temporary associative array (AA)
LuckFactor[dchar] map;
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
map[ch] = LuckFactor(luckFactor(ch));
// bits per stage are chosen randomly, fell free to optimize
auto trie = codepointTrie!(LuckFactor, 8, 5, 8)(map);
// from now on the AA is not needed
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
assert(trie[ch] == luckFactor(ch)); // verify
// CJK is not Greek, thus it has the default value
assert(trie['\u4444'] == 0);
@@ -4295,7 +4295,7 @@ pure unittest
/// Type of Trie as generated by codepointTrie function.
public template CodepointTrie(T, sizes...)
- if(sumOfIntegerTuple!sizes == 21)
+ if (sumOfIntegerTuple!sizes == 21)
{
alias Prefix = GetBitSlicing!(21, sizes);
alias CodepointTrie = typeof(TrieBuilder!(T, dchar, lastDchar+1, Prefix)(T.init).build());
@@ -4325,9 +4325,9 @@ public template cmpK0(alias Pred)
and the maximum Key is deduced from predicates.
*/
public template buildTrie(Value, Key, Args...)
- if(isValidArgsForTrie!(Key, Args))
+ if (isValidArgsForTrie!(Key, Args))
{
- static if(is(typeof(Args[0]) : Key)) // prefix starts with upper bound on Key
+ static if (is(typeof(Args[0]) : Key)) // prefix starts with upper bound on Key
{
alias Prefix = Args[1..$];
}
@@ -4339,7 +4339,7 @@ public template buildTrie(Value, Key, Args...)
// for multi-sort
template GetComparators(size_t n)
{
- static if(n > 0)
+ static if (n > 0)
alias GetComparators =
AliasSeq!(GetComparators!(n-1), cmpK0!(Prefix[n-1]));
else
@@ -4362,11 +4362,11 @@ public template buildTrie(Value, Key, Args...)
$(XREF _algorithm, setUnion).
*/
auto buildTrie(Range)(Range range, Value filler=Value.init)
- if(isInputRange!Range && is(typeof(Range.init.front[0]) : Value)
+ if (isInputRange!Range && is(typeof(Range.init.front[0]) : Value)
&& is(typeof(Range.init.front[1]) : Key))
{
auto builder = TrieBuilder!(Value, Key, Prefix)(filler);
- foreach(v; range)
+ foreach (v; range)
builder.putValue(v[1], v[0]);
return builder.build();
}
@@ -4382,24 +4382,24 @@ public template buildTrie(Value, Key, Args...)
and $(D filler) is false.
*/
auto buildTrie(Range)(Range range, Value filler=Value.init)
- if(is(TypeOfBitPacked!Value == bool)
+ if (is(TypeOfBitPacked!Value == bool)
&& isInputRange!Range && is(typeof(Range.init.front[0]) : Key)
&& is(typeof(Range.init.front[1]) : Key))
{
auto builder = TrieBuilder!(Value, Key, Prefix)(filler);
- foreach(ival; range)
+ foreach (ival; range)
builder.putRange(ival[0], ival[1], !filler);
return builder.build();
}
auto buildTrie(Range)(Range range, Value filler, bool unsorted)
- if(isInputRange!Range
+ if (isInputRange!Range
&& is(typeof(Range.init.front[0]) : Value)
&& is(typeof(Range.init.front[1]) : Key))
{
import std.algorithm : multiSort;
alias Comps = GetComparators!(Prefix.length);
- if(unsorted)
+ if (unsorted)
multiSort!(Comps)(range);
return buildTrie(range, filler);
}
@@ -4414,11 +4414,11 @@ public template buildTrie(Value, Key, Args...)
If no filler provided keys map to true, and $(D filler) is false.
*/
auto buildTrie(Range)(Range range, Value filler=Value.init)
- if(is(TypeOfBitPacked!Value == bool)
+ if (is(TypeOfBitPacked!Value == bool)
&& isInputRange!Range && is(typeof(Range.init.front) : Key))
{
auto builder = TrieBuilder!(Value, Key, Prefix)(filler);
- foreach(v; range)
+ foreach (v; range)
builder.putValue(v, !filler);
return builder.build();
}
@@ -4428,10 +4428,10 @@ public template buildTrie(Value, Key, Args...)
of values where array index serves as key.
*/
auto buildTrie()(Value[] array, Value filler=Value.init)
- if(isUnsigned!Key)
+ if (isUnsigned!Key)
{
auto builder = TrieBuilder!(Value, Key, Prefix)(filler);
- foreach(idx, v; array)
+ foreach (idx, v; array)
builder.putValue(idx, v);
return builder.build();
}
@@ -4489,21 +4489,21 @@ public struct MatcherConcept
of the result of test.)
*/
public bool match(Range)(ref Range inp)
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
assert(false);
}
///ditto
public bool skip(Range)(ref Range inp)
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
assert(false);
}
///ditto
public bool test(Range)(ref Range inp)
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
assert(false);
}
@@ -4573,7 +4573,7 @@ public enum isUtfMatcher(M, C) = __traits(compiles, (){
M m;
assert(is(typeof(m.match(d)) == bool));
assert(is(typeof(m.test(d)) == bool));
- static if(is(typeof(m.skip(d))))
+ static if (is(typeof(m.skip(d))))
{
assert(is(typeof(m.skip(d)) == bool));
assert(is(typeof(m.skip(s)) == bool));
@@ -4659,14 +4659,14 @@ template Utf8Matcher()
}
static auto encode(size_t sz)(dchar ch)
- if(sz > 1)
+ if (sz > 1)
{
import std.utf : encode;
char[4] buf;
std.utf.encode(buf, ch);
char[sz] ret;
buf[0] &= leadMask!sz;
- foreach(n; 1..sz)
+ foreach (n; 1..sz)
buf[n] = buf[n] & 0x3f; //keep 6 lower bits
ret[] = buf[0..sz];
return ret;
@@ -4699,7 +4699,7 @@ template Utf8Matcher()
static auto genDispatch()
{
string code;
- foreach(size; UniSizes)
+ foreach (size; UniSizes)
code ~= format(q{
if ((ch & ~leadMask!%d) == encMask!(%d))
return lookup!(%d, mode)(inp);
@@ -4714,17 +4714,17 @@ template Utf8Matcher()
enum dispatch = genDispatch();
public bool match(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
enum mode = Mode.skipOnMatch;
assert(!inp.empty);
auto ch = inp[0];
- static if(hasASCII)
+ static if (hasASCII)
{
if (ch < 0x80)
{
bool r = tab!1[ch];
- if(r)
+ if (r)
inp.popFront();
return r;
}
@@ -4735,15 +4735,15 @@ template Utf8Matcher()
mixin(dispatch);
}
- static if(Sizes.length == 4) // can skip iff can detect all encodings
+ static if (Sizes.length == 4) // can skip iff can detect all encodings
{
public bool skip(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
enum mode = Mode.alwaysSkip;
assert(!inp.empty);
auto ch = inp[0];
- static if(hasASCII)
+ static if (hasASCII)
{
if (ch < 0x80)
{
@@ -4759,12 +4759,12 @@ template Utf8Matcher()
}
public bool test(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : char))
+ if (isRandomAccessRange!Range && is(ElementType!Range : char))
{
enum mode = Mode.neverSkip;
assert(!inp.empty);
auto ch = inp[0];
- static if(hasASCII)
+ static if (hasASCII)
{
if (ch < 0x80)
return tab!1[ch];
@@ -4776,19 +4776,19 @@ template Utf8Matcher()
}
bool match(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"match"(str);
}
bool skip(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"skip"(str);
}
bool test(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"test"(str);
}
@@ -4816,45 +4816,45 @@ template Utf8Matcher()
bool lookup(int size, Mode mode, Range)(ref Range inp) const pure @trusted
{
import std.typecons;
- if(inp.length < size)
+ if (inp.length < size)
{
badEncoding();
return false;
}
char[size] needle = void;
needle[0] = leadMask!size & inp[0];
- foreach(i; staticIota!(1, size))
+ foreach (i; staticIota!(1, size))
{
needle[i] = truncate(inp[i]);
}
//overlong encoding checks
- static if(size == 2)
+ static if (size == 2)
{
//0x80-0x7FF
//got 6 bits in needle[1], must use at least 8 bits
//must use at least 2 bits in needle[1]
- if(needle[0] < 2) badEncoding();
+ if (needle[0] < 2) badEncoding();
}
- else static if(size == 3)
+ else static if (size == 3)
{
//0x800-0xFFFF
//got 6 bits in needle[2], must use at least 12bits
//must use 6 bits in needle[1] or anything in needle[0]
- if(needle[0] == 0 && needle[1] < 0x20) badEncoding();
+ if (needle[0] == 0 && needle[1] < 0x20) badEncoding();
}
- else static if(size == 4)
+ else static if (size == 4)
{
//0x800-0xFFFF
//got 2x6=12 bits in needle[2..3] must use at least 17bits
//must use 5 bits (or above) in needle[1] or anything in needle[0]
- if(needle[0] == 0 && needle[1] < 0x10) badEncoding();
+ if (needle[0] == 0 && needle[1] < 0x10) badEncoding();
}
- static if(mode == Mode.alwaysSkip)
+ static if (mode == Mode.alwaysSkip)
{
inp.popFrontN(size);
return tab!size[needle];
}
- else static if(mode == Mode.neverSkip)
+ else static if (mode == Mode.neverSkip)
{
return tab!size[needle];
}
@@ -4942,12 +4942,12 @@ template Utf16Matcher()
mixin template DefMatcher()
{
public bool match(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : wchar))
+ if (isRandomAccessRange!Range && is(ElementType!Range : wchar))
{
enum mode = Mode.skipOnMatch;
assert(!inp.empty);
auto ch = inp[0];
- static if(sizeFlags & 1)
+ static if (sizeFlags & 1)
{
if (ch < 0x80)
{
@@ -4965,15 +4965,15 @@ template Utf16Matcher()
return lookupUni!mode(inp);
}
- static if(Sizes.length == 2)
+ static if (Sizes.length == 2)
{
public bool skip(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : wchar))
+ if (isRandomAccessRange!Range && is(ElementType!Range : wchar))
{
enum mode = Mode.alwaysSkip;
assert(!inp.empty);
auto ch = inp[0];
- static if(sizeFlags & 1)
+ static if (sizeFlags & 1)
{
if (ch < 0x80)
{
@@ -4989,31 +4989,31 @@ template Utf16Matcher()
}
public bool test(Range)(ref Range inp) const pure @trusted
- if(isRandomAccessRange!Range && is(ElementType!Range : wchar))
+ if (isRandomAccessRange!Range && is(ElementType!Range : wchar))
{
enum mode = Mode.neverSkip;
assert(!inp.empty);
auto ch = inp[0];
- static if(sizeFlags & 1)
+ static if (sizeFlags & 1)
return ch < 0x80 ? ascii[ch] : lookupUni!mode(inp);
else
return lookupUni!mode(inp);
}
bool match(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"match"(str);
}
bool skip(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"skip"(str);
}
bool test(C)(ref C[] str) const pure @trusted
- if(isSomeChar!C)
+ if (isSomeChar!C)
{
return fwdStr!"test"(str);
}
@@ -5022,22 +5022,22 @@ template Utf16Matcher()
}
struct Impl(Sizes...)
- if(Sizes.length >= 1 && Sizes.length <= 2)
+ if (Sizes.length >= 1 && Sizes.length <= 2)
{
private:
static assert(allSatisfy!(validSize, Sizes),
"Only lengths of 1 and 2 code units are possible in UTF-16");
- static if(Sizes.length > 1)
+ static if (Sizes.length > 1)
enum sizeFlags = Sizes[0] | Sizes[1];
else
enum sizeFlags = Sizes[0];
- static if(sizeFlags & 1)
+ static if (sizeFlags & 1)
{
Ascii ascii;
Bmp bmp;
}
- static if(sizeFlags & 2)
+ static if (sizeFlags & 2)
{
Uni uni;
}
@@ -5052,16 +5052,16 @@ template Utf16Matcher()
{
wchar x = cast(wchar)(inp[0] - 0xD800);
//not a high surrogate
- if(x > 0x3FF)
+ if (x > 0x3FF)
{
//low surrogate
- if(x <= 0x7FF) badEncoding();
- static if(sizeFlags & 1)
+ if (x <= 0x7FF) badEncoding();
+ static if (sizeFlags & 1)
{
auto ch = inp[0];
- static if(mode == Mode.alwaysSkip)
+ static if (mode == Mode.alwaysSkip)
inp.popFront();
- static if(mode == Mode.skipOnMatch)
+ static if (mode == Mode.skipOnMatch)
{
if (bmp[ch])
{
@@ -5079,18 +5079,18 @@ template Utf16Matcher()
}
else
{
- static if(sizeFlags & 2)
+ static if (sizeFlags & 2)
{
- if(inp.length < 2)
+ if (inp.length < 2)
badEncoding();
wchar y = cast(wchar)(inp[1] - 0xDC00);
//not a low surrogate
- if(y > 0x3FF)
+ if (y > 0x3FF)
badEncoding();
wchar[2] needle = [inp[0] & 0x3ff, inp[1] & 0x3ff];
- static if(mode == Mode.alwaysSkip)
+ static if (mode == Mode.alwaysSkip)
inp.popFrontN(2);
- static if(mode == Mode.skipOnMatch)
+ static if (mode == Mode.skipOnMatch)
{
if (uni[needle])
{
@@ -5110,13 +5110,13 @@ template Utf16Matcher()
}
struct CherryPick(I, Sizes...)
- if(Sizes.length >= 1 && Sizes.length <= 2)
+ if (Sizes.length >= 1 && Sizes.length <= 2)
{
private:
I* m;
enum sizeFlags = I.sizeFlags;
- static if(sizeFlags & 1)
+ static if (sizeFlags & 1)
{
@property ref ascii()() const pure{ return m.ascii; }
}
@@ -5149,13 +5149,13 @@ private auto utf16Matcher(Set)(Set set) @trusted
See $(LREF MatcherConcept) for API outline.
*/
public auto utfMatcher(Char, Set)(Set set) @trusted
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
- static if(is(Char : char))
+ static if (is(Char : char))
return utf8Matcher(set);
- else static if(is(Char : wchar))
+ else static if (is(Char : wchar))
return utf16Matcher(set);
- else static if(is(Char : dchar))
+ else static if (is(Char : dchar))
static assert(false, "UTF-32 needs no decoding,
and thus not supported by utfMatcher");
else
@@ -5165,7 +5165,7 @@ public auto utfMatcher(Char, Set)(Set set) @trusted
//a range of code units, packed with index to speed up forward iteration
package auto decoder(C)(C[] s, size_t offset=0) @safe pure nothrow @nogc
- if(is(C : wchar) || is(C : char))
+ if (is(C : wchar) || is(C : char))
{
static struct Decoder
{
@@ -5194,7 +5194,7 @@ package auto decoder(C)(C[] s, size_t offset=0) @safe pure nothrow @nogc
range of $(S_LINK Code unit, code units).
*/
package auto units(C)(C[] s) @safe pure nothrow @nogc
- if(is(C : wchar) || is(C : char))
+ if (is(C : wchar) || is(C : char))
{
static struct Units
{
@@ -5243,7 +5243,7 @@ package auto units(C)(C[] s) @safe pure nothrow @nogc
assert(!utf8.test(codec));
assert(!utf8.skip(codec));
assert(utf8.test(codec));
- foreach(i; 0..7)
+ foreach (i; 0..7)
{
assert(!asc.test(codec));
assert(uni.test(codec));
@@ -5262,7 +5262,7 @@ package auto units(C)(C[] s) @safe pure nothrow @nogc
assert(!utf8.skip(codec));
assert(!utf8.skip(codec));
- foreach(i; 0..7)
+ foreach (i; 0..7)
{
assert(!asc.test(codec));
assert(utf8.test(codec));
@@ -5283,7 +5283,7 @@ package auto units(C)(C[] s) @safe pure nothrow @nogc
assert(t == m.match(r));
assert(r.idx == save || t); //ether no change or was match
r.idx = save;
- static if(is(typeof(m.skip(r))))
+ static if (is(typeof(m.skip(r))))
{
assert(t == m.skip(r));
assert(r.idx != save); //always changed
@@ -5299,7 +5299,7 @@ package auto units(C)(C[] s) @safe pure nothrow @nogc
auto uni2 = utf8.subMatcher!2;
auto uni3 = utf8.subMatcher!3;
auto uni24 = utf8.subMatcher!(2,4);
- foreach(ch; unicode.L.byCodepoint.stride(3))
+ foreach (ch; unicode.L.byCodepoint.stride(3))
{
import std.utf : encode;
char[4] buf;
@@ -5334,7 +5334,7 @@ unittest
alias fails8 = AliasSeq!("\xC1", "\x80\x00","\xC0\x00", "\xCF\x79",
"\xFF\x00\0x00\0x00\x00", "\xC0\0x80\0x80\x80", "\x80\0x00\0x00\x00",
"\xCF\x00\0x00\0x00\x00");
- foreach(msg; fails8){
+ foreach (msg; fails8){
assert(collectException((){
auto s = msg;
import std.utf;
@@ -5345,7 +5345,7 @@ unittest
}
//decode failure cases UTF-16
alias fails16 = AliasSeq!([0xD811], [0xDC02]);
- foreach(msg; fails16){
+ foreach (msg; fails16){
assert(collectException((){
auto s = msg.map!(x => cast(wchar)x);
utf16.test(s);
@@ -5373,15 +5373,15 @@ unittest
+/
public auto toTrie(size_t level, Set)(Set set)
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
- static if(level == 1)
+ static if (level == 1)
return codepointSetTrie!(21)(set);
- else static if(level == 2)
+ else static if (level == 2)
return codepointSetTrie!(10, 11)(set);
- else static if(level == 3)
+ else static if (level == 3)
return codepointSetTrie!(8, 5, 8)(set);
- else static if(level == 4)
+ else static if (level == 4)
return codepointSetTrie!(6, 4, 4, 7)(set);
else
static assert(false,
@@ -5399,7 +5399,7 @@ public auto toTrie(size_t level, Set)(Set set)
See the $(S_LINK Synopsis, Synopsis) section for example.
*/
public auto toDelegate(Set)(Set set)
- if(isCodepointSet!Set)
+ if (isCodepointSet!Set)
{
// 3 is very small and is almost as fast as 2-level (due to CPU caches?)
auto t = toTrie!3(set);
@@ -5421,7 +5421,7 @@ public auto toDelegate(Set)(Set set)
operator to perform the conversion.)
*/
struct BitPacked(T, size_t sz)
- if(isIntegral!T || is(T:dchar))
+ if (isIntegral!T || is(T:dchar))
{
enum bitSize = sz;
T _value;
@@ -5434,14 +5434,14 @@ struct BitPacked(T, size_t sz)
or a return type of a given functor.
*/
template bitSizeOf(Args...)
- if(Args.length == 1)
+ if (Args.length == 1)
{
alias T = Args[0];
- static if(__traits(compiles, { size_t val = T.bitSize; })) //(is(typeof(T.bitSize) : size_t))
+ static if (__traits(compiles, { size_t val = T.bitSize; })) //(is(typeof(T.bitSize) : size_t))
{
enum bitSizeOf = T.bitSize;
}
- else static if(is(ReturnType!T dummy == BitPacked!(U, bits), U, size_t bits))
+ else static if (is(ReturnType!T dummy == BitPacked!(U, bits), U, size_t bits))
{
enum bitSizeOf = bitSizeOf!(ReturnType!T);
}
@@ -5457,7 +5457,7 @@ template bitSizeOf(Args...)
*/
template isBitPacked(T)
{
- static if(is(T dummy == BitPacked!(U, bits), U, size_t bits))
+ static if (is(T dummy == BitPacked!(U, bits), U, size_t bits))
enum isBitPacked = true;
else
enum isBitPacked = false;
@@ -5469,7 +5469,7 @@ template isBitPacked(T)
*/
template TypeOfBitPacked(T)
{
- static if(is(T dummy == BitPacked!(U, bits), U, size_t bits))
+ static if (is(T dummy == BitPacked!(U, bits), U, size_t bits))
alias TypeOfBitPacked = U;
else
alias TypeOfBitPacked = T;
@@ -5507,7 +5507,7 @@ struct sliceBits(size_t from, size_t to)
body
{
static assert(from < to);
- static if(from == 0)
+ static if (from == 0)
return x & ((1<> from) & ((1<<(to-from))-1);
@@ -5525,7 +5525,7 @@ static assert(bitSizeOf!(BitPacked!(uint, 2)) == 2);
template Sequence(size_t start, size_t end)
{
- static if(start < end)
+ static if (start < end)
alias Sequence = AliasSeq!(start, Sequence!(start+1, end));
else
alias Sequence = AliasSeq!();
@@ -5543,7 +5543,7 @@ unittest
{
import std.stdio;
writeln("---TRIE FOOTPRINT STATS---");
- foreach(i; staticIota!(0, t.table.dim) )
+ foreach (i; staticIota!(0, t.table.dim) )
{
writefln("lvl%s = %s bytes; %s pages"
, i, t.bytes!i, t.pages!i);
@@ -5552,7 +5552,7 @@ unittest
version(none)
{
writeln("INDEX (excluding value level):");
- foreach(i; staticIota!(0, t.table.dim-1) )
+ foreach (i; staticIota!(0, t.table.dim-1) )
writeln(t.table.slice!(i)[0..t.table.length!i]);
}
writeln("---------------------------");
@@ -5578,9 +5578,9 @@ unittest
1, 18, 256+2, 256+111, 512+1, 512+18, 768+2, 768+111);
auto trie2 = buildTrie!(bool, uint, 1024, mlo8, lo8)(redundant2.byInterval);
trieStats(trie2);
- foreach(e; redundant2.byCodepoint)
+ foreach (e; redundant2.byCodepoint)
assert(trie2[e], text(cast(uint)e, " - ", trie2[e]));
- foreach(i; 0..1024)
+ foreach (i; 0..1024)
{
assert(trie2[i] == (i in redundant2));
}
@@ -5598,7 +5598,7 @@ unittest
sliceBits!(6,8), sliceBits!(4,6), sliceBits!(0,4)
)(redundant3.byInterval);
trieStats(trie3);
- foreach(i; 0..max3)
+ foreach (i; 0..max3)
assert(trie3[i] == (i in redundant3), text(cast(uint)i));
auto redundant4 = Set(
@@ -5609,8 +5609,8 @@ unittest
auto trie4 = buildTrie!(bool, size_t, max4,
sliceBits!(13, 16), sliceBits!(9, 13), sliceBits!(6, 9) , sliceBits!(0, 6)
)(redundant4.byInterval);
- foreach(i; 0..max4){
- if(i in redundant4)
+ foreach (i; 0..max4){
+ if (i in redundant4)
assert(trie4[i], text(cast(uint)i));
}
trieStats(trie4);
@@ -5629,12 +5629,12 @@ unittest
auto a = array(map!(x => to!ubyte(x))(iota(0, 256)));
auto bt = buildTrie!(bool, ubyte, sliceBits!(7, 8), sliceBits!(5, 7), sliceBits!(0, 5))(a);
trieStats(bt);
- foreach(i; 0..256)
+ foreach (i; 0..256)
assert(bt[cast(ubyte)i]);
}
template useItemAt(size_t idx, T)
- if(isIntegral!T || is(T: dchar))
+ if (isIntegral!T || is(T: dchar))
{
size_t impl(in T[] arr){ return arr[idx]; }
alias useItemAt = assumeSize!(impl, 8*T.sizeof);
@@ -5648,7 +5648,7 @@ template useLastItem(T)
template fullBitSize(Prefix...)
{
- static if(Prefix.length > 0)
+ static if (Prefix.length > 0)
enum fullBitSize = bitSizeOf!(Prefix[0])+fullBitSize!(Prefix[1..$]);
else
enum fullBitSize = 0;
@@ -5656,7 +5656,7 @@ template fullBitSize(Prefix...)
template idxTypes(Key, size_t fullBits, Prefix...)
{
- static if(Prefix.length == 1)
+ static if (Prefix.length == 1)
{// the last level is value level, so no index once reduced to 1-level
alias idxTypes = AliasSeq!();
}
@@ -5704,9 +5704,9 @@ bool propertyNameLess(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) @safe pu
@safe void compressTo(uint val, ref ubyte[] arr) pure nothrow
{
// not optimized as usually done 1 time (and not public interface)
- if(val < 128)
+ if (val < 128)
arr ~= cast(ubyte)val;
- else if(val < (1<<13))
+ else if (val < (1<<13))
{
arr ~= (0b1_00<<5) | cast(ubyte)(val>>8);
arr ~= val & 0xFF;
@@ -5724,12 +5724,12 @@ bool propertyNameLess(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) @safe pu
{
import std.exception : enforce;
uint first = arr[idx++];
- if(!(first & 0x80)) // no top bit -> [0..127]
+ if (!(first & 0x80)) // no top bit -> [0..127]
return first;
uint extra = ((first>>5) & 1) + 1; // [1, 2]
uint val = (first & 0x1F);
enforce(idx + extra <= arr.length, "bad code point interval encoding");
- foreach(j; 0..extra)
+ foreach (j; 0..extra)
val = (val<<8) | arr[idx+j];
idx += extra;
return val;
@@ -5737,16 +5737,16 @@ bool propertyNameLess(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) @safe pu
package ubyte[] compressIntervals(Range)(Range intervals)
- if(isInputRange!Range && isIntegralPair!(ElementType!Range))
+ if (isInputRange!Range && isIntegralPair!(ElementType!Range))
{
ubyte[] storage;
uint base = 0;
// RLE encode
- foreach(val; intervals)
+ foreach (val; intervals)
{
compressTo(val[0]-base, storage);
base = val[0];
- if(val[1] != lastDchar+1) // till the end of the domain so don't store it
+ if (val[1] != lastDchar+1) // till the end of the domain so don't store it
{
compressTo(val[1]-base, storage);
base = val[1];
@@ -5803,14 +5803,14 @@ pure:
void popFront()
{
- if(_idx == _stream.length)
+ if (_idx == _stream.length)
{
_idx = size_t.max;
return;
}
uint base = _front[1];
_front[0] = base + decompressFrom(_stream, _idx);
- if(_idx == _stream.length)// odd length ---> till the end
+ if (_idx == _stream.length)// odd length ---> till the end
_front[1] = lastDchar+1;
else
{
@@ -5843,7 +5843,7 @@ else
auto range = assumeSorted!((a,b) => propertyNameLess(a,b))
(table.map!"a.name"());
size_t idx = range.lowerBound(name).length;
- if(idx < range.length && comparePropertyName(range[idx], name) == 0)
+ if (idx < range.length && comparePropertyName(range[idx], name) == 0)
return idx;
return -1;
}
@@ -5852,7 +5852,7 @@ else
@trusted bool loadUnicodeSet(alias table, Set, C)(in C[] name, ref Set dest) pure
{
auto idx = findUnicodeSet!table(name);
- if(idx >= 0)
+ if (idx >= 0)
{
dest = Set(asSet(table[idx].compressed));
return true;
@@ -5865,7 +5865,7 @@ else
{
alias ucmp = comparePropertyName;
// conjure cumulative properties by hand
- if(ucmp(name, "L") == 0 || ucmp(name, "Letter") == 0)
+ if (ucmp(name, "L") == 0 || ucmp(name, "Letter") == 0)
{
target = asSet(uniProps.Lu);
target |= asSet(uniProps.Ll);
@@ -5873,25 +5873,25 @@ else
target |= asSet(uniProps.Lo);
target |= asSet(uniProps.Lm);
}
- else if(ucmp(name,"LC") == 0 || ucmp(name,"Cased Letter")==0)
+ else if (ucmp(name,"LC") == 0 || ucmp(name,"Cased Letter")==0)
{
target = asSet(uniProps.Ll);
target |= asSet(uniProps.Lu);
target |= asSet(uniProps.Lt);// Title case
}
- else if(ucmp(name, "M") == 0 || ucmp(name, "Mark") == 0)
+ else if (ucmp(name, "M") == 0 || ucmp(name, "Mark") == 0)
{
target = asSet(uniProps.Mn);
target |= asSet(uniProps.Mc);
target |= asSet(uniProps.Me);
}
- else if(ucmp(name, "N") == 0 || ucmp(name, "Number") == 0)
+ else if (ucmp(name, "N") == 0 || ucmp(name, "Number") == 0)
{
target = asSet(uniProps.Nd);
target |= asSet(uniProps.Nl);
target |= asSet(uniProps.No);
}
- else if(ucmp(name, "P") == 0 || ucmp(name, "Punctuation") == 0)
+ else if (ucmp(name, "P") == 0 || ucmp(name, "Punctuation") == 0)
{
target = asSet(uniProps.Pc);
target |= asSet(uniProps.Pd);
@@ -5901,20 +5901,20 @@ else
target |= asSet(uniProps.Pf);
target |= asSet(uniProps.Po);
}
- else if(ucmp(name, "S") == 0 || ucmp(name, "Symbol") == 0)
+ else if (ucmp(name, "S") == 0 || ucmp(name, "Symbol") == 0)
{
target = asSet(uniProps.Sm);
target |= asSet(uniProps.Sc);
target |= asSet(uniProps.Sk);
target |= asSet(uniProps.So);
}
- else if(ucmp(name, "Z") == 0 || ucmp(name, "Separator") == 0)
+ else if (ucmp(name, "Z") == 0 || ucmp(name, "Separator") == 0)
{
target = asSet(uniProps.Zs);
target |= asSet(uniProps.Zl);
target |= asSet(uniProps.Zp);
}
- else if(ucmp(name, "C") == 0 || ucmp(name, "Other") == 0)
+ else if (ucmp(name, "C") == 0 || ucmp(name, "Other") == 0)
{
target = asSet(uniProps.Co);
target |= asSet(uniProps.Lo);
@@ -5922,7 +5922,7 @@ else
target |= asSet(uniProps.So);
target |= asSet(uniProps.Po);
}
- else if(ucmp(name, "graphical") == 0){
+ else if (ucmp(name, "graphical") == 0){
target = asSet(uniProps.Alphabetic);
target |= asSet(uniProps.Mn);
@@ -5948,9 +5948,9 @@ else
target |= asSet(uniProps.Sk);
target |= asSet(uniProps.So);
}
- else if(ucmp(name, "any") == 0)
+ else if (ucmp(name, "any") == 0)
target = Set.fromIntervals(0, 0x110000);
- else if(ucmp(name, "ascii") == 0)
+ else if (ucmp(name, "ascii") == 0)
target = Set.fromIntervals(0, 0x80);
else
return loadUnicodeSet!(uniProps.tab)(name, target);
@@ -5987,11 +5987,11 @@ template SetSearcher(alias table, string kind)
{
/// Run-time checked search.
static auto opCall(C)(in C[] name)
- if(is(C : dchar))
+ if (is(C : dchar))
{
import std.conv : to;
CodepointSet set;
- if(loadUnicodeSet!table(name, set))
+ if (loadUnicodeSet!table(name, set))
return set;
throw new Exception("No unicode set for "~kind~" by name "
~name.to!string()~" was found.");
@@ -5999,7 +5999,7 @@ template SetSearcher(alias table, string kind)
/// Compile-time checked search.
static @property auto opDispatch(string name)()
{
- static if(findSetName!table(name))
+ static if (findSetName!table(name))
{
CodepointSet set;
loadUnicodeSet!table(name, set);
@@ -6039,7 +6039,7 @@ template SetSearcher(alias table, string kind)
static @property auto opDispatch(string name)() pure
{
- static if(findAny(name))
+ static if (findAny(name))
return loadAny(name);
else
static assert(false, "No unicode set by name "~name~" was found.");
@@ -6077,7 +6077,7 @@ template SetSearcher(alias table, string kind)
sets.
*/
static auto opCall(C)(in C[] name)
- if(is(C : dchar))
+ if (is(C : dchar))
{
return loadAny(name);
}
@@ -6151,7 +6151,7 @@ template SetSearcher(alias table, string kind)
// L here is syllable type not Letter as in unicode.L short-cut
auto leadingVowel = unicode.hangulSyllableType("L");
// check that some leading vowels are present
- foreach(vowel; '\u1110'..'\u115F')
+ foreach (vowel; '\u1110'..'\u115F')
assert(leadingVowel[vowel]);
assert(leadingVowel == unicode.hangulSyllableType.L);
}
@@ -6173,7 +6173,7 @@ private:
bool loaded = loadProperty(name, set) || loadUnicodeSet!(scripts.tab)(name, set)
|| (name.length > 2 && ucmp(name[0..2],"In") == 0
&& loadUnicodeSet!(blocks.tab)(name[2..$], set));
- if(loaded)
+ if (loaded)
return set;
throw new Exception("No unicode set by name "~name.to!string()~" was found.");
}
@@ -6208,7 +6208,7 @@ template genericDecodeGrapheme(bool getValue)
{
alias graphemeExtend = graphemeExtendTrie;
alias spacingMark = mcTrie;
- static if(getValue)
+ static if (getValue)
alias Value = Grapheme;
else
alias Value = void;
@@ -6223,39 +6223,39 @@ template genericDecodeGrapheme(bool getValue)
V,
LVT
}
- static if(getValue)
+ static if (getValue)
Grapheme grapheme;
auto state = GraphemeState.Start;
enum eat = q{
- static if(getValue)
+ static if (getValue)
grapheme ~= ch;
range.popFront();
};
dchar ch;
assert(!range.empty, "Attempting to decode grapheme from an empty " ~ Input.stringof);
- while(!range.empty)
+ while (!range.empty)
{
ch = range.front;
- final switch(state) with(GraphemeState)
+ final switch (state) with(GraphemeState)
{
case Start:
mixin(eat);
- if(ch == '\r')
+ if (ch == '\r')
state = CR;
- else if(isRegionalIndicator(ch))
+ else if (isRegionalIndicator(ch))
state = RI;
- else if(isHangL(ch))
+ else if (isHangL(ch))
state = L;
- else if(hangLV[ch] || isHangV(ch))
+ else if (hangLV[ch] || isHangV(ch))
state = V;
- else if(hangLVT[ch])
+ else if (hangLVT[ch])
state = LVT;
- else if(isHangT(ch))
+ else if (isHangT(ch))
state = LVT;
else
{
- switch(ch)
+ switch (ch)
{
mixin(controlSwitch);
goto L_End;
@@ -6265,24 +6265,24 @@ template genericDecodeGrapheme(bool getValue)
}
break;
case CR:
- if(ch == '\n')
+ if (ch == '\n')
mixin(eat);
goto L_End_Extend;
case RI:
- if(isRegionalIndicator(ch))
+ if (isRegionalIndicator(ch))
mixin(eat);
else
goto L_End_Extend;
break;
case L:
- if(isHangL(ch))
+ if (isHangL(ch))
mixin(eat);
- else if(isHangV(ch) || hangLV[ch])
+ else if (isHangV(ch) || hangLV[ch])
{
state = V;
mixin(eat);
}
- else if(hangLVT[ch])
+ else if (hangLVT[ch])
{
state = LVT;
mixin(eat);
@@ -6291,9 +6291,9 @@ template genericDecodeGrapheme(bool getValue)
goto L_End_Extend;
break;
case V:
- if(isHangV(ch))
+ if (isHangV(ch))
mixin(eat);
- else if(isHangT(ch))
+ else if (isHangT(ch))
{
state = LVT;
mixin(eat);
@@ -6302,7 +6302,7 @@ template genericDecodeGrapheme(bool getValue)
goto L_End_Extend;
break;
case LVT:
- if(isHangT(ch))
+ if (isHangT(ch))
{
mixin(eat);
}
@@ -6312,16 +6312,16 @@ template genericDecodeGrapheme(bool getValue)
}
}
L_End_Extend:
- while(!range.empty)
+ while (!range.empty)
{
ch = range.front;
// extend & spacing marks
- if(!graphemeExtend[ch] && !spacingMark[ch])
+ if (!graphemeExtend[ch] && !spacingMark[ch])
break;
mixin(eat);
}
L_End:
- static if(getValue)
+ static if (getValue)
return grapheme;
}
@@ -6343,7 +6343,7 @@ public: // Public API continues
length of grapheme cluster
+/
size_t graphemeStride(C)(in C[] input, size_t index)
- if(is(C : dchar))
+ if (is(C : dchar))
{
auto src = input[index..$];
auto n = src.length;
@@ -6373,7 +6373,7 @@ size_t graphemeStride(C)(in C[] input, size_t index)
must be an L-value.
+/
Grapheme decodeGrapheme(Input)(ref Input inp)
- if(isInputRange!Input && is(Unqual!(ElementType!Input) == dchar))
+ if (isInputRange!Input && is(Unqual!(ElementType!Input) == dchar))
{
return genericDecodeGrapheme!true(inp);
}
@@ -6404,7 +6404,7 @@ unittest
$(LREF byCodePoint)
+/
auto byGrapheme(Range)(Range range)
- if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar))
+ if (isInputRange!Range && is(Unqual!(ElementType!Range) == dchar))
{
// TODO: Bidirectional access
static struct Result
@@ -6427,7 +6427,7 @@ auto byGrapheme(Range)(Range range)
_front = _range.empty ? Grapheme.init : _range.decodeGrapheme();
}
- static if(isForwardRange!Range)
+ static if (isForwardRange!Range)
{
Result save() @property
{
@@ -6481,7 +6481,7 @@ unittest
auto gReverse = reverse.byGrapheme;
assert(gReverse.walkLength == 4);
- foreach(text; AliasSeq!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d))
+ foreach (text; AliasSeq!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d))
{
assert(text.walkLength == 5);
static assert(isForwardRange!(typeof(text)));
@@ -6506,7 +6506,7 @@ unittest
$(P Acts as the identity function when given a range of code points.)
+/
auto byCodePoint(Range)(Range range)
- if(isInputRange!Range && is(Unqual!(ElementType!Range) == Grapheme))
+ if (isInputRange!Range && is(Unqual!(ElementType!Range) == Grapheme))
{
// TODO: Propagate bidirectional access
static struct Result
@@ -6528,14 +6528,14 @@ auto byCodePoint(Range)(Range range)
{
++i;
- if(i >= _range.front.length)
+ if (i >= _range.front.length)
{
_range.popFront();
i = 0;
}
}
- static if(isForwardRange!Range)
+ static if (isForwardRange!Range)
{
Result save() @property
{
@@ -6549,7 +6549,7 @@ auto byCodePoint(Range)(Range range)
/// Ditto
Range byCodePoint(Range)(Range range)
- if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar))
+ if (isInputRange!Range && is(Unqual!(ElementType!Range) == dchar))
{
return range;
}
@@ -6611,13 +6611,13 @@ unittest
public:
this(C)(in C[] chars...)
- if(is(C : dchar))
+ if (is(C : dchar))
{
this ~= chars;
}
this(Input)(Input seq)
- if(!isDynamicArray!Input
+ if (!isDynamicArray!Input
&& isInputRange!Input && is(ElementType!Input : dchar))
{
this ~= seq;
@@ -6687,11 +6687,11 @@ public:
+/
ref opOpAssign(string op)(dchar ch)
{
- static if(op == "~")
+ static if (op == "~")
{
- if(!isBig)
+ if (!isBig)
{
- if(slen_ + 1 > small_cap)
+ if (slen_ + 1 > small_cap)
convertToBig();// & fallthrough to "big" branch
else
{
@@ -6702,7 +6702,7 @@ public:
}
assert(isBig);
- if(len_ + 1 > cap_)
+ if (len_ + 1 > cap_)
{
cap_ += grow;
ptr_ = cast(ubyte*)enforce(realloc(ptr_, 3*(cap_+1)),
@@ -6733,11 +6733,11 @@ public:
/// Append all $(CHARACTERS) from the input range $(D inp) to this Grapheme.
ref opOpAssign(string op, Input)(Input inp)
- if(isInputRange!Input && is(ElementType!Input : dchar))
+ if (isInputRange!Input && is(ElementType!Input : dchar))
{
- static if(op == "~")
+ static if (op == "~")
{
- foreach(dchar ch; inp)
+ foreach (dchar ch; inp)
this ~= ch;
return this;
}
@@ -6763,7 +6763,7 @@ public:
this(this)
{
- if(isBig)
+ if (isBig)
{// dup it
auto raw_cap = 3*(cap_+1);
auto p = cast(ubyte*)enforce(malloc(raw_cap), "malloc failed");
@@ -6774,7 +6774,7 @@ public:
~this()
{
- if(isBig)
+ if (isBig)
{
free(ptr_);
}
@@ -6920,7 +6920,7 @@ unittest
assert(!copy.valid);
Grapheme h;
- foreach(dchar v; iota(cast(int)'A', cast(int)'Z'+1).map!"cast(dchar)a"())
+ foreach (dchar v; iota(cast(int)'A', cast(int)'Z'+1).map!"cast(dchar)a"())
h ~= v;
assert(equalS(h[], iota(cast(int)'A', cast(int)'Z'+1)));
}
@@ -6949,31 +6949,31 @@ unittest
$(XREF_PACK algorithm,comparison,cmp)
+/
int sicmp(S1, S2)(S1 str1, S2 str2)
- if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar)
+ if (isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar)
&& isForwardRange!S2 && is(Unqual!(ElementType!S2) == dchar))
{
alias sTable = simpleCaseTable;
size_t ridx=0;
- foreach(dchar lhs; str1)
+ foreach (dchar lhs; str1)
{
- if(ridx == str2.length)
+ if (ridx == str2.length)
return 1;
import std.utf : decode;
dchar rhs = decode(str2, ridx);
int diff = lhs - rhs;
- if(!diff)
+ if (!diff)
continue;
size_t idx = simpleCaseTrie[lhs];
size_t idx2 = simpleCaseTrie[rhs];
// simpleCaseTrie is packed index table
- if(idx != EMPTY_CASE_TRIE)
+ if (idx != EMPTY_CASE_TRIE)
{
- if(idx2 != EMPTY_CASE_TRIE)
+ if (idx2 != EMPTY_CASE_TRIE)
{// both cased chars
// adjust idx --> start of bucket
idx = idx - sTable[idx].n;
idx2 = idx2 - sTable[idx2].n;
- if(idx == idx2)// one bucket, equivalent chars
+ if (idx == idx2)// one bucket, equivalent chars
continue;
else// not the same bucket
diff = sTable[idx].ch - sTable[idx2].ch;
@@ -6981,7 +6981,7 @@ int sicmp(S1, S2)(S1 str1, S2 str2)
else
diff = sTable[idx - sTable[idx].n].ch - rhs;
}
- else if(idx2 != EMPTY_CASE_TRIE)
+ else if (idx2 != EMPTY_CASE_TRIE)
{
diff = lhs - sTable[idx2 - sTable[idx2].n].ch;
}
@@ -7023,7 +7023,7 @@ private int fullCasedCmp(Range)(dchar lhs, dchar rhs, ref Range rtail)
alias fTable = fullCaseTable;
size_t idx = fullCaseTrie[lhs];
// fullCaseTrie is packed index table
- if(idx == EMPTY_CASE_TRIE)
+ if (idx == EMPTY_CASE_TRIE)
return lhs;
size_t start = idx - fTable[idx].n;
size_t end = fTable[idx].size + start;
@@ -7031,9 +7031,9 @@ private int fullCasedCmp(Range)(dchar lhs, dchar rhs, ref Range rtail)
for(idx=start; idx sequence
int cmpLR = fullCasedCmp(lhs, rhs, str2);
- if(!cmpLR)
+ if (!cmpLR)
continue;
// then rhs to sequence
int cmpRL = fullCasedCmp(rhs, lhs, str1);
- if(!cmpRL)
+ if (!cmpRL)
continue;
// cmpXX contain remapped codepoints
// to obtain stable ordering of icmp
@@ -7118,10 +7118,10 @@ unittest
import std.algorithm;
assertCTFEable!(
{
- foreach(cfunc; AliasSeq!(icmp, sicmp))
+ foreach (cfunc; AliasSeq!(icmp, sicmp))
{
- foreach(S1; AliasSeq!(string, wstring, dstring))
- foreach(S2; AliasSeq!(string, wstring, dstring))
+ foreach (S1; AliasSeq!(string, wstring, dstring))
+ foreach (S2; AliasSeq!(string, wstring, dstring))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
assert(cfunc("".to!S1(), "".to!S2()) == 0);
assert(cfunc("A".to!S1(), "".to!S2()) > 0);
@@ -7186,7 +7186,7 @@ package auto simpleCaseFoldings(dchar ch)
@property dchar front() const
{
assert(!empty);
- if(isSmall)
+ if (isSmall)
{
return c;
}
@@ -7196,7 +7196,7 @@ package auto simpleCaseFoldings(dchar ch)
@property bool empty() const
{
- if(isSmall)
+ if (isSmall)
{
return c == 0;
}
@@ -7205,7 +7205,7 @@ package auto simpleCaseFoldings(dchar ch)
@property uint length() const
{
- if(isSmall)
+ if (isSmall)
{
return c == 0 ? 0 : 1;
}
@@ -7214,7 +7214,7 @@ package auto simpleCaseFoldings(dchar ch)
void popFront()
{
- if(isSmall)
+ if (isSmall)
c = 0;
else
{
@@ -7272,7 +7272,7 @@ unittest{
@safe pure nothrow @nogc unittest
{
- foreach(ch; 0..0x80)
+ foreach (ch; 0..0x80)
assert(combiningClass(ch) == 0);
assert(combiningClass('\u05BD') == 22);
assert(combiningClass('\u0300') == 230);
@@ -7317,17 +7317,17 @@ public dchar compose(dchar first, dchar second) pure nothrow
import std.algorithm : map;
import std.range : assumeSorted;
size_t packed = compositionJumpTrie[first];
- if(packed == ushort.max)
+ if (packed == ushort.max)
return dchar.init;
// unpack offset and length
size_t idx = packed & composeIdxMask, cnt = packed >> composeCntShift;
// TODO: optimize this micro binary search (no more then 4-5 steps)
auto r = compositionTable[idx..idx+cnt].map!"a.rhs"().assumeSorted();
auto target = r.lowerBound(second).length;
- if(target == cnt)
+ if (target == cnt)
return dchar.init;
auto entry = compositionTable[idx+target];
- if(entry.rhs != second)
+ if (entry.rhs != second)
return dchar.init;
return entry.composed;
}
@@ -7361,18 +7361,18 @@ public Grapheme decompose(UnicodeDecomposition decompType=Canonical)(dchar ch)
{
import std.internal.unicode_decomp;
import std.algorithm : until;
- static if(decompType == Canonical)
+ static if (decompType == Canonical)
{
alias table = decompCanonTable;
alias mapping = canonMappingTrie;
}
- else static if(decompType == Compatibility)
+ else static if (decompType == Compatibility)
{
alias table = decompCompatTable;
alias mapping = compatMappingTrie;
}
ushort idx = mapping[ch];
- if(!idx) // not found, check hangul arithmetic decomposition
+ if (!idx) // not found, check hangul arithmetic decomposition
return decomposeHangul(ch);
auto decomp = table[idx..$].until(0);
return Grapheme(decomp);
@@ -7437,12 +7437,12 @@ void hangulRecompose(dchar[] seq) pure nothrow @nogc
{
for(size_t idx = 0; idx + 1 < seq.length; )
{
- if(isJamoL(seq[idx]) && isJamoV(seq[idx+1]))
+ if (isJamoL(seq[idx]) && isJamoV(seq[idx+1]))
{
int indexL = seq[idx] - jamoLBase;
int indexV = seq[idx+1] - jamoVBase;
int indexLV = indexL * jamoNCount + indexV * jamoTCount;
- if(idx + 2 < seq.length && isJamoT(seq[idx+2]))
+ if (idx + 2 < seq.length && isJamoT(seq[idx+2]))
{
seq[idx] = jamoSBase + indexLV + seq[idx+2] - jamoTBase;
seq[idx+1] = dchar.init;
@@ -7471,14 +7471,14 @@ public:
Grapheme decomposeHangul(dchar ch)
{
int idxS = cast(int)ch - jamoSBase;
- if(idxS < 0 || idxS >= jamoSCount) return Grapheme(ch);
+ if (idxS < 0 || idxS >= jamoSCount) return Grapheme(ch);
int idxL = idxS / jamoNCount;
int idxV = (idxS % jamoNCount) / jamoTCount;
int idxT = idxS % jamoTCount;
int partL = jamoLBase + idxL;
int partV = jamoVBase + idxV;
- if(idxT > 0) // there is a trailling consonant (T); decomposition
+ if (idxT > 0) // there is a trailling consonant (T); decomposition
return Grapheme(partL, partV, jamoTBase + idxT);
else // decomposition
return Grapheme(partL, partV);
@@ -7502,10 +7502,10 @@ unittest
+/
dchar composeJamo(dchar lead, dchar vowel, dchar trailing=dchar.init) pure nothrow @nogc
{
- if(!isJamoL(lead))
+ if (!isJamoL(lead))
return dchar.init;
int indexL = lead - jamoLBase;
- if(!isJamoV(vowel))
+ if (!isJamoV(vowel))
return dchar.init;
int indexV = vowel - jamoVBase;
int indexLV = indexL * jamoNCount + indexV * jamoTCount;
@@ -7591,7 +7591,7 @@ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input)
import std.array : appender;
auto anchors = splitNormalized!norm(input);
- if(anchors[0] == input.length && anchors[1] == input.length)
+ if (anchors[0] == input.length && anchors[1] == input.length)
return input;
dchar[] decomposed;
decomposed.reserve(31);
@@ -7601,33 +7601,33 @@ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input)
do
{
app.put(input[0..anchors[0]]);
- foreach(dchar ch; input[anchors[0]..anchors[1]])
- static if(norm == NFD || norm == NFC)
+ foreach (dchar ch; input[anchors[0]..anchors[1]])
+ static if (norm == NFD || norm == NFC)
{
- foreach(dchar c; decompose!Canonical(ch)[])
+ foreach (dchar c; decompose!Canonical(ch)[])
decomposed ~= c;
}
else // NFKD & NFKC
{
- foreach(dchar c; decompose!Compatibility(ch)[])
+ foreach (dchar c; decompose!Compatibility(ch)[])
decomposed ~= c;
}
ccc.length = decomposed.length;
size_t firstNonStable = 0;
ubyte lastClazz = 0;
- foreach(idx, dchar ch; decomposed)
+ foreach (idx, dchar ch; decomposed)
{
auto clazz = combiningClass(ch);
ccc[idx] = clazz;
- if(clazz == 0 && lastClazz != 0)
+ if (clazz == 0 && lastClazz != 0)
{
// found a stable code point after unstable ones
sort!("a[0] < b[0]", SwapStrategy.stable)
(zip(ccc[firstNonStable..idx], decomposed[firstNonStable..idx]));
firstNonStable = decomposed.length;
}
- else if(clazz != 0 && lastClazz == 0)
+ else if (clazz != 0 && lastClazz == 0)
{
// found first unstable code point after stable ones
firstNonStable = idx;
@@ -7636,17 +7636,17 @@ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input)
}
sort!("a[0] < b[0]", SwapStrategy.stable)
(zip(ccc[firstNonStable..$], decomposed[firstNonStable..$]));
- static if(norm == NFC || norm == NFKC)
+ static if (norm == NFC || norm == NFKC)
{
import std.algorithm : countUntil;
size_t idx = 0;
auto first = countUntil(ccc, 0);
- if(first >= 0) // no starters?? no recomposition
+ if (first >= 0) // no starters?? no recomposition
{
for(;;)
{
auto second = recompose(first, decomposed, ccc);
- if(second == decomposed.length)
+ if (second == decomposed.length)
break;
first = second;
}
@@ -7654,7 +7654,7 @@ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input)
hangulRecompose(decomposed);
}
}
- static if(norm == NFD || norm == NFKD)
+ static if (norm == NFD || norm == NFKD)
app.put(decomposed);
else
{
@@ -7670,7 +7670,7 @@ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input)
input = input[anchors[1]..$];
// and move on
anchors = splitNormalized!norm(input);
- }while(anchors[0] != input.length);
+ }while (anchors[0] != input.length);
app.put(input[0..anchors[0]]);
return cast(inout(C)[])app.data;
}
@@ -7723,7 +7723,7 @@ private size_t recompose(size_t start, dchar[] input, ubyte[] ccc) pure nothrow
size_t i = start+1;
for(; ; )
{
- if(i == input.length)
+ if (i == input.length)
break;
int curCC = ccc[i];
// In any character sequence beginning with a starter S
@@ -7737,10 +7737,10 @@ private size_t recompose(size_t start, dchar[] input, ubyte[] ccc) pure nothrow
// as ccc are sorted
// C is input[i]
- if(curCC > accumCC)
+ if (curCC > accumCC)
{
dchar comp = compose(input[start], input[i]);
- if(comp != dchar.init)
+ if (comp != dchar.init)
{
input[start] = comp;
input[i] = dchar.init;// put a sentinel
@@ -7750,14 +7750,14 @@ private size_t recompose(size_t start, dchar[] input, ubyte[] ccc) pure nothrow
else {
// if it was a starter then accumCC is now 0, end of loop
accumCC = curCC;
- if(accumCC == 0)
+ if (accumCC == 0)
break;
}
}
else{
// ditto here
accumCC = curCC;
- if(accumCC == 0)
+ if (accumCC == 0)
break;
}
i++;
@@ -7774,21 +7774,21 @@ private auto splitNormalized(NormalizationForm norm, C)(const(C)[] input)
auto result = input;
ubyte lastCC = 0;
- foreach(idx, dchar ch; input)
+ foreach (idx, dchar ch; input)
{
- static if(norm == NFC)
- if(ch < 0x0300)
+ static if (norm == NFC)
+ if (ch < 0x0300)
{
lastCC = 0;
continue;
}
ubyte CC = combiningClass(ch);
- if(lastCC > CC && CC != 0)
+ if (lastCC > CC && CC != 0)
{
return seekStable!norm(idx, input);
}
- if(notAllowedIn!norm(ch))
+ if (notAllowedIn!norm(ch))
{
return seekStable!norm(idx, input);
}
@@ -7806,10 +7806,10 @@ private auto seekStable(NormalizationForm norm, C)(size_t idx, in C[] input)
size_t region_start = 0;// default
for(;;)
{
- if(br.empty)// start is 0
+ if (br.empty)// start is 0
break;
dchar ch = br.back;
- if(combiningClass(ch) == 0 && allowedIn!norm(ch))
+ if (combiningClass(ch) == 0 && allowedIn!norm(ch))
{
region_start = br.length - codeLength!C(ch);
break;
@@ -7818,9 +7818,9 @@ private auto seekStable(NormalizationForm norm, C)(size_t idx, in C[] input)
}
///@@@BUG@@@ can't use find: " find is a nested function and can't be used..."
size_t region_end=input.length;// end is $ by default
- foreach(i, dchar ch; input[idx..$])
+ foreach (i, dchar ch; input[idx..$])
{
- if(combiningClass(ch) == 0 && allowedIn!norm(ch))
+ if (combiningClass(ch) == 0 && allowedIn!norm(ch))
{
region_end = i+idx;
break;
@@ -7853,13 +7853,13 @@ unittest
// not user friendly name but more direct
private bool notAllowedIn(NormalizationForm norm)(dchar ch)
{
- static if(norm == NFC)
+ static if (norm == NFC)
alias qcTrie = nfcQCTrie;
- else static if(norm == NFD)
+ else static if (norm == NFD)
alias qcTrie = nfdQCTrie;
- else static if(norm == NFKC)
+ else static if (norm == NFKC)
alias qcTrie = nfkcQCTrie;
- else static if(norm == NFKD)
+ else static if (norm == NFKD)
alias qcTrie = nfkdQCTrie;
else
static assert("Unknown normalization form "~norm);
@@ -7931,7 +7931,7 @@ public bool isWhite(dchar c)
bool isLower(dchar c)
{
import std.ascii : isLower, isASCII;
- if(isASCII(c))
+ if (isASCII(c))
return isLower(c);
return lowerCaseTrie[c];
}
@@ -7939,7 +7939,7 @@ bool isLower(dchar c)
@safe unittest
{
import std.ascii : isLower;
- foreach(v; 0..0x80)
+ foreach (v; 0..0x80)
assert(isLower(v) == .isLower(v));
assert(.isLower('я'));
assert(.isLower('й'));
@@ -7952,7 +7952,7 @@ bool isLower(dchar c)
// from extended Greek
assert(!.isLower('\u1F18'));
assert(.isLower('\u1F00'));
- foreach(v; unicode.lowerCase.byCodepoint)
+ foreach (v; unicode.lowerCase.byCodepoint)
assert(.isLower(v) && !isUpper(v));
}
@@ -7964,7 +7964,7 @@ bool isLower(dchar c)
bool isUpper(dchar c)
{
import std.ascii : isUpper, isASCII;
- if(isASCII(c))
+ if (isASCII(c))
return isUpper(c);
return upperCaseTrie[c];
}
@@ -7972,7 +7972,7 @@ bool isUpper(dchar c)
@safe unittest
{
import std.ascii : isLower;
- foreach(v; 0..0x80)
+ foreach (v; 0..0x80)
assert(isLower(v) == .isLower(v));
assert(!isUpper('й'));
assert(isUpper('Ж'));
@@ -7984,7 +7984,7 @@ bool isUpper(dchar c)
// from extended Greek
assert(!isUpper('\u1F00'));
assert(isUpper('\u1F18'));
- foreach(v; unicode.upperCase.byCodepoint)
+ foreach (v; unicode.upperCase.byCodepoint)
assert(isUpper(v) && !.isLower(v));
}
@@ -7995,16 +7995,16 @@ bool isUpper(dchar c)
private dchar toTitlecase(dchar c)
{
// optimize ASCII case
- if(c < 0xAA)
+ if (c < 0xAA)
{
- if(c < 'a')
+ if (c < 'a')
return c;
- if(c <= 'z')
+ if (c <= 'z')
return c - 32;
return c;
}
size_t idx = toTitleSimpleIndex(c);
- if(idx != ushort.max)
+ if (idx != ushort.max)
{
return toTitleTab(idx);
}
@@ -8016,23 +8016,23 @@ private alias LowerTriple = AliasSeq!(toLowerIndex, MAX_SIMPLE_LOWER, toLowerTab
// generic toUpper/toLower on whole string, creates new or returns as is
private S toCase(alias indexFn, uint maxIdx, alias tableFn, S)(S s) @trusted pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
import std.array : appender;
- foreach(i, dchar cOuter; s)
+ foreach (i, dchar cOuter; s)
{
ushort idx = indexFn(cOuter);
- if(idx == ushort.max)
+ if (idx == ushort.max)
continue;
auto result = appender!S(s[0..i]);
result.reserve(s.length);
- foreach(dchar c; s[i .. $])
+ foreach (dchar c; s[i .. $])
{
idx = indexFn(c);
- if(idx == ushort.max)
+ if (idx == ushort.max)
result.put(c);
- else if(idx < maxIdx)
+ else if (idx < maxIdx)
{
c = tableFn(idx);
result.put(c);
@@ -8043,7 +8043,7 @@ private S toCase(alias indexFn, uint maxIdx, alias tableFn, S)(S s) @trusted pur
// unpack length + codepoint
uint len = val>>24;
result.put(cast(dchar)(val & 0xFF_FFFF));
- foreach(j; idx+1..idx+len)
+ foreach (j; idx+1..idx+len)
result.put(tableFn(j));
}
}
@@ -8547,24 +8547,24 @@ private void toCaseInPlace(alias indexFn, uint maxIdx, alias tableFn, C)(ref C[]
// then have to copy if a re-cased char was smaller the original
// later we may regain pace with char that got bigger
// In the end it sometimes flip-flops between the 2 cases below
- if(dest == from)
+ if (dest == from)
return to;
// got to copy
- foreach(C c; str[from..to])
+ foreach (C c; str[from..to])
str[dest++] = c;
return dest;
}
- while(curIdx != s.length)
+ while (curIdx != s.length)
{
size_t startIdx = curIdx;
dchar ch = decode(s, curIdx);
// TODO: special case for ASCII
auto caseIndex = indexFn(ch);
- if(caseIndex == ushort.max) // unchanged, skip over
+ if (caseIndex == ushort.max) // unchanged, skip over
{
continue;
}
- else if(caseIndex < maxIdx) // 1:1 codepoint mapping
+ else if (caseIndex < maxIdx) // 1:1 codepoint mapping
{
// previous cased chars had the same length as uncased ones
// thus can just adjust pointer
@@ -8572,7 +8572,7 @@ private void toCaseInPlace(alias indexFn, uint maxIdx, alias tableFn, C)(ref C[]
lastUnchanged = curIdx;
dchar cased = tableFn(caseIndex);
auto casedLen = codeLength!C(cased);
- if(casedLen + destIdx > curIdx) // no place to fit cased char
+ if (casedLen + destIdx > curIdx) // no place to fit cased char
{
// switch to slow codepath, where we allocate
return slowToCase(s, startIdx, destIdx);
@@ -8590,7 +8590,7 @@ private void toCaseInPlace(alias indexFn, uint maxIdx, alias tableFn, C)(ref C[]
}
assert(destIdx <= curIdx);
}
- if(lastUnchanged != s.length)
+ if (lastUnchanged != s.length)
{
destIdx = moveTo(s, destIdx, lastUnchanged, s.length);
}
@@ -8606,14 +8606,14 @@ private template toCaseLength(alias indexFn, uint maxIdx, alias tableFn)
size_t codeLen = 0;
size_t lastNonTrivial = 0;
size_t curIdx = 0;
- while(curIdx != str.length)
+ while (curIdx != str.length)
{
size_t startIdx = curIdx;
dchar ch = decode(str, curIdx);
ushort caseIndex = indexFn(ch);
- if(caseIndex == ushort.max)
+ if (caseIndex == ushort.max)
continue;
- else if(caseIndex < maxIdx)
+ else if (caseIndex < maxIdx)
{
codeLen += startIdx - lastNonTrivial;
lastNonTrivial = curIdx;
@@ -8628,11 +8628,11 @@ private template toCaseLength(alias indexFn, uint maxIdx, alias tableFn)
auto len = val>>24;
dchar cased = val & 0xFF_FFFF;
codeLen += codeLength!C(cased);
- foreach(j; caseIndex+1..caseIndex+len)
+ foreach (j; caseIndex+1..caseIndex+len)
codeLen += codeLength!C(tableFn(j));
}
}
- if(lastNonTrivial != str.length)
+ if (lastNonTrivial != str.length)
codeLen += str.length - lastNonTrivial;
return codeLen;
}
@@ -8660,16 +8660,16 @@ private template toCaseInPlaceAlloc(alias indexFn, uint maxIdx, alias tableFn)
C[] ns = new C[trueLength];
ns[0..destIdx] = s[0..destIdx];
size_t lastUnchanged = curIdx;
- while(curIdx != s.length)
+ while (curIdx != s.length)
{
size_t startIdx = curIdx; // start of current codepoint
dchar ch = decode(s, curIdx);
auto caseIndex = indexFn(ch);
- if(caseIndex == ushort.max) // skip over
+ if (caseIndex == ushort.max) // skip over
{
continue;
}
- else if(caseIndex < maxIdx) // 1:1 codepoint mapping
+ else if (caseIndex < maxIdx) // 1:1 codepoint mapping
{
dchar cased = tableFn(caseIndex);
auto toCopy = startIdx - lastUnchanged;
@@ -8688,11 +8688,11 @@ private template toCaseInPlaceAlloc(alias indexFn, uint maxIdx, alias tableFn)
// unpack length + codepoint
uint len = val>>24;
destIdx = encodeTo(ns, destIdx, cast(dchar)(val & 0xFF_FFFF));
- foreach(j; caseIndex+1..caseIndex+len)
+ foreach (j; caseIndex+1..caseIndex+len)
destIdx = encodeTo(ns, destIdx, tableFn(j));
}
}
- if(lastUnchanged != s.length)
+ if (lastUnchanged != s.length)
{
auto toCopy = s.length - lastUnchanged;
ns[destIdx..destIdx+toCopy] = s[lastUnchanged..$];
@@ -8758,16 +8758,16 @@ void toUpperInPlace(C)(ref C[] s) @trusted pure
dchar toLower(dchar c)
{
// optimize ASCII case
- if(c < 0xAA)
+ if (c < 0xAA)
{
- if(c < 'A')
+ if (c < 'A')
return c;
- if(c <= 'Z')
+ if (c <= 'Z')
return c + 32;
return c;
}
size_t idx = toLowerSimpleIndex(c);
- if(idx != ushort.max)
+ if (idx != ushort.max)
{
return toLowerTab(idx);
}
@@ -8780,7 +8780,7 @@ dchar toLower(dchar c)
If none of $(D s) characters were affected, then $(D s) itself is returned.
+/
S toLower(S)(S s) @trusted pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
return toCase!(LowerTriple)(s);
}
@@ -8800,11 +8800,11 @@ S toLower(S)(S s) @trusted pure
{
import std.format : format;
static import std.ascii;
- foreach(ch; 0..0x80)
+ foreach (ch; 0..0x80)
assert(std.ascii.toLower(ch) == toLower(ch));
assert(toLower('Я') == 'я');
assert(toLower('Δ') == 'δ');
- foreach(ch; unicode.upperCase.byCodepoint)
+ foreach (ch; unicode.upperCase.byCodepoint)
{
dchar low = ch.toLower();
assert(low == ch || isLower(low), format("%s -> %s", ch, low));
@@ -8894,16 +8894,16 @@ unittest
dchar toUpper(dchar c)
{
// optimize ASCII case
- if(c < 0xAA)
+ if (c < 0xAA)
{
- if(c < 'a')
+ if (c < 'a')
return c;
- if(c <= 'z')
+ if (c <= 'z')
return c - 32;
return c;
}
size_t idx = toUpperSimpleIndex(c);
- if(idx != ushort.max)
+ if (idx != ushort.max)
{
return toUpperTab(idx);
}
@@ -8926,12 +8926,12 @@ unittest
{
import std.format : format;
static import std.ascii;
- foreach(ch; 0..0x80)
+ foreach (ch; 0..0x80)
assert(std.ascii.toUpper(ch) == toUpper(ch));
assert(toUpper('я') == 'Я');
assert(toUpper('δ') == 'Δ');
auto title = unicode.Titlecase_Letter;
- foreach(ch; unicode.lowerCase.byCodepoint)
+ foreach (ch; unicode.lowerCase.byCodepoint)
{
dchar up = ch.toUpper();
assert(up == ch || isUpper(up) || title[up],
@@ -8945,7 +8945,7 @@ unittest
If none of $(D s) characters were affected, then $(D s) itself is returned.
+/
S toUpper(S)(S s) @trusted pure
- if(isSomeString!S)
+ if (isSomeString!S)
{
return toCase!(UpperTriple)(s);
}
@@ -9006,7 +9006,7 @@ unittest
assert(upInp == trueUp,
format(diff, cast(ubyte[])s, cast(ubyte[])upInp, cast(ubyte[])trueUp));
}
- foreach(S; AliasSeq!(dstring, wstring, string))
+ foreach (S; AliasSeq!(dstring, wstring, string))
{
S easy = "123";
@@ -9017,7 +9017,7 @@ unittest
S[] lower = ["123", "abcфеж", "\u0131\u023f\u03c9", "i\u0307\u1Fe2"];
S[] upper = ["123", "ABCФЕЖ", "I\u2c7e\u2126", "\u0130\u03A5\u0308\u0300"];
- foreach(val; AliasSeq!(easy, good))
+ foreach (val; AliasSeq!(easy, good))
{
auto e = val.dup;
auto g = e;
@@ -9026,15 +9026,15 @@ unittest
e.toLowerInPlace();
assert(e is g);
}
- foreach(i, v; options)
+ foreach (i, v; options)
{
doTest(v, upper[i], lower[i]);
}
// a few combinatorial runs
- foreach(i; 0..options.length)
- foreach(j; i..options.length)
- foreach(k; j..options.length)
+ foreach (i; 0..options.length)
+ foreach (j; i..options.length)
+ foreach (k; j..options.length)
{
auto sample = options[i] ~ options[j] ~ options[k];
auto sample2 = options[k] ~ options[j] ~ options[i];
@@ -9055,15 +9055,15 @@ unittest
bool isAlpha(dchar c)
{
// optimization
- if(c < 0xAA)
+ if (c < 0xAA)
{
size_t x = c - 'A';
- if(x <= 'Z' - 'A')
+ if (x <= 'Z' - 'A')
return true;
else
{
x = c - 'a';
- if(x <= 'z'-'a')
+ if (x <= 'z'-'a')
return true;
}
return false;
@@ -9075,9 +9075,9 @@ bool isAlpha(dchar c)
@safe unittest
{
auto alpha = unicode("Alphabetic");
- foreach(ch; alpha.byCodepoint)
+ foreach (ch; alpha.byCodepoint)
assert(isAlpha(ch));
- foreach(ch; 0..0x4000)
+ foreach (ch; 0..0x4000)
assert((ch in alpha) == isAlpha(ch));
}
@@ -9095,9 +9095,9 @@ bool isMark(dchar c)
@safe unittest
{
auto mark = unicode("Mark");
- foreach(ch; mark.byCodepoint)
+ foreach (ch; mark.byCodepoint)
assert(isMark(ch));
- foreach(ch; 0..0x4000)
+ foreach (ch; 0..0x4000)
assert((ch in mark) == isMark(ch));
}
@@ -9122,9 +9122,9 @@ bool isNumber(dchar c)
@safe unittest
{
auto n = unicode("N");
- foreach(ch; n.byCodepoint)
+ foreach (ch; n.byCodepoint)
assert(isNumber(ch));
- foreach(ch; 0..0x4000)
+ foreach (ch; 0..0x4000)
assert((ch in n) == isNumber(ch));
}
@@ -9159,13 +9159,13 @@ bool isAlphaNum(dchar c)
auto n = unicode("N");
auto alpha = unicode("Alphabetic");
- foreach(ch; n.byCodepoint)
+ foreach (ch; n.byCodepoint)
assert(isAlphaNum(ch));
- foreach(ch; alpha.byCodepoint)
+ foreach (ch; alpha.byCodepoint)
assert(isAlphaNum(ch));
- foreach(ch; 0..0x4000)
+ foreach (ch; 0..0x4000)
{
assert(((ch in n) || (ch in alpha)) == isAlphaNum(ch));
}
@@ -9200,7 +9200,7 @@ unittest
assert(isPunctuation('\u005F'));
assert(isPunctuation('\u00AB'));
assert(isPunctuation('\u00BB'));
- foreach(ch; unicode("P").byCodepoint)
+ foreach (ch; unicode("P").byCodepoint)
assert(isPunctuation(ch));
}
@@ -9221,7 +9221,7 @@ unittest
assert(isSymbol('\u002B'));
assert(isSymbol('\u005E'));
assert(isSymbol('\u00A6'));
- foreach(ch; unicode("S").byCodepoint)
+ foreach (ch; unicode("S").byCodepoint)
assert(isSymbol(ch), format("%04x", ch));
}
@@ -9241,9 +9241,9 @@ unittest
{
assert(isSpace('\u0020'));
auto space = unicode.Zs;
- foreach(ch; space.byCodepoint)
+ foreach (ch; space.byCodepoint)
assert(isSpace(ch));
- foreach(ch; 0..0x1000)
+ foreach (ch; 0..0x1000)
assert(isSpace(ch) == space[ch]);
}
@@ -9264,9 +9264,9 @@ unittest
{
auto set = unicode("Graphical");
import std.format : format;
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
assert(isGraphical(ch), format("%4x", ch));
- foreach(ch; 0..0x4000)
+ foreach (ch; 0..0x4000)
assert((ch in set) == isGraphical(ch));
}
@@ -9287,9 +9287,9 @@ unittest
assert(isControl('\u0081'));
assert(!isControl('\u0100'));
auto cc = unicode.Cc;
- foreach(ch; cc.byCodepoint)
+ foreach (ch; cc.byCodepoint)
assert(isControl(ch));
- foreach(ch; 0..0x1000)
+ foreach (ch; 0..0x1000)
assert(isControl(ch) == cc[ch]);
}
@@ -9308,7 +9308,7 @@ bool isFormat(dchar c)
unittest
{
assert(isFormat('\u00AD'));
- foreach(ch; unicode("Format").byCodepoint)
+ foreach (ch; unicode("Format").byCodepoint)
assert(isFormat(ch));
}
@@ -9369,7 +9369,7 @@ bool isNonCharacter(dchar c)
unittest
{
auto set = unicode("Cn");
- foreach(ch; set.byCodepoint)
+ foreach (ch; set.byCodepoint)
assert(isNonCharacter(ch));
}
diff --git a/std/utf.d b/std/utf.d
index 1f91447a3..2c6784a74 100644
--- a/std/utf.d
+++ b/std/utf.d
@@ -382,7 +382,7 @@ unittest // invalid start bytes
0b1111_1111, // 8
0b1000_0000, // continuation byte
];
- foreach(c; invalidStartBytes)
+ foreach (c; invalidStartBytes)
assertThrown!UTFException(stride([c]));
}
diff --git a/std/uuid.d b/std/uuid.d
index 97f48caaa..554b12fba 100644
--- a/std/uuid.d
+++ b/std/uuid.d
@@ -107,7 +107,7 @@ unittest
ids ~= md5UUID("test.name.123");
ids ~= sha1UUID("test.name.123");
- foreach(entry; ids)
+ foreach (entry; ids)
{
assert(entry.variant == UUID.Variant.rfc4122);
}
@@ -135,7 +135,7 @@ public struct UUID
@safe pure nothrow @nogc Char toChar(Char)(size_t i) const
{
- if(i <= 9)
+ if (i <= 9)
return cast(Char)('0' + i);
else
return cast(Char)('a' + (i-10));
@@ -218,7 +218,7 @@ public struct UUID
*/
ubyte[16] data;
private ulong[2] ulongs;
- static if(size_t.sizeof == 4)
+ static if (size_t.sizeof == 4)
private uint[4] uints;
}
@@ -275,11 +275,11 @@ public struct UUID
* You need to pass exactly 16 ubytes.
*/
@safe pure this(T...)(T uuidData)
- if(uuidData.length == 16 && allSatisfy!(isIntegral, T))
+ if (uuidData.length == 16 && allSatisfy!(isIntegral, T))
{
import std.conv : to;
- foreach(idx, it; uuidData)
+ foreach (idx, it; uuidData)
{
this.data[idx] = to!ubyte(it);
}
@@ -331,36 +331,36 @@ public struct UUID
*
* For a less strict parser, see $(LREF parseUUID)
*/
- this(T)(in T[] uuid) if(isSomeChar!(Unqual!T))
+ this(T)(in T[] uuid) if (isSomeChar!(Unqual!T))
{
import std.conv : to, parse;
- if(uuid.length < 36)
+ if (uuid.length < 36)
{
throw new UUIDParsingException(to!string(uuid), 0,
UUIDParsingException.Reason.tooLittle, "Insufficient Input");
}
- if(uuid.length > 36)
+ if (uuid.length > 36)
{
throw new UUIDParsingException(to!string(uuid), 35, UUIDParsingException.Reason.tooMuch,
"Input is too long, need exactly 36 characters");
}
enum skipInd = [skipSeq];
- foreach(pos; skipInd)
- if(uuid[pos] != '-')
+ foreach (pos; skipInd)
+ if (uuid[pos] != '-')
throw new UUIDParsingException(to!string(uuid), pos,
UUIDParsingException.Reason.invalidChar, "Expected '-'");
ubyte[16] data2; //ctfe bug
uint pos = void;
- foreach(i, p; byteSeq)
+ foreach (i, p; byteSeq)
{
enum uint s = 'a'-10-'0';
uint h = uuid[p];
uint l = uuid[p+1];
pos = p;
- if(h < '0') goto Lerr;
- if(l < '0') goto Lerr;
+ if (h < '0') goto Lerr;
+ if (l < '0') goto Lerr;
if (h > '9')
{
h |= 0x20; //poorman's tolower
@@ -406,7 +406,7 @@ public struct UUID
import std.meta;
import std.conv : to;
- foreach(S; AliasSeq!(char[], const(char)[], immutable(char)[],
+ foreach (S; AliasSeq!(char[], const(char)[], immutable(char)[],
wchar[], const(wchar)[], immutable(wchar)[],
dchar[], const(dchar)[], immutable(dchar)[],
immutable(char[]), immutable(wchar[]), immutable(dchar[])))
@@ -464,13 +464,13 @@ public struct UUID
*/
@trusted pure nothrow @nogc @property bool empty() const
{
- if(__ctfe)
+ if (__ctfe)
return data == (ubyte[16]).init;
auto p = cast(const(size_t*))data.ptr;
- static if(size_t.sizeof == 4)
+ static if (size_t.sizeof == 4)
return p[0] == 0 && p[1] == 0 && p[2] == 0 && p[3] == 0;
- else static if(size_t.sizeof == 8)
+ else static if (size_t.sizeof == 8)
return p[0] == 0 && p[1] == 0;
else
static assert(false, "nonsense, it's not 32 or 64 bit");
@@ -530,11 +530,11 @@ public struct UUID
//which is index 8, since indexes count backwards
auto octet7 = data[8]; //octet 7 is array index 8
- if((octet7 & 0x80) == 0x00) //0b0xxxxxxx
+ if ((octet7 & 0x80) == 0x00) //0b0xxxxxxx
return Variant.ncs;
- else if((octet7 & 0xC0) == 0x80) //0b10xxxxxx
+ else if ((octet7 & 0xC0) == 0x80) //0b10xxxxxx
return Variant.rfc4122;
- else if((octet7 & 0xE0) == 0xC0) //0b110xxxxx
+ else if ((octet7 & 0xE0) == 0xC0) //0b110xxxxx
return Variant.microsoft;
else
{
@@ -567,7 +567,7 @@ public struct UUID
0xd0 : Variant.microsoft,
0xe0 : Variant.future,
0xf0 : Variant.future];
- foreach(key, value; tests)
+ foreach (key, value; tests)
{
UUID u;
u.data[8] = key;
@@ -628,7 +628,7 @@ public struct UUID
0xd0 : UUID.Version.unknown,
0xe0 : UUID.Version.unknown,
0xf0 : UUID.Version.unknown];
- foreach(key, value; tests)
+ foreach (key, value; tests)
{
UUID u;
u.data[6] = key;
@@ -740,7 +740,7 @@ public struct UUID
//MurmurHash2
@safe pure nothrow @nogc size_t toHash() const
{
- static if(size_t.sizeof == 4)
+ static if (size_t.sizeof == 4)
{
enum uint m = 0x5bd1e995;
enum uint n = 16;
@@ -869,9 +869,9 @@ public struct UUID
}
body {
alias Char = typeof(Range.init[0]);
- foreach(pos; skipSeq)
+ foreach (pos; skipSeq)
result[pos] = cast(Char)('-');
- foreach(i, pos; byteSeq)
+ foreach (i, pos; byteSeq)
{
const uint entry = this.data[i];
const uint hi = entry >> 4;
@@ -913,13 +913,13 @@ public struct UUID
@safe pure nothrow @nogc unittest
{
import std.meta: AliasSeq;
- foreach(Char; AliasSeq!(char, wchar, dchar))
+ foreach (Char; AliasSeq!(char, wchar, dchar))
{
alias String = immutable(Char)[];
//CTFE
enum String s = "8ab3060e-2cba-4f23-b74c-b52db3bdfb46";
enum id = UUID(s);
- static if(is(Char == char))
+ static if (is(Char == char))
{
enum p = id.toString();
static assert(s == p);
@@ -1313,28 +1313,28 @@ if (isInputRange!RNG && isIntegral!(ElementType!RNG))
* caused by a malformed UUID parsed at compile time can be cryptic,
* but errors are detected and reported at compile time.
*/
-UUID parseUUID(T)(T uuidString) if(isSomeString!T)
+UUID parseUUID(T)(T uuidString) if (isSomeString!T)
{
return parseUUID(uuidString);
}
///ditto
-UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
+UUID parseUUID(Range)(ref Range uuidRange) if (isInputRange!Range
&& is(Unqual!(ElementType!Range) == dchar))
{
import std.conv : ConvException, parse;
import std.ascii : isHexDigit;
- static if(isForwardRange!Range)
+ static if (isForwardRange!Range)
auto errorCopy = uuidRange.save;
void parserError()(size_t pos, UUIDParsingException.Reason reason, string message, Throwable next = null,
string file = __FILE__, size_t line = __LINE__)
{
- static if(isForwardRange!Range)
+ static if (isForwardRange!Range)
{
import std.conv : to;
- static if(isInfinite!Range)
+ static if (isInfinite!Range)
{
throw new UUIDParsingException(to!string(take(errorCopy, pos)), pos, reason, message,
next, file, line);
@@ -1351,10 +1351,10 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
}
}
- static if(hasLength!Range)
+ static if (hasLength!Range)
{
import std.conv : to;
- if(uuidRange.length < 32)
+ if (uuidRange.length < 32)
{
throw new UUIDParsingException(to!string(uuidRange), 0, UUIDParsingException.Reason.tooLittle,
"Insufficient Input");
@@ -1369,7 +1369,7 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
size_t skip()()
{
size_t skipped;
- while(!uuidRange.empty && !isHexDigit(uuidRange.front))
+ while (!uuidRange.empty && !isHexDigit(uuidRange.front))
{
skipped++;
uuidRange.popFront();
@@ -1379,25 +1379,25 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
consumed += skip();
- if(uuidRange.empty)
+ if (uuidRange.empty)
parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input");
bool dashAllowed = false;
- parseLoop: while(!uuidRange.empty)
+ parseLoop: while (!uuidRange.empty)
{
dchar character = uuidRange.front;
- if(character == '-')
+ if (character == '-')
{
- if(!dashAllowed)
+ if (!dashAllowed)
parserError(consumed, UUIDParsingException.Reason.invalidChar, "Unexpected '-'");
else
dashAllowed = false;
consumed++;
}
- else if(!isHexDigit(character))
+ else if (!isHexDigit(character))
{
parserError(consumed, UUIDParsingException.Reason.invalidChar,
"Unexpected character (wanted a hexDigit)");
@@ -1407,9 +1407,9 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
try
{
consumed += 2;
- static if(isSomeString!Range)
+ static if (isSomeString!Range)
{
- if(uuidRange.length < 2)
+ if (uuidRange.length < 2)
{
parserError(consumed, UUIDParsingException.Reason.tooLittle,
"Insufficient Input");
@@ -1423,7 +1423,7 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
dchar[2] copyBuf;
copyBuf[0] = character;
uuidRange.popFront();
- if(uuidRange.empty)
+ if (uuidRange.empty)
{
parserError(consumed, UUIDParsingException.Reason.tooLittle,
"Insufficient Input");
@@ -1433,7 +1433,7 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
result.data[element++] = parse!ubyte(part, 16);
}
- if(element == 16)
+ if (element == 16)
{
uuidRange.popFront();
break parseLoop;
@@ -1451,11 +1451,11 @@ UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range
}
assert(element <= 16);
- if(element < 16)
+ if (element < 16)
parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input");
consumed += skip();
- if(!uuidRange.empty)
+ if (!uuidRange.empty)
parserError(consumed, UUIDParsingException.Reason.invalidChar, "Unexpected character");
return result;
@@ -1506,7 +1506,7 @@ unittest
return input.empty;
}
- static if(forward)
+ static if (forward)
{
@property TestRange!true save()
{
@@ -1526,7 +1526,7 @@ unittest
//Helper function for unittests - Need to pass ranges by ref
UUID parseHelper(T)(string input)
{
- static if(is(T == TestInputRange) || is(T == TestForwardRange))
+ static if (is(T == TestInputRange) || is(T == TestForwardRange))
{
T range = T(to!dstring(input));
return parseUUID(range);
@@ -1535,7 +1535,7 @@ unittest
return parseUUID(to!T(input));
}
- foreach(S; AliasSeq!(char[], const(char)[], immutable(char)[],
+ foreach (S; AliasSeq!(char[], const(char)[], immutable(char)[],
wchar[], const(wchar)[], immutable(wchar)[],
dchar[], const(dchar)[], immutable(dchar)[],
immutable(char[]), immutable(wchar[]), immutable(dchar[]),
@@ -1668,7 +1668,7 @@ unittest
auto r = regex(uuidRegex, "g");
UUID[] found;
- foreach(c; match(test, r))
+ foreach (c; match(test, r))
{
found ~= UUID(c.hit);
}
diff --git a/std/variant.d b/std/variant.d
index aa406701b..144afff17 100644
--- a/std/variant.d
+++ b/std/variant.d
@@ -499,7 +499,7 @@ private:
}
auto args = cast(Tuple!(ParamTypes))t;
- static if(is(ReturnType!A == void))
+ static if (is(ReturnType!A == void))
{
(*zis)(args.expand);
*p = Variant.init; // void returns uninitialized Variant.
@@ -2173,10 +2173,10 @@ private auto visitImpl(bool Strict, VariantType, Handler...)(VariantType variant
Result result;
- foreach(tidx, T; AllowedTypes)
+ foreach (tidx, T; AllowedTypes)
{
bool added = false;
- foreach(dgidx, dg; Handler)
+ foreach (dgidx, dg; Handler)
{
// Handle normal function objects
static if (isSomeFunction!dg)
@@ -2231,7 +2231,7 @@ private auto visitImpl(bool Strict, VariantType, Handler...)(VariantType variant
throw new VariantException("variant must hold a value before being visited.");
}
- foreach(idx, T; AllowedTypes)
+ foreach (idx, T; AllowedTypes)
{
if (auto ptr = variant.peek!T)
{
diff --git a/std/xml.d b/std/xml.d
index b1a450684..17017fdf7 100644
--- a/std/xml.d
+++ b/std/xml.d
@@ -93,7 +93,7 @@ void main()
// Put it back together again;
auto doc = new Document(new Tag("catalog"));
- foreach(book;books)
+ foreach (book;books)
{
auto element = new Element("book");
element.tag.attr["id"] = book.id;
@@ -150,7 +150,7 @@ bool isChar(dchar c) // rule 2
{
if (c >= 0x20)
return true;
- switch(c)
+ switch (c)
{
case 0xA:
case 0x9:
@@ -713,7 +713,7 @@ class Element : Item
{
this.tag = new Tag(tag_.name);
tag.type = TagType.EMPTY;
- foreach(k,v;tag_.attr) tag.attr[k] = v;
+ foreach (k,v;tag_.attr) tag.attr[k] = v;
tag.tagString = tag_.tagString;
}
@@ -888,7 +888,7 @@ class Element : Item
override size_t toHash() const
{
size_t hash = tag.toHash();
- foreach(item;items) hash += item.toHash();
+ foreach (item;items) hash += item.toHash();
return hash;
}
@@ -909,7 +909,7 @@ class Element : Item
string text(DecodeMode mode=DecodeMode.LOOSE)
{
string buffer;
- foreach(item;items)
+ foreach (item;items)
{
Text t = cast(Text)item;
if (t is null) throw new DecodeException(item.toString());
@@ -940,10 +940,10 @@ class Element : Item
}
string[] a = [ tag.toStartString() ];
- foreach(item;items)
+ foreach (item;items)
{
string[] b = item.pretty(indent);
- foreach(s;b)
+ foreach (s;b)
{
a ~= rightJustify(s,count(s) + indent);
}
@@ -1017,7 +1017,7 @@ class Tag
try { checkName(s,t); }
catch(Err e) { assert(false,"Invalid tag name:" ~ e.toString()); }
- foreach(k,v;attr)
+ foreach (k,v;attr)
{
s = k;
try { checkName(s,t); }
@@ -1068,7 +1068,7 @@ class Tag
if (optc(s,'/')) type = TagType.END;
name = munch(s,"^/>"~whitespace);
munch(s,whitespace);
- while(s.length > 0 && s[0] != '>' && s[0] != '/')
+ while (s.length > 0 && s[0] != '>' && s[0] != '/')
{
string key = munch(s,"^="~whitespace);
munch(s,whitespace);
@@ -1170,7 +1170,7 @@ class Tag
string toNonEndString()
{
string s = "<" ~ name;
- foreach(key,val;attr)
+ foreach (key,val;attr)
s ~= format(" %s=\"%s\"",key,encode(val));
return s;
}
@@ -1970,7 +1970,7 @@ class ElementParser
Tag[string] startTags;
if (tag_ !is null) startTags[tag_.name] = tag_;
- while(s.length != 0)
+ while (s.length != 0)
{
if (startsWith(*s,"