Fix textspan of assignments
This commit is contained in:
parent
0d08ceda17
commit
e5ac28bacf
|
@ -1,8 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using Upsilon.Text;
|
||||
|
||||
namespace Upsilon.Parser
|
||||
{
|
||||
public class AssignmentExpressionSyntax : StatementSyntax
|
||||
public sealed class AssignmentExpressionSyntax : StatementSyntax
|
||||
{
|
||||
public AssignmentExpressionSyntax(SyntaxToken localToken, IdentifierToken identifier, SyntaxToken equalsToken,
|
||||
ExpressionSyntax expression)
|
||||
|
@ -11,6 +12,8 @@ namespace Upsilon.Parser
|
|||
Identifier = identifier;
|
||||
EqualsToken = equalsToken;
|
||||
Expression = expression;
|
||||
var start = LocalToken?.Span.Start ?? Identifier.Span.Start;
|
||||
Span = new TextSpan(start, Expression.Span.End);
|
||||
}
|
||||
|
||||
public override SyntaxKind Kind => SyntaxKind.AssignmentStatement;
|
||||
|
|
Loading…
Reference in New Issue