diff --git a/Upsilon/Parser/ExpressionSyntax/BadExpressionSyntax.cs b/Upsilon/Parser/ExpressionSyntax/BadExpressionSyntax.cs index ead605e..f2fd32a 100644 --- a/Upsilon/Parser/ExpressionSyntax/BadExpressionSyntax.cs +++ b/Upsilon/Parser/ExpressionSyntax/BadExpressionSyntax.cs @@ -1,9 +1,15 @@ using System.Collections.Generic; +using Upsilon.Text; namespace Upsilon.Parser { public class BadExpressionSyntax : ExpressionSyntax { + public BadExpressionSyntax(TextSpan span) + { + Span = span; + } + public override SyntaxKind Kind => SyntaxKind.BadExpression; public override IEnumerable ChildNodes() { diff --git a/Upsilon/Parser/Parser.cs b/Upsilon/Parser/Parser.cs index 6f92282..2b640ba 100644 --- a/Upsilon/Parser/Parser.cs +++ b/Upsilon/Parser/Parser.cs @@ -352,7 +352,7 @@ namespace Upsilon.Parser if (identifier.Kind != SyntaxKind.VariableExpression) { _diagnostics.LogError("Only identifiers can be used for a multi assignment statement.", identifier.Span); - return new ExpressionStatementSyntax(new BadExpressionSyntax()); + return new ExpressionStatementSyntax(new BadExpressionSyntax(identifier.Span)); } var cast = (VariableExpressionSyntax)identifier; var ls = new List(){cast.Identifier}; @@ -445,7 +445,7 @@ namespace Upsilon.Parser default: _diagnostics.LogBadCharacter(new TextSpan(_position, 1)); NextToken(); - expression = new BadExpressionSyntax(); + expression = new BadExpressionSyntax(new TextSpan(_position, 1)); break; } return expression;