Cleaned up a few things

This commit is contained in:
John Maschmeyer 2012-10-16 19:35:40 -05:00
parent 224349ac9c
commit 258e10aef6
1 changed files with 4 additions and 10 deletions

14
main.d
View File

@ -172,23 +172,17 @@ void main(string[] args)
importDirs ~= dirName(args[1]); importDirs ~= dirName(args[1]);
else else
importDirs ~= getcwd(); importDirs ~= getcwd();
bool useStdin = false; Token[] tokens;
try try
{ {
to!size_t(args[1]); to!size_t(args[1]);
useStdin = true;
}
catch(ConvException e) {}
Token[] tokens;
if (useStdin)
{
string f; string f;
char[] buf; char[] buf;
while (stdin.readln(buf)) while (stdin.readln(buf))
f ~= buf; f ~= buf;
tokens = f.tokenize(); tokens = f.tokenize();
} }
else catch(ConvException e)
{ {
tokens = args[1].readText().tokenize(); tokens = args[1].readText().tokenize();
args.popFront(); args.popFront();