// // 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 using System.Collections.Generic; namespace Ariadne.UnitTests { partial class Collector { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public T Run__held; public global::System.Collections.Generic.List Run__seen; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.held"); lister.Local>("Run.seen"); } } [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 Collector() { } protected Collector(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Source", out T loaded)) { this.Source = loaded; } else if (!reader.HasField("Source")) { throw new global::System.IO.InvalidDataException("Collector's save has no field 'Source', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Result", out T loaded)) { this.Result = loaded; } else if (!reader.HasField("Result")) { throw new global::System.IO.InvalidDataException("Collector's save has no field 'Result', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Count", out int loaded)) { this.Count = loaded; } else if (!reader.HasField("Count")) { throw new global::System.IO.InvalidDataException("Collector's save has no field 'Count', which has no initializer to fall back on. Give it one."); } } } protected Collector(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("Source"); lister.Field("Result"); lister.Field("Count"); lister.Local("Run.held"); lister.Local>("Run.seen"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 10 "Generics.cs" writer.Field("Source", this.Source); #line 12 "Generics.cs" writer.Field("Result", this.Result); #line 31 "Generics.cs" writer.Field("Count", this.Count); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.held": #line 16 "Generics.cs" writer.Local("Run.held", this.Run__held); #line hidden return; case "Run.seen": #line 17 "Generics.cs" writer.Local>("Run.seen", this.Run__seen); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Run.held", out T loaded)) { this.Run__held = loaded; } } { if (reader.TryLocal>("Run.seen", out global::System.Collections.Generic.List loaded)) { this.Run__seen = loaded; } } } } #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 ref T held = ref __frame.Run__held; ref global::System.Collections.Generic.List seen = ref __frame.Run__seen; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 16 "Generics.cs" held = Source; #line 17 "Generics.cs" seen = new List(); #line hidden wait: #line 20 "Generics.cs" while (!gates.Open.Contains("go")) #line hidden { #line 22 "Generics.cs" seen.Add(held); #line 23 "Generics.cs" __frame.Mark("wait"); return false; #line hidden } #line 26 "Generics.cs" seen.Add(held); #line 27 "Generics.cs" Result = seen[seen.Count - 1]; #line 28 "Generics.cs" Count = seen.Count; #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 "wait": __frame.SaveLocal("Run.held", writer); __frame.SaveLocal("Run.seen", writer); break; } } } } namespace Ariadne.UnitTests { partial class Stepper { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public T Hold__held; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Hold.held"); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } protected Stepper() { } protected Stepper(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Last", out T loaded)) { this.Last = loaded; } else if (!reader.HasField("Last")) { throw new global::System.IO.InvalidDataException("Stepper's save has no field 'Last', which has no initializer to fall back on. Give it one."); } } } protected Stepper(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("Last"); lister.Local("Hold.held"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 39 "Generics.cs" writer.Field("Last", this.Last); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Hold.held": #line 43 "Generics.cs" writer.Local("Hold.held", this.Hold__held); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Hold.held", out T loaded)) { this.Hold__held = loaded; } } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Hold__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates, T value) { #line hidden ref T held = ref __frame.Hold__held; switch (__frame.ResumeKey) { case "hold": goto hold; } #line 43 "Generics.cs" held = value; #line hidden hold: #line 46 "Generics.cs" while (!gates.Open.Contains("go")) #line hidden { #line 48 "Generics.cs" __frame.Mark("hold"); return false; #line hidden } #line 51 "Generics.cs" Last = held; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Hold__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "hold": __frame.SaveLocal("Hold.held", writer); break; } } } } namespace Ariadne.UnitTests { partial class WordStepper { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.UnitTests.Stepper.__Frame { public string Run__local; public static void ListParts(global::Ariadne.IArcPartLister lister) { global::Ariadne.UnitTests.Stepper.__Frame.ListParts(lister); lister.Local("Run.local"); } } [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 WordStepper() { } protected WordStepper(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Source", out string loaded)) { this.Source = loaded; } } } protected WordStepper(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("Source"); lister.Local("Run.local"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 57 "Generics.cs" writer.Field("Source", this.Source); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.local": #line 61 "Generics.cs" writer.Local("Run.local", this.Run__local); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Run.local", out string loaded)) { this.Run__local = loaded; } } } } #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 ref string local = ref __frame.Run__local; switch (__frame.ResumeKey) { case "first": goto first; } #line 61 "Generics.cs" local = Source + "!"; #line hidden first: #line 64 "Generics.cs" using (__frame.Enter("first")) { if (!Hold__Passage(__frame, __time, gates, __frame.ResumeKey == null ? (local) : default(string))) { 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 "first": __frame.SaveLocal("Run.local", writer); Hold__LocalsToSave(__frame, depth + 1, writer); break; } } } } namespace Ariadne.UnitTests { partial class Planter { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public T Plant__kept; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Plant.kept"); } } [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); } public Planter() { } protected Planter(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Planted", out T loaded)) { this.Planted = loaded; } else if (!reader.HasField("Planted")) { throw new global::System.IO.InvalidDataException("Planter's save has no field 'Planted', which has no initializer to fall back on. Give it one."); } } } protected Planter(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("Planted"); lister.Local("Plant.kept"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 73 "Generics.cs" writer.Field("Planted", this.Planted); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Plant.kept": #line 77 "Generics.cs" writer.Local("Plant.kept", this.Plant__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Plant.kept", out T loaded)) { this.Plant__kept = loaded; } } } } #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 Plant__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates, T seed) { #line hidden ref T kept = ref __frame.Plant__kept; switch (__frame.ResumeKey) { case "grow": goto grow; } #line 77 "Generics.cs" kept = seed; #line hidden grow: #line 80 "Generics.cs" while (!gates.Open.Contains("go")) #line hidden { #line 82 "Generics.cs" __frame.Mark("grow"); return false; #line hidden } #line 85 "Generics.cs" Planted = kept; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Plant__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "grow": __frame.SaveLocal("Plant.kept", writer); break; } } } } namespace Ariadne.UnitTests { partial class Gardener { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public string Run__seed; public global::Ariadne.UnitTests.Planter Run____call_plant_receiver; public global::Ariadne.UnitTests.Planter.__Frame Run____call_plant_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.seed"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.plant/", typeof(global::Ariadne.UnitTests.Planter.__Frame)); if (scope != null) { scope.Local>("receiver"); global::Ariadne.UnitTests.Planter.__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 Gardener() { } protected Gardener(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField>("Plot", out global::Ariadne.UnitTests.Planter loaded)) { this.Plot = loaded; } else if (!reader.HasField("Plot")) { throw new global::System.IO.InvalidDataException("Gardener's save has no field 'Plot', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Report", out string loaded)) { this.Report = loaded; } else if (!reader.HasField("Report")) { throw new global::System.IO.InvalidDataException("Gardener's save has no field 'Report', which has no initializer to fall back on. Give it one."); } } } protected Gardener(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>("Plot"); lister.Field("Report"); lister.Local("Run.seed"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.plant/", typeof(global::Ariadne.UnitTests.Planter.__Frame)); if (scope != null) { scope.Local>("receiver"); global::Ariadne.UnitTests.Planter.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 95 "Generics.cs" writer.Field>("Plot", this.Plot); #line 97 "Generics.cs" writer.Field("Report", this.Report); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.plant/receiver": #line 104 "Generics.cs" writer.Local>("receiver", this.Run____call_plant_receiver); #line hidden return; case "Run.seed": #line 101 "Generics.cs" writer.Local("Run.seed", this.Run__seed); #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("Run.seed", out string loaded)) { this.Run__seed = loaded; } } { if (reader.TryScope("Run.plant/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal>("receiver", out global::Ariadne.UnitTests.Planter loaded)) { this.Run____call_plant_receiver = loaded; } } if (this.Run____call_plant_receiver != null) { this.Run____call_plant_frame = (global::Ariadne.UnitTests.Planter.__Frame)this.Run____call_plant_receiver.NewFrame(); this.Run____call_plant_frame.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); } } 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(); } } } #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 ref string seed = ref __frame.Run__seed; switch (__frame.ResumeKey) { case "plant": goto plant; } #line 101 "Generics.cs" seed = "tulip"; #line hidden plant: #line 104 "Generics.cs" using (__frame.Enter("plant")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_plant_receiver = (Plot); __frame.Run____call_plant_frame = null; } if (__frame.Run____call_plant_frame == null) { __frame.Run____call_plant_frame = (global::Ariadne.UnitTests.Planter.__Frame)__frame.Run____call_plant_receiver.NewFrame(); } if (!__frame.Run____call_plant_receiver.Plant__Passage(__frame.Lend(__frame.Run____call_plant_frame), __time, gates, __frame.ResumeKey == null ? (seed) : default(string))) { return false; } } #line 105 "Generics.cs" Report = "planted " + Plot.Planted; #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": __frame.SaveLocal("Run.seed", writer); { 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.Plant__LocalsToSave(__frame.Lend(__frame.Run____call_plant_frame), depth + 1, scope); } } break; } } } }