Merge pull request #88 from callumenator/unaryfix

Fix: unary expression unexpected end, range violations
This commit is contained in:
Hackerpilot 2014-01-28 15:52:00 -08:00
commit 8bf1f5b36f
1 changed files with 4 additions and 0 deletions

View File

@ -3523,6 +3523,8 @@ invariant() foo();
else else
{ {
expect(tok!"new"); expect(tok!"new");
if (!moreTokens())
return null;
node.type = parseType(); node.type = parseType();
if (currentIs(tok!"[")) if (currentIs(tok!"["))
{ {
@ -5651,6 +5653,8 @@ q{(int a, ...)
UnaryExpression parseUnaryExpression() UnaryExpression parseUnaryExpression()
{ {
mixin(traceEnterAndExit!(__FUNCTION__)); mixin(traceEnterAndExit!(__FUNCTION__));
if (!moreTokens())
return null;
auto node = new UnaryExpression; auto node = new UnaryExpression;
switch (current.type) switch (current.type)
{ {