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,35 @@
#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)
{
}
}