Skip to content

Commit

Permalink
Revert "Improve error message"
Browse files Browse the repository at this point in the history
This reverts commit 8e41c85.
  • Loading branch information
jmdavis committed Sep 5, 2011
1 parent 528a690 commit 152191c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -2765,34 +2765,26 @@ Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket
if (s.front == rbracket)
{
if (result.length != 0)
goto Lmanyerr;
parseError("Need more input");
s.popFront();
return result;
}
for (size_t i = 0; ; s.popFront(), skipWS(s))
{
if (i == result.length)
goto Lmanyerr;
parseError("Too many input");
result[i++] = parseElement!(ElementType!Target)(s);
skipWS(s);
if (s.front != comma)
{
if (i != result.length)
goto Lfewerr;
parseError("Need more input");
break;
}
}
parseCheck!s(rbracket);

return result;

Lmanyerr:
parseError(text("Too many elements in input, ", result.length, " elements expected."));
assert(0);

Lfewerr:
parseError(text("Too few elements in input, ", result.length, " elements expected."));
assert(0);
}

unittest
Expand Down

0 comments on commit 152191c

Please sign in to comment.