Skip to content

Commit

Permalink
Fix word wrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 4, 2011
1 parent dea92be commit 36faf92
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions std/format.d
Expand Up @@ -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;
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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[])))
{
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand All @@ -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);
}
Expand Down

0 comments on commit 36faf92

Please sign in to comment.