progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
29
AspClassic.Parser/CommaDelimitedTreeCollection.cs
Normal file
29
AspClassic.Parser/CommaDelimitedTreeCollection.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
#define DEBUG
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A collection of trees that are delimited by commas.
|
||||
/// </summary>
|
||||
public abstract class CommaDelimitedTreeCollection<T> : TreeCollection<T> where T : Tree
|
||||
{
|
||||
private readonly ReadOnlyCollection<Location> _CommaLocations;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the commas in the list.
|
||||
/// </summary>
|
||||
public ReadOnlyCollection<Location> CommaLocations => _CommaLocations;
|
||||
|
||||
protected CommaDelimitedTreeCollection(TreeType type, IList<T> trees, IList<Location> commaLocations, Span span)
|
||||
: base(type, trees, span)
|
||||
{
|
||||
Debug.Assert(type >= TreeType.ArgumentCollection && type <= TreeType.ImportCollection);
|
||||
if (commaLocations != null && commaLocations.Count > 0)
|
||||
{
|
||||
_CommaLocations = new ReadOnlyCollection<Location>(commaLocations);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue