Add spans to parameterTokens

This commit is contained in:
Deukhoofd 2018-11-28 16:23:45 +01:00
parent 27a7465961
commit a64df2ff6b
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using Upsilon.Text;
namespace Upsilon.Parser
{
@ -6,12 +7,15 @@ namespace Upsilon.Parser
{
public ParameterToken(IdentifierToken typeName, IdentifierToken identifierName)
{
IdentifierName = identifierName;
TypeName = typeName;
IdentifierName = identifierName;
var start = identifierName.Span.Start;
if (typeName != null) start = typeName.Span.Start;
Span = new TextSpan(start, identifierName.Span.End - start);
}
public IdentifierToken IdentifierName { get; }
public IdentifierToken TypeName { get; }
public IdentifierToken IdentifierName { get; }
public override SyntaxKind Kind => SyntaxKind.Parameter;
public override IEnumerable<SyntaxNode> ChildNodes()