41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a Finally block statement.
|
|
/// </summary>
|
|
public sealed class FinallyBlockStatement : BlockStatement
|
|
{
|
|
private readonly FinallyStatement _FinallyStatement;
|
|
|
|
/// <summary>
|
|
/// The Finally statement.
|
|
/// </summary>
|
|
public FinallyStatement FinallyStatement => _FinallyStatement;
|
|
|
|
/// <summary>
|
|
/// Constructs a new parse tree for a Finally block statement.
|
|
/// </summary>
|
|
/// <param name="finallyStatement">The Finally statement.</param>
|
|
/// <param name="statements">The statements in the block.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
/// <param name="comments">The comments for the parse tree.</param>
|
|
public FinallyBlockStatement(FinallyStatement finallyStatement, StatementCollection statements, Span span, IList<Comment> comments)
|
|
: base(TreeType.FinallyBlockStatement, statements, span, comments)
|
|
{
|
|
if (finallyStatement == null)
|
|
{
|
|
throw new ArgumentNullException("finallyStatement");
|
|
}
|
|
SetParent(finallyStatement);
|
|
_FinallyStatement = finallyStatement;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
Tree.AddChild(childList, FinallyStatement);
|
|
base.GetChildTrees(childList);
|
|
}
|
|
}
|