daily update on 20250214 by nitload youmu, building syntax analysor, tough!

This commit is contained in:
Nitload
2025-02-14 13:30:17 +08:00
parent c23b640cae
commit ccef0de6f6
68 changed files with 2594 additions and 913 deletions
@@ -32,11 +32,21 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Commom.Collections
{
internal class CapacityFixedList<T> : IList<T>
public static class CapacityFixedListBuilder
{
internal static CapacityFixedList<T> Create<T>(ReadOnlySpan<T> values)
{
return new CapacityFixedList<T>(values);
}
}
[CollectionBuilder(typeof(CapacityFixedListBuilder),nameof(CapacityFixedListBuilder.Create))]
public class CapacityFixedList<T> : IList<T>
{
private T[] _values;
@@ -47,6 +57,11 @@ namespace StgSharp.Commom.Collections
_values = new T[size];
}
public CapacityFixedList(ReadOnlySpan<T> values)
{
_values = values.ToArray();
}
public T this[ int index ]
{
get => index < _index ?