Fix simple expressions not functioning
This commit is contained in:
parent
6a396d6368
commit
b897adccf8
|
@ -296,8 +296,18 @@ namespace Upsilon.Parser
|
||||||
{
|
{
|
||||||
if (!lastCommaFound)
|
if (!lastCommaFound)
|
||||||
break;
|
break;
|
||||||
var parsed = ParseExpression();
|
var parsed = ParseStatement();
|
||||||
arrBuilder.Add(parsed);
|
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;
|
lastCommaFound = Current.Kind == SyntaxKind.Comma;
|
||||||
if (lastCommaFound) NextToken();
|
if (lastCommaFound) NextToken();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue