aspclassic-core/AspClassic.Parser/Statement.cs
Jelle Luteijn 484dbfc9d9 progress
2022-05-15 11:19:49 +02:00

29 lines
795 B
C#

#define DEBUG
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a statement.
/// </summary>
public abstract class Statement : Tree
{
private readonly ReadOnlyCollection<Comment> _Comments;
/// <summary>
/// The comments for the tree.
/// </summary>
public ReadOnlyCollection<Comment> Comments => _Comments;
protected Statement(TreeType type, Span span, IList<Comment> comments)
: base(type, span)
{
Debug.Assert((type >= TreeType.EmptyStatement && type <= TreeType.EndBlockStatement) || (type >= TreeType.EmptyDeclaration && type <= TreeType.DelegateFunctionDeclaration));
if (comments != null)
{
_Comments = new ReadOnlyCollection<Comment>(comments);
}
}
}