29 lines
795 B
C#
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);
|
|
}
|
|
}
|
|
}
|