progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
|
@ -0,0 +1,43 @@
|
|||
using System.Collections.Generic;
|
||||
using AspClassic.Scripting.Utils;
|
||||
|
||||
namespace AspClassic.Scripting.Runtime;
|
||||
|
||||
internal class TransformDictionaryEnumerator : CheckedDictionaryEnumerator
|
||||
{
|
||||
private const int ObjectKeysId = -2;
|
||||
|
||||
private IEnumerator<KeyValuePair<SymbolId, object>> _backing;
|
||||
|
||||
internal static readonly SymbolId ObjectKeys = new SymbolId(-2);
|
||||
|
||||
public TransformDictionaryEnumerator(IDictionary<SymbolId, object> backing)
|
||||
{
|
||||
_backing = backing.GetEnumerator();
|
||||
}
|
||||
|
||||
protected override object GetKey()
|
||||
{
|
||||
return SymbolTable.IdToString(_backing.Current.Key);
|
||||
}
|
||||
|
||||
protected override object GetValue()
|
||||
{
|
||||
return _backing.Current.Value;
|
||||
}
|
||||
|
||||
protected override bool DoMoveNext()
|
||||
{
|
||||
bool flag = _backing.MoveNext();
|
||||
if (flag && _backing.Current.Key == ObjectKeys)
|
||||
{
|
||||
flag = MoveNext();
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected override void DoReset()
|
||||
{
|
||||
_backing.Reset();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue