This commit is contained in:
Jelle Luteijn 2022-05-15 11:19:49 +02:00
parent 16e76d6b31
commit 484dbfc9d9
529 changed files with 113694 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#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);
}
}
}