// // Ariadne.Generator's copy of the scripts in this file: the code that actually runs. Edits here are overwritten. // In the copy beside the script, #line paths are relative to it; the compiled code uses full paths. #pragma warning disable namespace Ariadne.UnitTests { partial class Countdown { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Countdown.Descend__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Countdown.Descend__Frame)); if (scope != null) { global::Ariadne.UnitTests.Countdown.Descend__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Descend__Frame : global::Ariadne.Frame { public int Descend__level; public int Descend__mine; public global::Ariadne.UnitTests.Countdown.Descend__Frame Descend____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Descend.level"); lister.Local("Descend.mine"); { global::Ariadne.IArcPartLister scope = lister.Scope("Descend.deeper/", typeof(global::Ariadne.UnitTests.Countdown.Descend__Frame)); if (scope != null) { global::Ariadne.UnitTests.Countdown.Descend__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Countdown() { } protected Countdown(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Countdown(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Countdown.Descend__Frame)); if (scope != null) { global::Ariadne.UnitTests.Countdown.Descend__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 9 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Countdown.Descend__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Descend__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Descend.level": #line 11 "Recursion.cs" writer.Local("Descend.level", this.Descend__level); #line hidden return; case "Descend.mine": #line 13 "Recursion.cs" writer.Local("Descend.mine", this.Descend__mine); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Descend__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Descend.level", out int loaded)) { this.Descend__level = loaded; } } { if (reader.TryLocal("Descend.mine", out int loaded)) { this.Descend__mine = loaded; } } { if (reader.TryScope("Descend.deeper/", out global::Ariadne.IArcReader scope)) { this.Descend____call_deeper_frame = new global::Ariadne.UnitTests.Countdown.Descend__Frame(); this.Descend____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Descend____call_deeper_frame != null) { this.Descend____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Descend____call_deeper_frame != null) { this.Descend____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 33 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Countdown.Descend__Frame(); } if (!Descend__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (1) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Descend__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Descend__Passage(Descend__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int level__argument) { #line hidden ref int level = ref __frame.Descend__level; if (__frame.ResumeKey == null) { level = level__argument; } ref int mine = ref __frame.Descend__mine; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 13 "Recursion.cs" mine = level * 10; #line hidden wait: #line 16 "Recursion.cs" while (!gates.Open.Contains("go" + level)) #line hidden { #line 18 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden { #line 21 "Recursion.cs" if (!(level < 3)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 24 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Descend____call_deeper_frame == null) { __frame.Descend____call_deeper_frame = new global::Ariadne.UnitTests.Countdown.Descend__Frame(); } if (!Descend__Passage(__frame.Lend(__frame.Descend____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (level + 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line 27 "Recursion.cs" Log += mine + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Descend__LocalsToSave(Descend__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Descend.level", writer); __frame.SaveLocal("Descend.mine", writer); break; case "deeper": __frame.SaveLocal("Descend.level", writer); __frame.SaveLocal("Descend.mine", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Descend.deeper/"); Descend__LocalsToSave(__frame.Lend(__frame.Descend____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Rally { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Rally.Ping__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Rally.Ping__Frame)); if (scope != null) { global::Ariadne.UnitTests.Rally.Ping__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Ping__Frame : global::Ariadne.Frame { public int Ping__left; public global::Ariadne.UnitTests.Rally.Pong__Frame Ping____call_back_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Ping.left"); { global::Ariadne.IArcPartLister scope = lister.Scope("Ping.back/", typeof(global::Ariadne.UnitTests.Rally.Pong__Frame)); if (scope != null) { global::Ariadne.UnitTests.Rally.Pong__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Pong__Frame : global::Ariadne.Frame { public int Pong__left; public global::Ariadne.UnitTests.Rally.Ping__Frame Pong____call_again_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Pong.left"); { global::Ariadne.IArcPartLister scope = lister.Scope("Pong.again/", typeof(global::Ariadne.UnitTests.Rally.Ping__Frame)); if (scope != null) { global::Ariadne.UnitTests.Rally.Ping__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Rally() { } protected Rally(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Rally(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Rally.Ping__Frame)); if (scope != null) { global::Ariadne.UnitTests.Rally.Ping__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 42 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Rally.Ping__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Ping__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Ping.left": #line 44 "Recursion.cs" writer.Local("Ping.left", this.Ping__left); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Ping__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Ping.left", out int loaded)) { this.Ping__left = loaded; } } { if (reader.TryScope("Ping.back/", out global::Ariadne.IArcReader scope)) { this.Ping____call_back_frame = new global::Ariadne.UnitTests.Rally.Pong__Frame(); this.Ping____call_back_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Ping____call_back_frame != null) { this.Ping____call_back_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Ping____call_back_frame != null) { this.Ping____call_back_frame.EndWaits(); } } } #pragma warning restore public partial class Pong__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Pong.left": #line 60 "Recursion.cs" writer.Local("Pong.left", this.Pong__left); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Pong__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Pong.left", out int loaded)) { this.Pong__left = loaded; } } { if (reader.TryScope("Pong.again/", out global::Ariadne.IArcReader scope)) { this.Pong____call_again_frame = new global::Ariadne.UnitTests.Rally.Ping__Frame(); this.Pong____call_again_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Pong____call_again_frame != null) { this.Pong____call_again_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Pong____call_again_frame != null) { this.Pong____call_again_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 79 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Rally.Ping__Frame(); } if (!Ping__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (3) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Ping__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Ping__Passage(Ping__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int left__argument) { #line hidden ref int left = ref __frame.Ping__left; if (__frame.ResumeKey == null) { left = left__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; case "back": goto back; } #line hidden wait: #line 47 "Recursion.cs" while (!gates.Open.Contains("ping" + left)) #line hidden { #line 49 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 52 "Recursion.cs" Log += "ping" + left + ";"; #line hidden { #line 53 "Recursion.cs" if (!(left > 0)) goto __end1; #line hidden } #line hidden back: #line hidden { #line 56 "Recursion.cs" using (__frame.Enter("back")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Ping____call_back_frame == null) { __frame.Ping____call_back_frame = new global::Ariadne.UnitTests.Rally.Pong__Frame(); } if (!Pong__Passage(__frame.Lend(__frame.Ping____call_back_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (left - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Ping__LocalsToSave(Ping__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Ping.left", writer); break; case "back": __frame.SaveLocal("Ping.left", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Ping.back/"); Pong__LocalsToSave(__frame.Lend(__frame.Ping____call_back_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Pong__Passage(Pong__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int left__argument) { #line hidden ref int left = ref __frame.Pong__left; if (__frame.ResumeKey == null) { left = left__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; case "again": goto again; } #line hidden wait: #line 63 "Recursion.cs" while (!gates.Open.Contains("pong" + left)) #line hidden { #line 65 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 68 "Recursion.cs" Log += "pong" + left + ";"; #line hidden { #line 69 "Recursion.cs" if (!(left > 0)) goto __end1; #line hidden } #line hidden again: #line hidden { #line 72 "Recursion.cs" using (__frame.Enter("again")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Pong____call_again_frame == null) { __frame.Pong____call_again_frame = new global::Ariadne.UnitTests.Rally.Ping__Frame(); } if (!Ping__Passage(__frame.Lend(__frame.Pong____call_again_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (left - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Pong__LocalsToSave(Pong__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Pong.left", writer); break; case "again": __frame.SaveLocal("Pong.left", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Pong.again/"); Ping__LocalsToSave(__frame.Lend(__frame.Pong____call_again_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Layering { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Layering.Stack__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Layering.Stack__Frame)); if (scope != null) { global::Ariadne.UnitTests.Layering.Stack__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Stack__Frame : global::Ariadne.Frame { public int Stack__left; public X Stack__kept; public global::Ariadne.UnitTests.Layering.Stack__Frame Stack____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Stack.kept"); lister.Local("Stack.left"); { global::Ariadne.IArcPartLister scope = lister.Scope("Stack.deeper/", typeof(global::Ariadne.UnitTests.Layering.Stack__Frame)); if (scope != null) { global::Ariadne.UnitTests.Layering.Stack__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Layering() { } protected Layering(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Layering(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Layering.Stack__Frame)); if (scope != null) { global::Ariadne.UnitTests.Layering.Stack__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 88 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Layering.Stack__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Stack__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Stack.kept": #line 92 "Recursion.cs" writer.Local("Stack.kept", this.Stack__kept); #line hidden return; case "Stack.left": #line 90 "Recursion.cs" writer.Local("Stack.left", this.Stack__left); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Stack__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Stack.kept", out X loaded)) { this.Stack__kept = loaded; } } { if (reader.TryLocal("Stack.left", out int loaded)) { this.Stack__left = loaded; } } { if (reader.TryScope("Stack.deeper/", out global::Ariadne.IArcReader scope)) { this.Stack____call_deeper_frame = new global::Ariadne.UnitTests.Layering.Stack__Frame(); this.Stack____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Stack____call_deeper_frame != null) { this.Stack____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Stack____call_deeper_frame != null) { this.Stack____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 112 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Layering.Stack__Frame(); } if (!Stack__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? ("box") : default(string), __frame.ResumeKey == null ? (2) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Stack__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Stack__Passage(Stack__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, X item, int left__argument) { #line hidden ref int left = ref __frame.Stack__left; if (__frame.ResumeKey == null) { left = left__argument; } ref X kept = ref __frame.Stack__kept; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 92 "Recursion.cs" kept = item; #line hidden wait: #line 95 "Recursion.cs" while (!gates.Open.Contains("layer" + left)) #line hidden { #line 97 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden { #line 100 "Recursion.cs" if (!(left > 0)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 103 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Stack____call_deeper_frame == null) { __frame.Stack____call_deeper_frame = new global::Ariadne.UnitTests.Layering.Stack__Frame(); } if (!Stack__Passage(__frame.Lend(__frame.Stack____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (kept) : default(X), __frame.ResumeKey == null ? (left - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line 106 "Recursion.cs" Log += kept + "@" + left + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Stack__LocalsToSave(Stack__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Stack.left", writer); __frame.SaveLocal("Stack.kept", writer); break; case "deeper": __frame.SaveLocal("Stack.left", writer); __frame.SaveLocal("Stack.kept", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Stack.deeper/"); Stack__LocalsToSave(__frame.Lend(__frame.Stack____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Trading { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Trading.Swap__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Trading.Swap__Frame)); if (scope != null) { global::Ariadne.UnitTests.Trading.Swap__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Swap__Frame : global::Ariadne.Frame { public int Swap__left; public X Swap__kept; public Y Swap__other; public global::Ariadne.UnitTests.Trading.Swap__Frame Swap____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Swap.kept"); lister.Local("Swap.left"); lister.Local("Swap.other"); { global::Ariadne.IArcPartLister scope = lister.Scope("Swap.deeper/", typeof(global::Ariadne.UnitTests.Trading.Swap__Frame)); if (scope != null) { global::Ariadne.UnitTests.Trading.Swap__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Trading() { } protected Trading(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Trading(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Trading.Swap__Frame)); if (scope != null) { global::Ariadne.UnitTests.Trading.Swap__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 122 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Trading.Swap__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Swap__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Swap.kept": #line 126 "Recursion.cs" writer.Local("Swap.kept", this.Swap__kept); #line hidden return; case "Swap.left": #line 124 "Recursion.cs" writer.Local("Swap.left", this.Swap__left); #line hidden return; case "Swap.other": #line 127 "Recursion.cs" writer.Local("Swap.other", this.Swap__other); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Swap__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Swap.kept", out X loaded)) { this.Swap__kept = loaded; } } { if (reader.TryLocal("Swap.left", out int loaded)) { this.Swap__left = loaded; } } { if (reader.TryLocal("Swap.other", out Y loaded)) { this.Swap__other = loaded; } } { if (reader.TryScope("Swap.deeper/", out global::Ariadne.IArcReader scope)) { this.Swap____call_deeper_frame = new global::Ariadne.UnitTests.Trading.Swap__Frame(); this.Swap____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Swap____call_deeper_frame != null) { this.Swap____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Swap____call_deeper_frame != null) { this.Swap____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 146 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Trading.Swap__Frame(); } if (!Swap__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (1) : default(int), __frame.ResumeKey == null ? ("one") : default(string), __frame.ResumeKey == null ? (2) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Swap__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Swap__Passage(Swap__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, X first, Y second, int left__argument) { #line hidden ref int left = ref __frame.Swap__left; if (__frame.ResumeKey == null) { left = left__argument; } ref X kept = ref __frame.Swap__kept; ref Y other = ref __frame.Swap__other; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 126 "Recursion.cs" kept = first; #line 127 "Recursion.cs" other = second; #line hidden wait: #line 130 "Recursion.cs" while (!gates.Open.Contains("trade" + left)) #line hidden { #line 132 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 135 "Recursion.cs" Log += kept + "/" + other + ";"; #line hidden { #line 136 "Recursion.cs" if (!(left > 0)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 139 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Swap____call_deeper_frame == null) { __frame.Swap____call_deeper_frame = new global::Ariadne.UnitTests.Trading.Swap__Frame(); } if (!Swap__Passage(__frame.Lend(__frame.Swap____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (other) : default(Y), __frame.ResumeKey == null ? (kept) : default(X), __frame.ResumeKey == null ? (left - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Swap__LocalsToSave(Swap__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Swap.left", writer); __frame.SaveLocal("Swap.kept", writer); __frame.SaveLocal("Swap.other", writer); break; case "deeper": __frame.SaveLocal("Swap.left", writer); __frame.SaveLocal("Swap.kept", writer); __frame.SaveLocal("Swap.other", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Swap.deeper/"); Swap__LocalsToSave(__frame.Lend(__frame.Swap____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Volley { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Serve__shot; public int Serve__mine; public global::Ariadne.UnitTests.Volley Serve____call_back_receiver; public global::Ariadne.UnitTests.Volley.__Frame Serve____call_back_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Serve.mine"); lister.Local("Serve.shot"); { global::Ariadne.IArcPartLister scope = lister.Scope("Serve.back/", typeof(global::Ariadne.UnitTests.Volley.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.Volley.__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Volley() { } protected Volley(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Partner", out global::Ariadne.UnitTests.Volley loaded)) { this.Partner = loaded; } else if (!reader.HasField("Partner")) { throw new global::System.IO.InvalidDataException("Volley's save has no field 'Partner', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Volley(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Partner"); lister.Field("Log"); lister.Local("Serve.mine"); lister.Local("Serve.shot"); { global::Ariadne.IArcPartLister scope = lister.Scope("Serve.back/", typeof(global::Ariadne.UnitTests.Volley.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.Volley.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 155 "Recursion.cs" writer.Field("Partner", this.Partner); #line 157 "Recursion.cs" writer.Field("Log", this.Log); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Serve.back/receiver": #line 173 "Recursion.cs" writer.Local("receiver", this.Serve____call_back_receiver); #line hidden return; case "Serve.mine": #line 161 "Recursion.cs" writer.Local("Serve.mine", this.Serve__mine); #line hidden return; case "Serve.shot": #line 159 "Recursion.cs" writer.Local("Serve.shot", this.Serve__shot); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Serve.mine", out int loaded)) { this.Serve__mine = loaded; } } { if (reader.TryLocal("Serve.shot", out int loaded)) { this.Serve__shot = loaded; } } { if (reader.TryScope("Serve.back/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.Volley loaded)) { this.Serve____call_back_receiver = loaded; } } if (this.Serve____call_back_receiver != null) { this.Serve____call_back_frame = (global::Ariadne.UnitTests.Volley.__Frame)this.Serve____call_back_receiver.NewFrame(); this.Serve____call_back_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Serve____call_back_frame != null) { this.Serve____call_back_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Serve____call_back_frame != null) { this.Serve____call_back_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 180 "Recursion.cs" using (__frame.Enter("start")) { if (!Serve__Passage(__frame, __time, gates, __frame.ResumeKey == null ? (3) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": Serve__LocalsToSave(__frame, depth + 1, writer); break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Serve__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int shot__argument) { #line hidden ref int shot = ref __frame.Serve__shot; if (__frame.ResumeKey == null) { shot = shot__argument; } ref int mine = ref __frame.Serve__mine; switch (__frame.ResumeKey) { case "wait": goto wait; case "back": goto back; } #line 161 "Recursion.cs" mine = shot; #line hidden wait: #line 164 "Recursion.cs" while (!gates.Open.Contains("hit" + shot)) #line hidden { #line 166 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 169 "Recursion.cs" Log += "serve" + mine + ";"; #line hidden { #line 170 "Recursion.cs" if (!(shot > 1)) goto __end1; #line hidden } #line hidden back: #line hidden { #line 173 "Recursion.cs" using (__frame.Enter("back")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Serve____call_back_receiver = (Partner); __frame.Serve____call_back_frame = null; } if (__frame.Serve____call_back_frame == null) { __frame.Serve____call_back_frame = (global::Ariadne.UnitTests.Volley.__Frame)__frame.Serve____call_back_receiver.NewFrame(); } if (!__frame.Serve____call_back_receiver.Serve__Passage(__frame.Lend(__frame.Serve____call_back_frame), __time, gates, __frame.ResumeKey == null ? (shot - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Serve__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Serve.shot", writer); __frame.SaveLocal("Serve.mine", writer); break; case "back": __frame.SaveLocal("Serve.shot", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Serve.back/"); __frame.SaveLocal("Serve.back/receiver", scope); if (__frame.Serve____call_back_receiver != null) { __frame.Serve____call_back_receiver.Serve__LocalsToSave(__frame.Lend(__frame.Serve____call_back_frame), depth + 1, scope); } } break; } } } } namespace Ariadne.UnitTests { partial class Orchard { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Grow__Frame : global::Ariadne.Frame { public int Grow__rings; public int Grow__mine; public global::Ariadne.UnitTests.Orchard.Grow__Frame Grow____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Grow.mine"); lister.Local("Grow.rings"); { global::Ariadne.IArcPartLister scope = lister.Scope("Grow.deeper/", typeof(global::Ariadne.UnitTests.Orchard.Grow__Frame)); if (scope != null) { global::Ariadne.UnitTests.Orchard.Grow__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } public Orchard() { } protected Orchard(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Orchard(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 189 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning restore public partial class Grow__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Grow.mine": #line 193 "Recursion.cs" writer.Local("Grow.mine", this.Grow__mine); #line hidden return; case "Grow.rings": #line 191 "Recursion.cs" writer.Local("Grow.rings", this.Grow__rings); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Grow__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Grow.mine", out int loaded)) { this.Grow__mine = loaded; } } { if (reader.TryLocal("Grow.rings", out int loaded)) { this.Grow__rings = loaded; } } { if (reader.TryScope("Grow.deeper/", out global::Ariadne.IArcReader scope)) { this.Grow____call_deeper_frame = new global::Ariadne.UnitTests.Orchard.Grow__Frame(); this.Grow____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Grow____call_deeper_frame != null) { this.Grow____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Grow____call_deeper_frame != null) { this.Grow____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Grow__Passage(Grow__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int rings__argument) { #line hidden ref int rings = ref __frame.Grow__rings; if (__frame.ResumeKey == null) { rings = rings__argument; } ref int mine = ref __frame.Grow__mine; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 193 "Recursion.cs" mine = rings; #line hidden wait: #line 196 "Recursion.cs" while (!gates.Open.Contains("ring" + rings)) #line hidden { #line 198 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden { #line 201 "Recursion.cs" if (!(rings > 1)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 204 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Grow____call_deeper_frame == null) { __frame.Grow____call_deeper_frame = new global::Ariadne.UnitTests.Orchard.Grow__Frame(); } if (!Grow__Passage(__frame.Lend(__frame.Grow____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (rings - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line 207 "Recursion.cs" Log += mine + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Grow__LocalsToSave(Grow__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Grow.rings", writer); __frame.SaveLocal("Grow.mine", writer); break; case "deeper": __frame.SaveLocal("Grow.rings", writer); __frame.SaveLocal("Grow.mine", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Grow.deeper/"); Grow__LocalsToSave(__frame.Lend(__frame.Grow____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Orchardist { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Orchard Run____call_plant_receiver; public global::Ariadne.UnitTests.Orchard.__Frame Run____call_plant_frame; public global::Ariadne.UnitTests.Orchard.Grow__Frame Run____call_plant_ownedFrame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.plant/", typeof(global::Ariadne.UnitTests.Orchard.__Frame), typeof(global::Ariadne.UnitTests.Orchard.Grow__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.Orchard.__Frame.ListParts(scope); global::Ariadne.UnitTests.Orchard.Grow__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Orchardist() { } protected Orchardist(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Trees", out global::Ariadne.UnitTests.Orchard loaded)) { this.Trees = loaded; } } } protected Orchardist(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Trees"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.plant/", typeof(global::Ariadne.UnitTests.Orchard.__Frame), typeof(global::Ariadne.UnitTests.Orchard.Grow__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.Orchard.__Frame.ListParts(scope); global::Ariadne.UnitTests.Orchard.Grow__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 220 "Recursion.cs" writer.Field("Trees", this.Trees); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.plant/receiver": #line 225 "Recursion.cs" writer.Local("receiver", this.Run____call_plant_receiver); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.plant/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.Orchard loaded)) { this.Run____call_plant_receiver = loaded; } } if (this.Run____call_plant_receiver != null) { this.Run____call_plant_frame = (global::Ariadne.UnitTests.Orchard.__Frame)this.Run____call_plant_receiver.NewFrame(); this.Run____call_plant_frame.LoadLocals(scope); this.Run____call_plant_ownedFrame = new global::Ariadne.UnitTests.Orchard.Grow__Frame(); this.Run____call_plant_ownedFrame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_plant_frame != null) { this.Run____call_plant_frame.AttachWaits(slot); } if (this.Run____call_plant_ownedFrame != null) { this.Run____call_plant_ownedFrame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_plant_frame != null) { this.Run____call_plant_frame.EndWaits(); } if (this.Run____call_plant_ownedFrame != null) { this.Run____call_plant_ownedFrame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "plant": goto plant; } #line hidden plant: #line 225 "Recursion.cs" using (__frame.Enter("plant")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_plant_receiver = (Trees); __frame.Run____call_plant_frame = null; __frame.Run____call_plant_ownedFrame = null; } if (__frame.Run____call_plant_frame == null) { __frame.Run____call_plant_frame = (global::Ariadne.UnitTests.Orchard.__Frame)__frame.Run____call_plant_receiver.NewFrame(); } if (__frame.Run____call_plant_ownedFrame == null) { __frame.Run____call_plant_ownedFrame = new global::Ariadne.UnitTests.Orchard.Grow__Frame(); } if (!__frame.Run____call_plant_receiver.Grow__Passage(__frame.Lend(__frame.Run____call_plant_ownedFrame), __frame.Lend(__frame.Run____call_plant_frame), __time, gates, __frame.ResumeKey == null ? (2) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "plant": { global::Ariadne.IArcWriter scope = writer.Scope("Run.plant/"); __frame.SaveLocal("Run.plant/receiver", scope); if (__frame.Run____call_plant_receiver != null) { __frame.Run____call_plant_receiver.Grow__LocalsToSave(__frame.Lend(__frame.Run____call_plant_ownedFrame), __frame.Lend(__frame.Run____call_plant_frame), depth + 1, scope, scope); } } break; } } } } namespace Ariadne.UnitTests { partial class Digging { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Dig__Frame : global::Ariadne.Frame { public int Dig__depth; public int Dig__here; public global::Ariadne.UnitTests.Digging.Dig__Frame Dig____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Dig.depth"); lister.Local("Dig.here"); { global::Ariadne.IArcPartLister scope = lister.Scope("Dig.deeper/", typeof(global::Ariadne.UnitTests.Digging.Dig__Frame)); if (scope != null) { global::Ariadne.UnitTests.Digging.Dig__Frame.ListParts(scope); } } } } protected Digging() { } protected Digging(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Digging(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 234 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning restore public partial class Dig__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Dig.depth": #line 236 "Recursion.cs" writer.Local("Dig.depth", this.Dig__depth); #line hidden return; case "Dig.here": #line 238 "Recursion.cs" writer.Local("Dig.here", this.Dig__here); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Dig__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Dig.depth", out int loaded)) { this.Dig__depth = loaded; } } { if (reader.TryLocal("Dig.here", out int loaded)) { this.Dig__here = loaded; } } { if (reader.TryScope("Dig.deeper/", out global::Ariadne.IArcReader scope)) { this.Dig____call_deeper_frame = new global::Ariadne.UnitTests.Digging.Dig__Frame(); this.Dig____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Dig____call_deeper_frame != null) { this.Dig____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Dig____call_deeper_frame != null) { this.Dig____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Dig__Passage(Dig__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int depth__argument) { #line hidden ref int depth = ref __frame.Dig__depth; if (__frame.ResumeKey == null) { depth = depth__argument; } ref int here = ref __frame.Dig__here; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 238 "Recursion.cs" here = depth; #line hidden wait: #line 241 "Recursion.cs" while (!gates.Open.Contains("dig" + depth)) #line hidden { #line 243 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden { #line 246 "Recursion.cs" if (!(depth < 2)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 249 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Dig____call_deeper_frame == null) { __frame.Dig____call_deeper_frame = new global::Ariadne.UnitTests.Digging.Dig__Frame(); } if (!Dig__Passage(__frame.Lend(__frame.Dig____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (depth + 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line 252 "Recursion.cs" Log += here + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Dig__LocalsToSave(Dig__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Dig.depth", writer); __frame.SaveLocal("Dig.here", writer); break; case "deeper": __frame.SaveLocal("Dig.depth", writer); __frame.SaveLocal("Dig.here", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Dig.deeper/"); Dig__LocalsToSave(__frame.Lend(__frame.Dig____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Shaft { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.UnitTests.Digging.__Frame { public global::Ariadne.UnitTests.Digging.Dig__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { global::Ariadne.UnitTests.Digging.__Frame.ListParts(lister); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Digging.Dig__Frame)); if (scope != null) { global::Ariadne.UnitTests.Digging.Dig__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Shaft() { } protected Shaft(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { } protected Shaft(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Digging.Dig__Frame)); if (scope != null) { global::Ariadne.UnitTests.Digging.Dig__Frame.ListParts(scope); } } } #pragma warning restore #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Digging.Dig__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 261 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Digging.Dig__Frame(); } if (!Dig__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (1) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Dig__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } } } namespace Ariadne.UnitTests { partial class Plunging { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Plunging.Plunge__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Plunging.Plunge__Frame)); if (scope != null) { global::Ariadne.UnitTests.Plunging.Plunge__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Plunge__Frame : global::Ariadne.Frame { public int Plunge__level; public int Plunge__mine; public global::Ariadne.UnitTests.Plunging.Plunge__Frame Plunge____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Plunge.level"); lister.Local("Plunge.mine"); { global::Ariadne.IArcPartLister scope = lister.Scope("Plunge.deeper/", typeof(global::Ariadne.UnitTests.Plunging.Plunge__Frame)); if (scope != null) { global::Ariadne.UnitTests.Plunging.Plunge__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Plunging() { } protected Plunging(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Spins", out int loaded)) { this.Spins = loaded; } else if (!reader.HasField("Spins")) { throw new global::System.IO.InvalidDataException("Plunging's save has no field 'Spins', which has no initializer to fall back on. Give it one."); } } } protected Plunging(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Spins"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Plunging.Plunge__Frame)); if (scope != null) { global::Ariadne.UnitTests.Plunging.Plunge__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 270 "Recursion.cs" writer.Field("Spins", this.Spins); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Plunging.Plunge__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Plunge__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Plunge.level": #line 272 "Recursion.cs" writer.Local("Plunge.level", this.Plunge__level); #line hidden return; case "Plunge.mine": #line 274 "Recursion.cs" writer.Local("Plunge.mine", this.Plunge__mine); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Plunge__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Plunge.level", out int loaded)) { this.Plunge__level = loaded; } } { if (reader.TryLocal("Plunge.mine", out int loaded)) { this.Plunge__mine = loaded; } } { if (reader.TryScope("Plunge.deeper/", out global::Ariadne.IArcReader scope)) { this.Plunge____call_deeper_frame = new global::Ariadne.UnitTests.Plunging.Plunge__Frame(); this.Plunge____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Plunge____call_deeper_frame != null) { this.Plunge____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Plunge____call_deeper_frame != null) { this.Plunge____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 294 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Plunging.Plunge__Frame(); } if (!Plunge__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (1) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Plunge__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Plunge__Passage(Plunge__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int level__argument) { #line hidden ref int level = ref __frame.Plunge__level; if (__frame.ResumeKey == null) { level = level__argument; } ref int mine = ref __frame.Plunge__mine; switch (__frame.ResumeKey) { case "deeper": goto deeper; case "wait": goto wait; } #line 274 "Recursion.cs" mine = level; #line hidden { #line 275 "Recursion.cs" if (!(level < 3)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 278 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Plunge____call_deeper_frame == null) { __frame.Plunge____call_deeper_frame = new global::Ariadne.UnitTests.Plunging.Plunge__Frame(); } if (!Plunge__Passage(__frame.Lend(__frame.Plunge____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (level + 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line hidden wait: #line 282 "Recursion.cs" while (!gates.Open.Contains("go")) #line hidden { #line 284 "Recursion.cs" ++Spins; #line 285 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 288 "Recursion.cs" Spins += mine; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Plunge__LocalsToSave(Plunge__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "deeper": __frame.SaveLocal("Plunge.level", writer); __frame.SaveLocal("Plunge.mine", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Plunge.deeper/"); Plunge__LocalsToSave(__frame.Lend(__frame.Plunge____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; case "wait": __frame.SaveLocal("Plunge.mine", writer); break; } } } } namespace Ariadne.UnitTests { partial class Widening { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Widening.Wrap__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Widening.Wrap__Frame)); if (scope != null) { global::Ariadne.UnitTests.Widening.Wrap__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Wrap__Frame : global::Ariadne.Frame { public int Wrap__left; public X Wrap__kept; public global::Ariadne.Frame Wrap____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Wrap.kept"); lister.Local("Wrap.left"); lister.Polymorphic("Wrap.deeper/", typeof(global::Ariadne.UnitTests.Widening.Wrap__Frame<>)); } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Widening() { } protected Widening(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Widening(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Widening.Wrap__Frame)); if (scope != null) { global::Ariadne.UnitTests.Widening.Wrap__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 304 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Widening.Wrap__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Wrap__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Wrap.kept": #line 320 "Recursion.cs" writer.Local("Wrap.kept", this.Wrap__kept); #line hidden return; case "Wrap.left": #line 318 "Recursion.cs" writer.Local("Wrap.left", this.Wrap__left); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Wrap__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Wrap.kept", out X loaded)) { this.Wrap__kept = loaded; } } { if (reader.TryLocal("Wrap.left", out int loaded)) { this.Wrap__left = loaded; } } { if (reader.TryScope("Wrap.deeper/", out global::Ariadne.IArcReader scope)) { this.Wrap____call_deeper_frame = global::Ariadne.Frame.Build(typeof(global::Ariadne.UnitTests.Widening.Wrap__Frame<>), scope); this.Wrap____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Wrap____call_deeper_frame != null) { this.Wrap____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Wrap____call_deeper_frame != null) { this.Wrap____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 341 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Widening.Wrap__Frame(); } if (!Wrap__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (7) : default(int), __frame.ResumeKey == null ? (2) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Wrap__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Wrap__Passage(Wrap__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, X item, int left__argument) { #line hidden ref int left = ref __frame.Wrap__left; if (__frame.ResumeKey == null) { left = left__argument; } ref X kept = ref __frame.Wrap__kept; switch (__frame.ResumeKey) { case "wait": goto wait; case "deeper": goto deeper; } #line 320 "Recursion.cs" kept = item; #line hidden wait: #line 323 "Recursion.cs" while (!gates.Open.Contains("wrap" + left)) #line hidden { #line 325 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 328 "Recursion.cs" Log += Wrapping(typeof(X)) + "@" + left + ";"; #line hidden { #line 329 "Recursion.cs" if (!(left > 0)) goto __end1; #line hidden } #line hidden deeper: #line hidden { #line 332 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Wrap____call_deeper_frame == null) { __frame.Wrap____call_deeper_frame = new global::Ariadne.UnitTests.Widening.Wrap__Frame>(); } if (!Wrap__Passage>(__frame.Lend(((global::Ariadne.UnitTests.Widening.Wrap__Frame>)__frame.Wrap____call_deeper_frame)), __arcFrame, __time, gates, __frame.ResumeKey == null ? (new System.Collections.Generic.List { kept }) : default(global::System.Collections.Generic.List), __frame.ResumeKey == null ? (left - 1) : default(int))) { return false; } } #line hidden } #line hidden __end1: #line 335 "Recursion.cs" Log += "up" + Wrapping(kept.GetType()) + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Wrap__LocalsToSave(Wrap__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Wrap.left", writer); __frame.SaveLocal("Wrap.kept", writer); break; case "deeper": __frame.SaveLocal("Wrap.left", writer); __frame.SaveLocal("Wrap.kept", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Wrap.deeper/"); scope.TypeArguments(typeof(global::System.Collections.Generic.List)); Wrap__LocalsToSave>(__frame.Lend(((global::Ariadne.UnitTests.Widening.Wrap__Frame>)__frame.Wrap____call_deeper_frame)), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Relapsing { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public Run__Frame __runFrame = new Run__Frame(); public static void ListParts(global::Ariadne.IArcPartLister lister) { Run__Frame.ListParts(lister); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Run__Frame : global::Ariadne.Frame { public int Run__lap; public global::Ariadne.UnitTests.Relapsing.Again__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.lap"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Relapsing.Again__Frame)); if (scope != null) { global::Ariadne.UnitTests.Relapsing.Again__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Again__Frame : global::Ariadne.Frame { public int Again__kept; public global::Ariadne.UnitTests.Relapsing.Run__Frame Again____call_back_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Again.kept"); { global::Ariadne.IArcPartLister scope = lister.Scope("Again.back/", typeof(global::Ariadne.UnitTests.Relapsing.Run__Frame)); if (scope != null) { global::Ariadne.UnitTests.Relapsing.Run__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { var __arcFrame = (__Frame)__CurrentFrame; return Run__Passage(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { var __arcFrame = (__Frame)__CurrentFrame; Run__LocalsToSave(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, 0, writer, writer); } public Relapsing() { } protected Relapsing(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Laps", out int loaded)) { this.Laps = loaded; } else if (!reader.HasField("Laps")) { throw new global::System.IO.InvalidDataException("Relapsing's save has no field 'Laps', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Relapsing(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Laps"); lister.Field("Log"); Run__Frame.ListParts(lister); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 350 "Recursion.cs" writer.Field("Laps", this.Laps); #line 352 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); this.__runFrame.LoadLocals(reader); } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); this.__runFrame.AttachWaits(slot); } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); this.__runFrame.EndWaits(); } } #pragma warning restore public partial class Run__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.lap": #line 372 "Recursion.cs" writer.Local("Run.lap", this.Run__lap); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Run__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Run.lap", out int loaded)) { this.Run__lap = loaded; } } { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Relapsing.Again__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Again__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Again.kept": #line 354 "Recursion.cs" writer.Local("Again.kept", this.Again__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Again__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Again.kept", out int loaded)) { this.Again__kept = loaded; } } { if (reader.TryScope("Again.back/", out global::Ariadne.IArcReader scope)) { this.Again____call_back_frame = new global::Ariadne.UnitTests.Relapsing.Run__Frame(); this.Again____call_back_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Again____call_back_frame != null) { this.Again____call_back_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Again____call_back_frame != null) { this.Again____call_back_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("Relapsing")] protected bool Run__Passage(Run__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden ref int lap = ref __frame.Run__lap; switch (__frame.ResumeKey) { case "start": goto start; } #line 372 "Recursion.cs" lap = Laps++; #line hidden start: #line 375 "Recursion.cs" using (__frame.Enter("start")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Relapsing.Again__Frame(); } if (!Again__Passage(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (lap) : default(int))) { return false; } } #line 376 "Recursion.cs" Log += "end" + lap + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(Run__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": __frame.SaveLocal("Run.lap", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Again__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("Relapsing")] private bool Again__Passage(Again__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int kept__argument) { #line hidden ref int kept = ref __frame.Again__kept; if (__frame.ResumeKey == null) { kept = kept__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; case "back": goto back; } #line hidden wait: #line 357 "Recursion.cs" while (!gates.Open.Contains("lap" + kept)) #line hidden { #line 359 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 362 "Recursion.cs" Log += "lap" + kept + ";"; #line hidden { #line 363 "Recursion.cs" if (!(kept < 2)) goto __end1; #line hidden } #line hidden back: #line hidden { #line 366 "Recursion.cs" using (__frame.Enter("back")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Again____call_back_frame == null) { __frame.Again____call_back_frame = new global::Ariadne.UnitTests.Relapsing.Run__Frame(); } if (!Run__Passage(__frame.Lend(__frame.Again____call_back_frame), __arcFrame, __time, gates)) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Again__LocalsToSave(Again__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Again.kept", writer); break; case "back": { global::Ariadne.IArcWriter scope = writer.Scope("Again.back/"); Run__LocalsToSave(__frame.Lend(__frame.Again____call_back_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Repeating { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public Run__Frame __runFrame = new Run__Frame(); public static void ListParts(global::Ariadne.IArcPartLister lister) { Run__Frame.ListParts(lister); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Run__Frame : global::Ariadne.Frame { public int Run__lap; public global::Ariadne.UnitTests.Repeating.Run__Frame Run____call_again_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.lap"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.again/", typeof(global::Ariadne.UnitTests.Repeating.Run__Frame)); if (scope != null) { global::Ariadne.UnitTests.Repeating.Run__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { var __arcFrame = (__Frame)__CurrentFrame; return Run__Passage(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { var __arcFrame = (__Frame)__CurrentFrame; Run__LocalsToSave(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, 0, writer, writer); } public Repeating() { } protected Repeating(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Laps", out int loaded)) { this.Laps = loaded; } else if (!reader.HasField("Laps")) { throw new global::System.IO.InvalidDataException("Repeating's save has no field 'Laps', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } } protected Repeating(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Laps"); lister.Field("Log"); Run__Frame.ListParts(lister); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 385 "Recursion.cs" writer.Field("Laps", this.Laps); #line 387 "Recursion.cs" writer.Field("Log", this.Log); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); this.__runFrame.LoadLocals(reader); } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); this.__runFrame.AttachWaits(slot); } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); this.__runFrame.EndWaits(); } } #pragma warning restore public partial class Run__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.lap": #line 391 "Recursion.cs" writer.Local("Run.lap", this.Run__lap); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Run__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Run.lap", out int loaded)) { this.Run__lap = loaded; } } { if (reader.TryScope("Run.again/", out global::Ariadne.IArcReader scope)) { this.Run____call_again_frame = new global::Ariadne.UnitTests.Repeating.Run__Frame(); this.Run____call_again_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_again_frame != null) { this.Run____call_again_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_again_frame != null) { this.Run____call_again_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("Repeating")] protected bool Run__Passage(Run__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden ref int lap = ref __frame.Run__lap; switch (__frame.ResumeKey) { case "wait": goto wait; case "again": goto again; } #line 391 "Recursion.cs" lap = Laps++; #line hidden wait: #line 394 "Recursion.cs" while (!gates.Open.Contains("round" + lap)) #line hidden { #line 396 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 399 "Recursion.cs" Log += "round" + lap + ";"; #line hidden { #line 400 "Recursion.cs" if (!(lap < 2)) goto __end1; #line hidden } #line hidden again: #line hidden { #line 403 "Recursion.cs" using (__frame.Enter("again")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Run____call_again_frame == null) { __frame.Run____call_again_frame = new global::Ariadne.UnitTests.Repeating.Run__Frame(); } if (!Run__Passage(__frame.Lend(__frame.Run____call_again_frame), __arcFrame, __time, gates)) { return false; } } #line hidden } #line hidden __end1: #line 406 "Recursion.cs" Log += "done" + lap + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(Run__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Run.lap", writer); break; case "again": __frame.SaveLocal("Run.lap", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.again/"); Run__LocalsToSave(__frame.Lend(__frame.Run____call_again_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Cycling { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public Run__Frame __runFrame = new Run__Frame(); public static void ListParts(global::Ariadne.IArcPartLister lister) { Run__Frame.ListParts(lister); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Run__Frame : global::Ariadne.Frame { public int Run__lap; public global::Ariadne.UnitTests.Cycling.Pass__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.lap"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Cycling.Pass__Frame)); if (scope != null) { global::Ariadne.UnitTests.Cycling.Pass__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Pass__Frame : global::Ariadne.Frame { public int Pass__kept; public global::Ariadne.UnitTests.Cycling.Run__Frame Pass____call_back_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Pass.kept"); { global::Ariadne.IArcPartLister scope = lister.Scope("Pass.back/", typeof(global::Ariadne.UnitTests.Cycling.Run__Frame)); if (scope != null) { global::Ariadne.UnitTests.Cycling.Run__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { var __arcFrame = (__Frame)__CurrentFrame; return Run__Passage(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { var __arcFrame = (__Frame)__CurrentFrame; Run__LocalsToSave(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, 0, writer, writer); } public Cycling() { } protected Cycling(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Log", out string loaded)) { this.Log = loaded; } } { if (reader.TryField("Laps", out int loaded)) { this.Laps = loaded; } else if (!reader.HasField("Laps")) { throw new global::System.IO.InvalidDataException("Cycling's save has no field 'Laps', which has no initializer to fall back on. Give it one."); } } } protected Cycling(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Log"); lister.Field("Laps"); Run__Frame.ListParts(lister); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 415 "Recursion.cs" writer.Field("Log", this.Log); #line 417 "Recursion.cs" writer.Field("Laps", this.Laps); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); this.__runFrame.LoadLocals(reader); } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); this.__runFrame.AttachWaits(slot); } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); this.__runFrame.EndWaits(); } } #pragma warning restore public partial class Run__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.lap": #line 437 "Recursion.cs" writer.Local("Run.lap", this.Run__lap); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Run__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Run.lap", out int loaded)) { this.Run__lap = loaded; } } { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Cycling.Pass__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Pass__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Pass.kept": #line 419 "Recursion.cs" writer.Local("Pass.kept", this.Pass__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Pass__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Pass.kept", out int loaded)) { this.Pass__kept = loaded; } } { if (reader.TryScope("Pass.back/", out global::Ariadne.IArcReader scope)) { this.Pass____call_back_frame = new global::Ariadne.UnitTests.Cycling.Run__Frame(); this.Pass____call_back_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Pass____call_back_frame != null) { this.Pass____call_back_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Pass____call_back_frame != null) { this.Pass____call_back_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("Cycling")] protected bool Run__Passage(Run__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden ref int lap = ref __frame.Run__lap; switch (__frame.ResumeKey) { case "start": goto start; } #line 437 "Recursion.cs" lap = Laps++; #line hidden start: #line 440 "Recursion.cs" using (__frame.Enter("start")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Cycling.Pass__Frame(); } if (!Pass__Passage(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (lap) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(Run__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": __frame.SaveLocal("Run.lap", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Pass__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("Cycling")] private bool Pass__Passage(Pass__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int kept__argument) { #line hidden ref int kept = ref __frame.Pass__kept; if (__frame.ResumeKey == null) { kept = kept__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; case "back": goto back; } #line hidden wait: #line 422 "Recursion.cs" while (!gates.Open.Contains("pass" + kept)) #line hidden { #line 424 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 427 "Recursion.cs" Log += "pass" + kept + ";"; #line hidden { #line 428 "Recursion.cs" if (!(kept < 1)) goto __end1; #line hidden } #line hidden back: #line hidden { #line 431 "Recursion.cs" using (__frame.Enter("back")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Pass____call_back_frame == null) { __frame.Pass____call_back_frame = new global::Ariadne.UnitTests.Cycling.Run__Frame(); } if (!Run__Passage(__frame.Lend(__frame.Pass____call_back_frame), __arcFrame, __time, gates)) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Pass__LocalsToSave(Pass__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Pass.kept", writer); break; case "back": { global::Ariadne.IArcWriter scope = writer.Scope("Pass.back/"); Run__LocalsToSave(__frame.Lend(__frame.Pass____call_back_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class CyclingChild { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.UnitTests.Cycling.__Frame { public Run__Frame __runFrame = new Run__Frame(); public static void ListParts(global::Ariadne.IArcPartLister lister) { global::Ariadne.UnitTests.Cycling.__Frame.ListParts(lister); Run__Frame.ListParts(lister); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Run__Frame : global::Ariadne.Frame { public int Run__lap; public global::Ariadne.UnitTests.CyclingChild.Push__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.lap"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.CyclingChild.Push__Frame)); if (scope != null) { global::Ariadne.UnitTests.CyclingChild.Push__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Push__Frame : global::Ariadne.Frame { public int Push__kept; public global::Ariadne.UnitTests.CyclingChild.Run__Frame Push____call_back_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Push.kept"); { global::Ariadne.IArcPartLister scope = lister.Scope("Push.back/", typeof(global::Ariadne.UnitTests.CyclingChild.Run__Frame)); if (scope != null) { global::Ariadne.UnitTests.CyclingChild.Run__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { var __arcFrame = (__Frame)__CurrentFrame; return Run__Passage(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { var __arcFrame = (__Frame)__CurrentFrame; Run__LocalsToSave(__arcFrame.Lend(__arcFrame.__runFrame), __arcFrame, 0, writer, writer); } public CyclingChild() { } protected CyclingChild(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { } protected CyclingChild(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { Run__Frame.ListParts(lister); } #pragma warning restore #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); this.__runFrame.LoadLocals(reader); } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); this.__runFrame.AttachWaits(slot); } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); this.__runFrame.EndWaits(); } } #pragma warning restore public partial class Run__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.lap": #line 464 "Recursion.cs" writer.Local("Run.lap", this.Run__lap); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Run__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Run.lap", out int loaded)) { this.Run__lap = loaded; } } { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.CyclingChild.Push__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Push__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Push.kept": #line 446 "Recursion.cs" writer.Local("Push.kept", this.Push__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Push__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Push.kept", out int loaded)) { this.Push__kept = loaded; } } { if (reader.TryScope("Push.back/", out global::Ariadne.IArcReader scope)) { this.Push____call_back_frame = new global::Ariadne.UnitTests.CyclingChild.Run__Frame(); this.Push____call_back_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Push____call_back_frame != null) { this.Push____call_back_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Push____call_back_frame != null) { this.Push____call_back_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("CyclingChild")] protected bool Run__Passage(Run__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden ref int lap = ref __frame.Run__lap; switch (__frame.ResumeKey) { case "start": goto start; } #line 464 "Recursion.cs" lap = Laps++; #line hidden start: #line 467 "Recursion.cs" using (__frame.Enter("start")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.CyclingChild.Push__Frame(); } if (!Push__Passage(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (lap) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(Run__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": __frame.SaveLocal("Run.lap", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Push__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] [global::Ariadne.ReachesRunByName("CyclingChild")] private bool Push__Passage(Push__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int kept__argument) { #line hidden ref int kept = ref __frame.Push__kept; if (__frame.ResumeKey == null) { kept = kept__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; case "back": goto back; } #line hidden wait: #line 449 "Recursion.cs" while (!gates.Open.Contains("push" + kept)) #line hidden { #line 451 "Recursion.cs" __frame.Mark("wait"); return false; #line hidden } #line 454 "Recursion.cs" Log += "push" + kept + ";"; #line hidden { #line 455 "Recursion.cs" if (!(kept < 1)) goto __end1; #line hidden } #line hidden back: #line hidden { #line 458 "Recursion.cs" using (__frame.Enter("back")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Push____call_back_frame == null) { __frame.Push____call_back_frame = new global::Ariadne.UnitTests.CyclingChild.Run__Frame(); } if (!Run__Passage(__frame.Lend(__frame.Push____call_back_frame), __arcFrame, __time, gates)) { return false; } } #line hidden } #line hidden __end1: #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Push__LocalsToSave(Push__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Push.kept", writer); break; case "back": { global::Ariadne.IArcWriter scope = writer.Scope("Push.back/"); Run__LocalsToSave(__frame.Lend(__frame.Push____call_back_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Fathomless { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Fathomless.Sink__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Fathomless.Sink__Frame)); if (scope != null) { global::Ariadne.UnitTests.Fathomless.Sink__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Sink__Frame : global::Ariadne.Frame { public X Sink__item; public int Sink__level; public global::Ariadne.Frame Sink____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Sink.item"); lister.Local("Sink.level"); lister.Polymorphic("Sink.deeper/", typeof(global::Ariadne.UnitTests.Fathomless.Sink__Frame<>)); } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Fathomless() { } protected Fathomless(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Reached", out int loaded)) { this.Reached = loaded; } else if (!reader.HasField("Reached")) { throw new global::System.IO.InvalidDataException("Fathomless's save has no field 'Reached', which has no initializer to fall back on. Give it one."); } } } protected Fathomless(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Reached"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Fathomless.Sink__Frame)); if (scope != null) { global::Ariadne.UnitTests.Fathomless.Sink__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 476 "Recursion.cs" writer.Field("Reached", this.Reached); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Fathomless.Sink__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Sink__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Sink.item": #line 478 "Recursion.cs" writer.Local("Sink.item", this.Sink__item); #line hidden return; case "Sink.level": #line 478 "Recursion.cs" writer.Local("Sink.level", this.Sink__level); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Sink__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Sink.item", out X loaded)) { this.Sink__item = loaded; } } { if (reader.TryLocal("Sink.level", out int loaded)) { this.Sink__level = loaded; } } { if (reader.TryScope("Sink.deeper/", out global::Ariadne.IArcReader scope)) { this.Sink____call_deeper_frame = global::Ariadne.Frame.Build(typeof(global::Ariadne.UnitTests.Fathomless.Sink__Frame<>), scope); this.Sink____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Sink____call_deeper_frame != null) { this.Sink____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Sink____call_deeper_frame != null) { this.Sink____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 497 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Fathomless.Sink__Frame(); } if (!Sink__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (0) : default(int), __frame.ResumeKey == null ? (0) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Sink__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Sink__Passage(Sink__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, X item__argument, int level__argument) { #line hidden ref X item = ref __frame.Sink__item; if (__frame.ResumeKey == null) { item = item__argument; } ref int level = ref __frame.Sink__level; if (__frame.ResumeKey == null) { level = level__argument; } switch (__frame.ResumeKey) { case "never": goto never; case "deeper": goto deeper; } #line 480 "Recursion.cs" Reached = level; #line hidden { #line 481 "Recursion.cs" if (!(level < 0)) goto __end1; #line hidden } #line hidden never: #line hidden { #line 484 "Recursion.cs" while (!gates.Open.Contains("never")) #line hidden { #line 486 "Recursion.cs" __frame.Mark("never"); return false; #line hidden } #line hidden } #line hidden __end1: #line hidden deeper: #line 491 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Sink____call_deeper_frame == null) { __frame.Sink____call_deeper_frame = new global::Ariadne.UnitTests.Fathomless.Sink__Frame>(); } if (!Sink__Passage>(__frame.Lend(((global::Ariadne.UnitTests.Fathomless.Sink__Frame>)__frame.Sink____call_deeper_frame)), __arcFrame, __time, gates, __frame.ResumeKey == null ? (new System.Collections.Generic.List { item }) : default(global::System.Collections.Generic.List), __frame.ResumeKey == null ? (level + 1) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Sink__LocalsToSave(Sink__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "never": __frame.SaveLocal("Sink.item", writer); __frame.SaveLocal("Sink.level", writer); break; case "deeper": __frame.SaveLocal("Sink.item", writer); __frame.SaveLocal("Sink.level", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Sink.deeper/"); scope.TypeArguments(typeof(global::System.Collections.Generic.List)); Sink__LocalsToSave>(__frame.Lend(((global::Ariadne.UnitTests.Fathomless.Sink__Frame>)__frame.Sink____call_deeper_frame)), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.UnitTests { partial class Bottomless { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Bottomless.Deeper__Frame Run____call_start_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Bottomless.Deeper__Frame)); if (scope != null) { global::Ariadne.UnitTests.Bottomless.Deeper__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Deeper__Frame : global::Ariadne.Frame { public int Deeper__level; public global::Ariadne.UnitTests.Bottomless.Deeper__Frame Deeper____call_deeper_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Deeper.level"); { global::Ariadne.IArcPartLister scope = lister.Scope("Deeper.deeper/", typeof(global::Ariadne.UnitTests.Bottomless.Deeper__Frame)); if (scope != null) { global::Ariadne.UnitTests.Bottomless.Deeper__Frame.ListParts(scope); } } } } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public Bottomless() { } protected Bottomless(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Reached", out int loaded)) { this.Reached = loaded; } else if (!reader.HasField("Reached")) { throw new global::System.IO.InvalidDataException("Bottomless's save has no field 'Reached', which has no initializer to fall back on. Give it one."); } } } protected Bottomless(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Reached"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.UnitTests.Bottomless.Deeper__Frame)); if (scope != null) { global::Ariadne.UnitTests.Bottomless.Deeper__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 506 "Recursion.cs" writer.Field("Reached", this.Reached); #line default } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.UnitTests.Bottomless.Deeper__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Deeper__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Deeper.level": #line 508 "Recursion.cs" writer.Local("Deeper.level", this.Deeper__level); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Deeper__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Deeper.level", out int loaded)) { this.Deeper__level = loaded; } } { if (reader.TryScope("Deeper.deeper/", out global::Ariadne.IArcReader scope)) { this.Deeper____call_deeper_frame = new global::Ariadne.UnitTests.Bottomless.Deeper__Frame(); this.Deeper____call_deeper_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Deeper____call_deeper_frame != null) { this.Deeper____call_deeper_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Deeper____call_deeper_frame != null) { this.Deeper____call_deeper_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates) { #line hidden switch (__frame.ResumeKey) { case "start": goto start; } #line hidden start: #line 527 "Recursion.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.UnitTests.Bottomless.Deeper__Frame(); } if (!Deeper__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (0) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Deeper__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Deeper__Passage(Deeper__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, ArcTests.Gates gates, int level__argument) { #line hidden ref int level = ref __frame.Deeper__level; if (__frame.ResumeKey == null) { level = level__argument; } switch (__frame.ResumeKey) { case "never": goto never; case "deeper": goto deeper; } #line 510 "Recursion.cs" Reached = level; #line hidden { #line 511 "Recursion.cs" if (!(level < 0)) goto __end1; #line hidden } #line hidden never: #line hidden { #line 514 "Recursion.cs" while (!gates.Open.Contains("never")) #line hidden { #line 516 "Recursion.cs" __frame.Mark("never"); return false; #line hidden } #line hidden } #line hidden __end1: #line hidden deeper: #line 521 "Recursion.cs" using (__frame.Enter("deeper")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.Deeper____call_deeper_frame == null) { __frame.Deeper____call_deeper_frame = new global::Ariadne.UnitTests.Bottomless.Deeper__Frame(); } if (!Deeper__Passage(__frame.Lend(__frame.Deeper____call_deeper_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (level + 1) : default(int))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Deeper__LocalsToSave(Deeper__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "never": __frame.SaveLocal("Deeper.level", writer); break; case "deeper": __frame.SaveLocal("Deeper.level", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Deeper.deeper/"); Deeper__LocalsToSave(__frame.Lend(__frame.Deeper____call_deeper_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } }