From 36faf92bd8a402fab8865c31d6c185e23be1f77d Mon Sep 17 00:00:00 2001 From: k-hara Date: Thu, 7 Jul 2011 06:13:00 +0900 Subject: [PATCH] Fix word wrapping. --- std/format.d | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/std/format.d b/std/format.d index 8274df0ae76..a815808e2c5 100644 --- a/std/format.d +++ b/std/format.d @@ -940,8 +940,7 @@ unittest /** Integrals are formatted like $(D printf) does. */ -void formatValue(Writer, T, Char)(Writer w, T val, - /*ref*/ FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, /*ref*/ FormatSpec!Char f) if (isIntegral!T) { Unqual!T arg = val; @@ -1071,8 +1070,7 @@ if (isIntegral!T) /** * Floating-point values are formatted like $(D printf) does. */ -void formatValue(Writer, D, Char)(Writer w, D obj, - ref FormatSpec!Char f) +void formatValue(Writer, D, Char)(Writer w, D obj, ref FormatSpec!Char f) if (isFloatingPoint!D) { if (f.spec == 'r') @@ -1136,8 +1134,7 @@ unittest $(D bool) is formatted as "true" or "false" with %s and as "1" or "0" with integral-specific format specs. */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T : bool) && !is(T == enum)) { if (f.spec == 's') { @@ -1168,8 +1165,7 @@ if (isSomeChar!T) /** Strings are formatted like printf does. */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isSomeString!T && !isStaticArray!T && !is(T == enum)) { enforce(f.spec == 's'); @@ -1203,8 +1199,7 @@ unittest /** Input ranges are formatted like arrays. */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isInputRange!T && !isSomeString!T) { static if (is(T == class) || is(T == interface) || isPointer!T) @@ -1218,8 +1213,7 @@ if (isInputRange!T && !isSomeString!T) formatRange(w, val, f); } -private void formatRange(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +private void formatRange(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isInputRange!T && !isSomeChar!(ElementType!T)) { auto arr = val; @@ -1296,8 +1290,7 @@ if (isInputRange!T && !isSomeChar!(ElementType!T)) } } -private void formatRange(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +private void formatRange(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isInputRange!T && isSomeChar!(ElementType!T)) { if (!f.flDash) @@ -1336,8 +1329,7 @@ if (isInputRange!T && isSomeChar!(ElementType!T)) } } -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (!isInputRange!T && isDynamicArray!T && !isSomeString!T && !is(const(T) == const(void[]))) { @@ -1393,8 +1385,7 @@ unittest /** $(D void[0]) is formatted as "[]". */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(D == void[0])) { put(w, seqBefore); @@ -1404,8 +1395,7 @@ if (is(D == void[0])) /** Pointers are formatted as hex integers. */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isPointer!T && !isInputRange!T) { const void * p = val; @@ -1460,8 +1450,7 @@ unittest Associative arrays are formatted by using $(D ':') and $(D ' ') as separators. */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isAssociativeArray!T && !is(T == enum)) { bool firstTime = true; @@ -1504,8 +1493,7 @@ struct WriterSink(Writer) --- */ -void formatValue(Writer, T, Char)(Writer w, T val, - ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == struct) && !isInputRange!T) { alias void delegate(const (char)[]) SinkType; @@ -1630,8 +1618,7 @@ unittest /* Formatting a $(D typedef) is deprecated but still kept around for a while. */ -void formatValue(Writer, T, Char) -(Writer w, T val, ref FormatSpec!Char f) +void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == typedef)) { static if (is(T U == typedef)) { @@ -1653,8 +1640,7 @@ unittest 'D'. The untyped signature is for the sake of taking this function's address. */ -private void formatGeneric(Writer, D, Char)(Writer w, const(void)* arg, - ref FormatSpec!Char f) +private void formatGeneric(Writer, D, Char)(Writer w, const(void)* arg, ref FormatSpec!Char f) { formatValue(w, *cast(D*) arg, f); }