25 lines
594 B
C#
25 lines
594 B
C#
|
using CanonSharp.Pascal.Scanner;
|
|||
|
|
|||
|
namespace CanonSharp.Pascal.SyntaxTree;
|
|||
|
|
|||
|
public record struct ArrayRange(int Left, int Right);
|
|||
|
|
|||
|
public sealed class TypeNode : SyntaxNodeBase
|
|||
|
{
|
|||
|
public override SyntaxNodeType NodeType => SyntaxNodeType.Type;
|
|||
|
|
|||
|
public LexicalToken TypeToken { get; }
|
|||
|
|
|||
|
public List<ArrayRange> ArrayRanges { get; } = [];
|
|||
|
|
|||
|
public TypeNode(LexicalToken typeToken)
|
|||
|
{
|
|||
|
TypeToken = typeToken;
|
|||
|
}
|
|||
|
|
|||
|
public TypeNode(LexicalToken typeToken, IEnumerable<ArrayRange> arrayRanges) : this(typeToken)
|
|||
|
{
|
|||
|
ArrayRanges.AddRange(arrayRanges);
|
|||
|
}
|
|||
|
}
|