Decompiled source of amggCosmetics v0.1.0

GDWeave/mods/amgg.Cosmetics/amgg.Cosmetics.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using GDWeave;
using GDWeave.Godot;
using GDWeave.Godot.Variants;
using GDWeave.Modding;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("amgg.Cosmetics")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+5e6067356cba07d555d31ce83ee831e80960b482")]
[assembly: AssemblyProduct("amgg.Cosmetics")]
[assembly: AssemblyTitle("amgg.Cosmetics")]
[assembly: AssemblyVersion("0.1.0.0")]
[module: RefSafetyRules(11)]
namespace amgg.Cosmetics;

public class Mod : IMod, global::System.IDisposable
{
	public Mod(IModInterface modInterface)
	{
		modInterface.RegisterScriptMod((IScriptMod)(object)new Util.SimpleScriptMod().WithTransform("res://Scenes/Entities/Player/player.gdc", (Util.SimpleScriptMod.ScriptTransformation transformation) => transformation.WithEntry(new Util.MultiTokenWaiterBuilder(0u).FunctionDef("_controlled_process", (Util.MultiTokenWaiterBuilder b) => b, new <>z__ReadOnlySingleElementList<string>("delta"), complete: false).Build(), Util.TokenListBuilder.Start(1u).If((Util.TokenListBuilder b) => b.Identifier("cosmetic_data").ArrayIndex((Util.TokenListBuilder b) => b.Constant("hat")).Token((TokenType)7)
			.Constant("amgg.Cosmetics.hat_drinkshat"), (Util.TokenListBuilder b) => b.FunctionCall("get_node", new <>z__ReadOnlySingleElementList<Util.TokenSeqBuilderBase<Token, Util.TokenListBuilder>.PipeFn>((Util.TokenListBuilder b) => b.Constant("/root/amggCosmetics"))).MethodCall("handle_drinkshat_controlled_process", new <>z__ReadOnlySingleElementList<Util.TokenSeqBuilderBase<Token, Util.TokenListBuilder>.PipeFn>((Util.TokenListBuilder b) => b.Token((TokenType)3)))).Token((TokenType)89, 1u))));
	}

	void global::System.IDisposable.Dispose()
	{
	}
}
public static class Util
{
	internal record SimpleScriptMod : IScriptMod
	{
		internal record ScriptTransformation
		{
			private record Entry(IWaiter Waiter, ImmutableList<Token> AppendTokens)
			{
				[CompilerGenerated]
				protected virtual global::System.Type EqualityContract
				{
					[CompilerGenerated]
					get
					{
						return typeof(Entry);
					}
				}

				[CompilerGenerated]
				public override string ToString()
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0006: Expected O, but got Unknown
					StringBuilder val = new StringBuilder();
					val.Append("Entry");
					val.Append(" { ");
					if (PrintMembers(val))
					{
						val.Append(' ');
					}
					val.Append('}');
					return ((object)val).ToString();
				}

				[CompilerGenerated]
				protected virtual bool PrintMembers(StringBuilder builder)
				{
					RuntimeHelpers.EnsureSufficientExecutionStack();
					builder.Append("Waiter = ");
					builder.Append((object)Waiter);
					builder.Append(", AppendTokens = ");
					builder.Append((object)AppendTokens);
					return true;
				}

				[CompilerGenerated]
				public virtual bool Equals(Entry? other)
				{
					if ((object)this != other)
					{
						if ((object)other != null && EqualityContract == other.EqualityContract && EqualityComparer<IWaiter>.Default.Equals(Waiter, other.Waiter))
						{
							return EqualityComparer<ImmutableList<Token>>.Default.Equals(AppendTokens, other.AppendTokens);
						}
						return false;
					}
					return true;
				}
			}

			[CompilerGenerated]
			private sealed class <Modify>d__7 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
			{
				private int <>1__state;

				private Token <>2__current;

				private int <>l__initialThreadId;

				public ScriptTransformation <>4__this;

				private global::System.Collections.Generic.IEnumerable<Token> tokens;

				public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

				private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap1;

				private Token <token>5__3;

				private Enumerator<Entry> <>7__wrap3;

				private Enumerator<Token> <>7__wrap4;

				Token global::System.Collections.Generic.IEnumerator<Token>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object global::System.Collections.IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <Modify>d__7(int <>1__state)
				{
					this.<>1__state = <>1__state;
					<>l__initialThreadId = Environment.CurrentManagedThreadId;
				}

				[DebuggerHidden]
				void global::System.IDisposable.Dispose()
				{
					int num = <>1__state;
					if ((uint)(num - -5) > 2u && (uint)(num - 1) > 1u)
					{
						return;
					}
					try
					{
						if ((uint)(num - -5) > 1u && num != 2)
						{
							return;
						}
						try
						{
							if (num != -5 && num != 2)
							{
								return;
							}
							try
							{
							}
							finally
							{
								<>m__Finally3();
							}
						}
						finally
						{
							<>m__Finally2();
						}
					}
					finally
					{
						<>m__Finally1();
					}
				}

				private bool MoveNext()
				{
					//IL_0034: Unknown result type (might be due to invalid IL or missing references)
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_00be: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
					//IL_0175: Unknown result type (might be due to invalid IL or missing references)
					//IL_0153: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_0103: Unknown result type (might be due to invalid IL or missing references)
					try
					{
						int num = <>1__state;
						ScriptTransformation scriptTransformation = <>4__this;
						Entry current;
						switch (num)
						{
						default:
							return false;
						case 0:
						{
							<>1__state = -1;
							Enumerator<Entry> enumerator = scriptTransformation.Entries.GetEnumerator();
							try
							{
								while (enumerator.MoveNext())
								{
									enumerator.Current.Waiter.Reset();
								}
							}
							finally
							{
								((global::System.IDisposable)enumerator).Dispose();
							}
							<>7__wrap1 = tokens.GetEnumerator();
							<>1__state = -3;
							break;
						}
						case 1:
							<>1__state = -3;
							<>7__wrap3 = scriptTransformation.Entries.GetEnumerator();
							<>1__state = -4;
							goto IL_0159;
						case 2:
							{
								<>1__state = -5;
								goto IL_013a;
							}
							IL_0159:
							while (<>7__wrap3.MoveNext())
							{
								current = <>7__wrap3.Current;
								if (!current.Waiter.Check(<token>5__3))
								{
									continue;
								}
								goto IL_00f6;
							}
							<>m__Finally2();
							<>7__wrap3 = default(Enumerator<Entry>);
							<token>5__3 = null;
							break;
							IL_00f6:
							<>7__wrap4 = current.AppendTokens.GetEnumerator();
							<>1__state = -5;
							goto IL_013a;
							IL_013a:
							if (<>7__wrap4.MoveNext())
							{
								Token current2 = <>7__wrap4.Current;
								<>2__current = current2;
								<>1__state = 2;
								return true;
							}
							<>m__Finally3();
							<>7__wrap4 = default(Enumerator<Token>);
							goto IL_0159;
						}
						if (((global::System.Collections.IEnumerator)<>7__wrap1).MoveNext())
						{
							<token>5__3 = <>7__wrap1.Current;
							<>2__current = <token>5__3;
							<>1__state = 1;
							return true;
						}
						<>m__Finally1();
						<>7__wrap1 = null;
						return false;
					}
					catch
					{
						//try-fault
						((global::System.IDisposable)this).Dispose();
						throw;
					}
				}

				bool global::System.Collections.IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				private void <>m__Finally1()
				{
					<>1__state = -1;
					if (<>7__wrap1 != null)
					{
						((global::System.IDisposable)<>7__wrap1).Dispose();
					}
				}

				private void <>m__Finally2()
				{
					<>1__state = -3;
					((global::System.IDisposable)<>7__wrap3).Dispose();
				}

				private void <>m__Finally3()
				{
					<>1__state = -4;
					((global::System.IDisposable)<>7__wrap4).Dispose();
				}

				[DebuggerHidden]
				void global::System.Collections.IEnumerator.Reset()
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					throw new NotSupportedException();
				}

				[DebuggerHidden]
				global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
				{
					<Modify>d__7 <Modify>d__;
					if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
					{
						<>1__state = 0;
						<Modify>d__ = this;
					}
					else
					{
						<Modify>d__ = new <Modify>d__7(0)
						{
							<>4__this = <>4__this
						};
					}
					<Modify>d__.tokens = <>3__tokens;
					return <Modify>d__;
				}

				[DebuggerHidden]
				global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
				{
					return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
				}
			}

			[CompilerGenerated]
			protected virtual global::System.Type EqualityContract
			{
				[CompilerGenerated]
				get
				{
					return typeof(ScriptTransformation);
				}
			}

			private ImmutableList<Entry> Entries
			{
				[CompilerGenerated]
				get;
				[CompilerGenerated]
				init;
			} = ImmutableList.Create<Entry>(default(global::System.ReadOnlySpan<Entry>));


			[IteratorStateMachine(typeof(<Modify>d__7))]
			internal global::System.Collections.Generic.IEnumerable<Token> Modify(global::System.Collections.Generic.IEnumerable<Token> tokens)
			{
				Enumerator<Entry> enumerator = Entries.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						enumerator.Current.Waiter.Reset();
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator).Dispose();
				}
				global::System.Collections.Generic.IEnumerator<Token> enumerator2 = tokens.GetEnumerator();
				try
				{
					while (((global::System.Collections.IEnumerator)enumerator2).MoveNext())
					{
						Token token = enumerator2.Current;
						yield return token;
						Enumerator<Entry> enumerator3 = Entries.GetEnumerator();
						try
						{
							while (enumerator3.MoveNext())
							{
								Entry current = enumerator3.Current;
								if (!current.Waiter.Check(token))
								{
									continue;
								}
								Enumerator<Token> enumerator4 = current.AppendTokens.GetEnumerator();
								try
								{
									while (enumerator4.MoveNext())
									{
										yield return enumerator4.Current;
									}
								}
								finally
								{
									((global::System.IDisposable)enumerator4).Dispose();
								}
							}
						}
						finally
						{
							((global::System.IDisposable)enumerator3).Dispose();
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator2)?.Dispose();
				}
			}

			public ScriptTransformation WithEntry(IWaiter waiter, ImmutableList<Token> tokens)
			{
				return this with
				{
					Entries = Entries.Add(new Entry(waiter, tokens))
				};
			}

			[CompilerGenerated]
			public override string ToString()
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				StringBuilder val = new StringBuilder();
				val.Append("ScriptTransformation");
				val.Append(" { ");
				if (PrintMembers(val))
				{
					val.Append(' ');
				}
				val.Append('}');
				return ((object)val).ToString();
			}

			[CompilerGenerated]
			protected virtual bool PrintMembers(StringBuilder builder)
			{
				return false;
			}

			[CompilerGenerated]
			public virtual bool Equals(ScriptTransformation? other)
			{
				if ((object)this != other)
				{
					if ((object)other != null && EqualityContract == other.EqualityContract)
					{
						return EqualityComparer<ImmutableList<Entry>>.Default.Equals(Entries, other.Entries);
					}
					return false;
				}
				return true;
			}
		}

		[CompilerGenerated]
		protected virtual global::System.Type EqualityContract
		{
			[CompilerGenerated]
			get
			{
				return typeof(SimpleScriptMod);
			}
		}

		private ImmutableDictionary<string, ScriptTransformation> Transformations
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			init;
		} = ImmutableDictionary<string, ScriptTransformation>.Empty;


		private SimpleScriptMod WithTransform(string targetPath, ScriptTransformation transformation)
		{
			return this with
			{
				Transformations = Transformations.Add(targetPath, transformation)
			};
		}

		public SimpleScriptMod WithTransform(string targetPath, Func<ScriptTransformation, ScriptTransformation> setup)
		{
			return WithTransform(targetPath, setup.Invoke(new ScriptTransformation()));
		}

		bool IScriptMod.ShouldRun(string path)
		{
			string path2 = path;
			return Enumerable.Any<string>(Transformations.Keys, (Func<string, bool>)((string p) => p == path2));
		}

		global::System.Collections.Generic.IEnumerable<Token> IScriptMod.Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
		{
			return Transformations[path].Modify(tokens);
		}

		[CompilerGenerated]
		public override string ToString()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			StringBuilder val = new StringBuilder();
			val.Append("SimpleScriptMod");
			val.Append(" { ");
			if (PrintMembers(val))
			{
				val.Append(' ');
			}
			val.Append('}');
			return ((object)val).ToString();
		}

		[CompilerGenerated]
		protected virtual bool PrintMembers(StringBuilder builder)
		{
			return false;
		}

		[CompilerGenerated]
		public virtual bool Equals(SimpleScriptMod? other)
		{
			if ((object)this != other)
			{
				if ((object)other != null && EqualityContract == other.EqualityContract)
				{
					return EqualityComparer<ImmutableDictionary<string, ScriptTransformation>>.Default.Equals(Transformations, other.Transformations);
				}
				return false;
			}
			return true;
		}
	}

	internal abstract record TokenSeqBuilderBase<TToken, TSelf> where TSelf : TokenSeqBuilderBase<TToken, TSelf>
	{
		public delegate TSelf PipeFn(TSelf builder);

		[CompilerGenerated]
		protected virtual global::System.Type EqualityContract
		{
			[CompilerGenerated]
			get
			{
				return typeof(TokenSeqBuilderBase<TToken, TSelf>);
			}
		}

		protected ImmutableList<TToken> Tokens
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			init;
		}

		private uint IndentDepth
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			init;
		}

		private ImmutableStack<uint> IndentDepthStack
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			init;
		}

		protected abstract TSelf Self { get; }

		protected TokenSeqBuilderBase(uint depth)
		{
			Tokens = ImmutableList.Create<TToken>(default(global::System.ReadOnlySpan<TToken>));
			IndentDepthStack = ImmutableStack.Create<uint>(default(global::System.ReadOnlySpan<uint>));
			base..ctor();
			IndentDepth = depth;
		}

		public TSelf Token(TToken token)
		{
			TSelf obj = (TSelf)Self.<Clone>$();
			obj.Tokens = Tokens.Add(token);
			return obj;
		}

		public abstract TSelf Token(TokenType tokenType);

		public abstract TSelf Token(TokenType tokenType, uint? associatedData);

		public abstract TSelf Identifier(string name);

		public abstract TSelf Constant(string stringValue);

		public abstract TSelf Constant(bool boolValue);

		public TSelf Indent()
		{
			TSelf obj = (TSelf)Self.<Clone>$();
			obj.IndentDepth = IndentDepth + 1;
			obj.IndentDepthStack = IndentDepthStack.Push(IndentDepth);
			return obj;
		}

		public TSelf Dedent()
		{
			TSelf obj = (TSelf)Self.<Clone>$();
			obj.IndentDepth = IndentDepthStack.Peek();
			obj.IndentDepthStack = IndentDepthStack.Pop();
			return obj;
		}

		public TSelf Newline()
		{
			return Token((TokenType)89, IndentDepth);
		}

		public TSelf Pipe(PipeFn pipe)
		{
			return pipe(Self);
		}

		public TSelf Delimited(PipeFn delimiter, global::System.Collections.Generic.IEnumerable<PipeFn> items)
		{
			TSelf val = Pipe((TSelf b) => b);
			bool flag = true;
			global::System.Collections.Generic.IEnumerator<PipeFn> enumerator = ((global::System.Collections.Generic.IEnumerable<TokenSeqBuilderBase<PipeFn, ?>.PipeFn>)items).GetEnumerator();
			try
			{
				while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
				{
					PipeFn current = ((global::System.Collections.Generic.IEnumerator<TokenSeqBuilderBase<PipeFn, ?>.PipeFn>)enumerator).Current;
					if (!flag)
					{
						val = val.Pipe(delimiter);
					}
					val = val.Pipe(current);
					flag = false;
				}
				return val;
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}

		public TSelf ArrayIndex(PipeFn indexExpr)
		{
			return Token((TokenType)76).Pipe(indexExpr).Token((TokenType)77);
		}

		public TSelf Call(global::System.Collections.Generic.IEnumerable<PipeFn> argExprs)
		{
			return Token((TokenType)80).Delimited((TSelf b) => b.Token((TokenType)82), argExprs).Token((TokenType)81);
		}

		public TSelf FunctionCall(string functionName, global::System.Collections.Generic.IEnumerable<PipeFn> argExprs)
		{
			return Identifier(functionName).Call(argExprs);
		}

		public TSelf FunctionCall(BuiltinFunction builtin, global::System.Collections.Generic.IEnumerable<PipeFn> argExprs)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected I4, but got Unknown
			return Token((TokenType)5, (uint)(int)builtin).Call(argExprs);
		}

		public TSelf MethodCall(string methodName, global::System.Collections.Generic.IEnumerable<PipeFn> argExprs)
		{
			return MemberAccess(methodName).Call(argExprs);
		}

		public TSelf MemberAccess(string memberName)
		{
			return Token((TokenType)84).Identifier(memberName);
		}

		public TSelf If(PipeFn conditionExpr, PipeFn body, bool complete = true)
		{
			return Token((TokenType)38).Pipe(conditionExpr).Token((TokenType)86).Indent()
				.Newline()
				.Pipe(body)
				.Dedent()
				.Pipe((TSelf b) => (TSelf)((!complete) ? ((TokenSeqBuilderBase<TToken, TSelf>)b) : ((TokenSeqBuilderBase<TToken, TSelf>)b.Newline())));
		}

		public TSelf For(string loopVarName, PipeFn iterableExpr, PipeFn body, bool complete = true)
		{
			return Token((TokenType)41).Identifier(loopVarName).Token((TokenType)6).Pipe(iterableExpr)
				.Token((TokenType)86)
				.Indent()
				.Newline()
				.Pipe(body)
				.Dedent()
				.Pipe((TSelf b) => (TSelf)((!complete) ? ((TokenSeqBuilderBase<TToken, TSelf>)b) : ((TokenSeqBuilderBase<TToken, TSelf>)b.Newline())));
		}

		public TSelf FunctionDef(string name, PipeFn body, global::System.Collections.Generic.IEnumerable<string> argNames, bool complete = true)
		{
			return Identifier(name).Token((TokenType)80).Delimited((TSelf b) => b.Token((TokenType)82), Enumerable.Select<string, PipeFn>(argNames, (Func<string, PipeFn>)(object)(Func<string, TokenSeqBuilderBase<string, PipeFn>.PipeFn>)delegate(string name)
			{
				string name2 = name;
				return (TSelf b) => b.Identifier(name2);
			})).Token((TokenType)81)
				.Token((TokenType)86)
				.Indent()
				.Newline()
				.Pipe(body)
				.Dedent()
				.Pipe((TSelf b) => (TSelf)((!complete) ? ((TokenSeqBuilderBase<TToken, TSelf>)b) : ((TokenSeqBuilderBase<TToken, TSelf>)b.Newline())));
		}

		[CompilerGenerated]
		public override string ToString()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			StringBuilder val = new StringBuilder();
			val.Append("TokenSeqBuilderBase");
			val.Append(" { ");
			if (PrintMembers(val))
			{
				val.Append(' ');
			}
			val.Append('}');
			return ((object)val).ToString();
		}

		[CompilerGenerated]
		protected virtual bool PrintMembers(StringBuilder builder)
		{
			return false;
		}

		[CompilerGenerated]
		public override int GetHashCode()
		{
			return ((EqualityComparer<global::System.Type>.Default.GetHashCode(EqualityContract) * -1521134295 + ((EqualityComparer<ImmutableList<ImmutableList<TToken>>>)(object)EqualityComparer<ImmutableList<ImmutableList<TToken>>>.Default).GetHashCode((ImmutableList<ImmutableList<TToken>>)(object)Tokens)) * -1521134295 + EqualityComparer<uint>.Default.GetHashCode(IndentDepth)) * -1521134295 + EqualityComparer<ImmutableStack<uint>>.Default.GetHashCode(IndentDepthStack);
		}

		[CompilerGenerated]
		public virtual bool Equals(TokenSeqBuilderBase<TToken, TSelf>? other)
		{
			if ((object)this != other)
			{
				if ((object)other != null && EqualityContract == other.EqualityContract && ((EqualityComparer<ImmutableList<ImmutableList<TToken>>>)(object)EqualityComparer<ImmutableList<ImmutableList<TToken>>>.Default).Equals((ImmutableList<ImmutableList<TToken>>)(object)Tokens, (ImmutableList<ImmutableList<TToken>>)(object)other.Tokens) && EqualityComparer<uint>.Default.Equals(IndentDepth, other.IndentDepth))
				{
					return EqualityComparer<ImmutableStack<uint>>.Default.Equals(IndentDepthStack, other.IndentDepthStack);
				}
				return false;
			}
			return true;
		}
	}

	internal record TokenListBuilder : TokenSeqBuilderBase<Token, TokenListBuilder>
	{
		[CompilerGenerated]
		protected override global::System.Type EqualityContract
		{
			[CompilerGenerated]
			get
			{
				return typeof(TokenListBuilder);
			}
		}

		protected override TokenListBuilder Self => this;

		public TokenListBuilder(uint depth)
			: base(depth)
		{
		}

		public static implicit operator ImmutableList<Token>(TokenListBuilder t)
		{
			return t.Tokens;
		}

		public static TokenListBuilder Start(uint depth = 0u)
		{
			return new TokenListBuilder(depth);
		}

		public override TokenListBuilder Token(TokenType tokenType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			return base.Token(new Token(tokenType, (uint?)null));
		}

		public override TokenListBuilder Token(TokenType tokenType, uint? associatedData)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			return base.Token(new Token(tokenType, associatedData));
		}

		public override TokenListBuilder Identifier(string name)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return Token((Token)new IdentifierToken(name));
		}

		public override TokenListBuilder Constant(string stringValue)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return Token((Token)new ConstantToken((Variant)new StringVariant(stringValue)));
		}

		public override TokenListBuilder Constant(bool boolValue)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return Token((Token)new ConstantToken((Variant)new BoolVariant(boolValue)));
		}

		[CompilerGenerated]
		public override string ToString()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			StringBuilder val = new StringBuilder();
			val.Append("TokenListBuilder");
			val.Append(" { ");
			if (PrintMembers(val))
			{
				val.Append(' ');
			}
			val.Append('}');
			return ((object)val).ToString();
		}

		[CompilerGenerated]
		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		[CompilerGenerated]
		protected TokenListBuilder(TokenListBuilder original)
			: base((TokenSeqBuilderBase<Token, TokenListBuilder>)original)
		{
		}
	}

	internal record MultiTokenWaiterBuilder : TokenSeqBuilderBase<Func<Token, bool>, MultiTokenWaiterBuilder>
	{
		[CompilerGenerated]
		protected override global::System.Type EqualityContract
		{
			[CompilerGenerated]
			get
			{
				return typeof(MultiTokenWaiterBuilder);
			}
		}

		protected override MultiTokenWaiterBuilder Self => this;

		public MultiTokenWaiterBuilder(uint depth)
			: base(depth)
		{
		}

		public IWaiter Build(bool waitForReady = false, bool allowPartialMatch = false)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			return (IWaiter)new MultiTokenWaiter(Enumerable.ToArray<Func<Token, bool>>((global::System.Collections.Generic.IEnumerable<Func<Token, bool>>)base.Tokens), waitForReady, allowPartialMatch);
		}

		public override MultiTokenWaiterBuilder Token(TokenType tokenType)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return Token((Func<Token, bool>)((Token t) => t.Type == tokenType));
		}

		public override MultiTokenWaiterBuilder Token(TokenType tokenType, uint? associatedData)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return Token((Func<Token, bool>)((Token t) => t.Type == tokenType && t.AssociatedData == associatedData));
		}

		public override MultiTokenWaiterBuilder Identifier(string name)
		{
			string name2 = name;
			return Token((Func<Token, bool>)delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				if (val != null)
				{
					string name3 = val.Name;
					return name3 == name2;
				}
				return false;
			});
		}

		public override MultiTokenWaiterBuilder Constant(string stringValue)
		{
			string stringValue2 = stringValue;
			return Token((Func<Token, bool>)delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val != null)
				{
					Variant value = val.Value;
					StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
					if (val2 != null)
					{
						string value2 = val2.Value;
						return value2 == stringValue2;
					}
				}
				return false;
			});
		}

		public override MultiTokenWaiterBuilder Constant(bool boolValue)
		{
			return Token((Func<Token, bool>)delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val != null)
				{
					Variant value = val.Value;
					BoolVariant val2 = (BoolVariant)(object)((value is BoolVariant) ? value : null);
					if (val2 != null)
					{
						bool value2 = val2.Value;
						return value2 == boolValue;
					}
				}
				return false;
			});
		}

		[CompilerGenerated]
		public override string ToString()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			StringBuilder val = new StringBuilder();
			val.Append("MultiTokenWaiterBuilder");
			val.Append(" { ");
			if (PrintMembers(val))
			{
				val.Append(' ');
			}
			val.Append('}');
			return ((object)val).ToString();
		}

		[CompilerGenerated]
		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		[CompilerGenerated]
		protected MultiTokenWaiterBuilder(MultiTokenWaiterBuilder original)
			: base((TokenSeqBuilderBase<Func<Token, bool>, MultiTokenWaiterBuilder>)original)
		{
		}
	}
}
internal sealed class <>z__ReadOnlySingleElementList<T> : global::System.Collections.IEnumerable, global::System.Collections.ICollection, global::System.Collections.IList, global::System.Collections.Generic.IEnumerable<T>, global::System.Collections.Generic.IReadOnlyCollection<T>, global::System.Collections.Generic.IReadOnlyList<T>, global::System.Collections.Generic.ICollection<T>, global::System.Collections.Generic.IList<T>
{
	private sealed class Enumerator : global::System.IDisposable, global::System.Collections.IEnumerator, global::System.Collections.Generic.IEnumerator<T>
	{
		object global::System.Collections.IEnumerator.Current => _item;

		T global::System.Collections.Generic.IEnumerator<T>.Current => _item;

		public Enumerator(T item)
		{
			_item = item;
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			if (!_moveNextCalled)
			{
				return _moveNextCalled = true;
			}
			return false;
		}

		void global::System.Collections.IEnumerator.Reset()
		{
			_moveNextCalled = false;
		}

		void global::System.IDisposable.Dispose()
		{
		}
	}

	int global::System.Collections.ICollection.Count => 1;

	bool global::System.Collections.ICollection.IsSynchronized => false;

	object global::System.Collections.ICollection.SyncRoot => this;

	object global::System.Collections.IList.this[int index]
	{
		get
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}
	}

	bool global::System.Collections.IList.IsFixedSize => true;

	bool global::System.Collections.IList.IsReadOnly => true;

	int global::System.Collections.Generic.IReadOnlyCollection<T>.Count => 1;

	T global::System.Collections.Generic.IReadOnlyList<T>.this[int index]
	{
		get
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
	}

	int global::System.Collections.Generic.ICollection<T>.Count => 1;

	bool global::System.Collections.Generic.ICollection<T>.IsReadOnly => true;

	T global::System.Collections.Generic.IList<T>.this[int index]
	{
		get
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlySingleElementList(T item)
	{
		_item = item;
	}

	global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void global::System.Collections.ICollection.CopyTo(global::System.Array array, int index)
	{
		array.SetValue((object)_item, index);
	}

	int global::System.Collections.IList.Add(object? value)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	void global::System.Collections.IList.Clear()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	bool global::System.Collections.IList.Contains(object? value)
	{
		return EqualityComparer<T>.Default.Equals(_item, (T)value);
	}

	int global::System.Collections.IList.IndexOf(object? value)
	{
		if (!EqualityComparer<T>.Default.Equals(_item, (T)value))
		{
			return -1;
		}
		return 0;
	}

	void global::System.Collections.IList.Insert(int index, object? value)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	void global::System.Collections.IList.Remove(object? value)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	void global::System.Collections.IList.RemoveAt(int index)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	global::System.Collections.Generic.IEnumerator<T> global::System.Collections.Generic.IEnumerable<T>.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void global::System.Collections.Generic.ICollection<T>.Add(T item)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	void global::System.Collections.Generic.ICollection<T>.Clear()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	bool global::System.Collections.Generic.ICollection<T>.Contains(T item)
	{
		return EqualityComparer<T>.Default.Equals(_item, item);
	}

	void global::System.Collections.Generic.ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		array[arrayIndex] = _item;
	}

	bool global::System.Collections.Generic.ICollection<T>.Remove(T item)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	int global::System.Collections.Generic.IList<T>.IndexOf(T item)
	{
		if (!EqualityComparer<T>.Default.Equals(_item, item))
		{
			return -1;
		}
		return 0;
	}

	void global::System.Collections.Generic.IList<T>.Insert(int index, T item)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}

	void global::System.Collections.Generic.IList<T>.RemoveAt(int index)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		throw new NotSupportedException();
	}
}