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

35 lines
968 B
C#

#define DEBUG
using System.Collections.Generic;
using System.Diagnostics;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a declaration.
/// </summary>
public class Declaration : Statement
{
public override bool IsBad => base.Type == TreeType.SyntaxError;
/// <summary>
/// Creates a bad declaration.
/// </summary>
/// <param name="span">The location of the parse tree.</param>
/// <param name="comments">The comments for the parse tree.</param>
/// <returns>A bad declaration.</returns>
public static Declaration GetBadDeclaration(Span span, IList<Comment> comments)
{
return new Declaration(span, comments);
}
protected Declaration(TreeType type, Span span, IList<Comment> comments)
: base(type, span, comments)
{
Debug.Assert(type >= TreeType.EmptyDeclaration && type <= TreeType.DelegateFunctionDeclaration);
}
private Declaration(Span span, IList<Comment> comments)
: base(TreeType.SyntaxError, span, comments)
{
}
}