Merge pull request #143 from callumenator/non-void-init

Distinguish between struct initializer and func literal call expression
This commit is contained in:
Hackerpilot 2014-03-05 19:29:25 -08:00
commit 27632afb3b
1 changed files with 7 additions and 1 deletions

View File

@ -3875,7 +3875,13 @@ invariant() foo();
mixin(traceEnterAndExit!(__FUNCTION__));
auto node = allocate!NonVoidInitializer;
if (currentIs(tok!"{"))
node.structInitializer = parseStructInitializer();
{
auto b = peekPastBraces();
if (b !is null && (b.type == tok!"("))
node.assignExpression = parseAssignExpression();
else
node.structInitializer = parseStructInitializer();
}
else if (currentIs(tok!"["))
{
auto b = peekPastBrackets();