Fix simple expressions not functioning
This commit is contained in:
parent
6a396d6368
commit
b897adccf8
|
@ -296,8 +296,18 @@ namespace Upsilon.Parser
|
|||
{
|
||||
if (!lastCommaFound)
|
||||
break;
|
||||
var parsed = ParseExpression();
|
||||
arrBuilder.Add(parsed);
|
||||
var parsed = ParseStatement();
|
||||
SyntaxNode node;
|
||||
if (parsed.Kind == SyntaxKind.ExpressionStatement)
|
||||
node = ((ExpressionStatementSyntax) parsed).Expression;
|
||||
else if (parsed.Kind == SyntaxKind.AssignmentStatement)
|
||||
node = parsed;
|
||||
else
|
||||
{
|
||||
//TODO Better error handling
|
||||
throw new Exception();
|
||||
}
|
||||
arrBuilder.Add(node);
|
||||
lastCommaFound = Current.Kind == SyntaxKind.Comma;
|
||||
if (lastCommaFound) NextToken();
|
||||
|
||||
|
|
Loading…
Reference in New Issue