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,38 @@
using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for an aggregate initializer.
/// </summary>
public sealed class AggregateInitializer : Initializer
{
private readonly InitializerCollection _Elements;
/// <summary>
/// The elements of the aggregate initializer.
/// </summary>
public InitializerCollection Elements => _Elements;
/// <summary>
/// Constructs a new aggregate initializer parse tree.
/// </summary>
/// <param name="elements">The elements of the aggregate initializer.</param>
/// <param name="span">The location of the parse tree.</param>
public AggregateInitializer(InitializerCollection elements, Span span)
: base(TreeType.AggregateInitializer, span)
{
if (elements == null)
{
throw new ArgumentNullException("elements");
}
SetParent(elements);
_Elements = elements;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, Elements);
}
}