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