// // 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; using System.Collections.Generic; namespace Ariadne.UnitTests { partial class DelayWorkerScript { [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.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 DelayWorkerScript() { } protected DelayWorkerScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { } protected DelayWorkerScript(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::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 Ask__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates, out global::System.TimeSpan __result) { #line hidden __result = default(global::System.TimeSpan); switch (__frame.ResumeKey) { case "ask": goto ask; } #line hidden ask: #line 14 "ForeignSpillScripts.cs" while (!gates.Open.Contains("answer")) #line hidden { #line 16 "ForeignSpillScripts.cs" __frame.Mark("ask"); return false; #line hidden } #line 19 "ForeignSpillScripts.cs" { __result = TimeSpan.FromSeconds(2); __frame.Exit(); return true; } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.UnitTests { partial class ForeignAskWaitScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::System.TimeSpan Run____spill1; public global::Amphora.Duration Run____wait1; public global::Ariadne.UnitTests.DelayWorkerScript Run____call_first_receiver; public global::Ariadne.UnitTests.DelayWorkerScript.__Frame Run____call_first_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.__wait1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.UnitTests.DelayWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.DelayWorkerScript.__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 ForeignAskWaitScript() { } protected ForeignAskWaitScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Delay", out global::Ariadne.UnitTests.DelayWorkerScript loaded)) { this.Delay = loaded; } } } protected ForeignAskWaitScript(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("Delay"); lister.Local("Run.__wait1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.UnitTests.DelayWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.DelayWorkerScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 35 "ForeignSpillScripts.cs" writer.Field("Delay", this.Delay); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.__wait1": #line 40 "ForeignSpillScripts.cs" writer.Local("Run.__wait1", this.Run____wait1); #line hidden return; case "Run.first/receiver": #line 40 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_first_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.TryLocal("Run.__wait1", out global::Amphora.Duration loaded)) { this.Run____wait1 = loaded; } } { if (reader.TryScope("Run.first/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.DelayWorkerScript loaded)) { this.Run____call_first_receiver = loaded; } } if (this.Run____call_first_receiver != null) { this.Run____call_first_frame = (global::Ariadne.UnitTests.DelayWorkerScript.__Frame)this.Run____call_first_receiver.NewFrame(); this.Run____call_first_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_first_frame != null) { this.Run____call_first_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 "first": goto first; case "first#1": goto first__1__resume; } #line hidden first: #line 40 "ForeignSpillScripts.cs" { global::System.TimeSpan __value; using (__frame.Enter("first")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_first_receiver = (Delay); __frame.Run____call_first_frame = null; } if (__frame.Run____call_first_frame == null) { __frame.Run____call_first_frame = (global::Ariadne.UnitTests.DelayWorkerScript.__Frame)__frame.Run____call_first_receiver.NewFrame(); } if (!__frame.Run____call_first_receiver.Ask__Passage(__frame.Lend(__frame.Run____call_first_frame), __time, gates, __result: out __value)) { return false; } } __frame.Run____spill1 = __value; } #line hidden first__1: #line 40 "ForeignSpillScripts.cs" __frame.Run____wait1 = __time.DeadlineAfter(__frame.Run____spill1); #line hidden first__1__resume: #line 40 "ForeignSpillScripts.cs" if (__time.GameTime < __frame.Run____wait1) { __frame.Sleep(__frame.Run____wait1); __frame.Mark("first#1"); return false; } #line 41 "ForeignSpillScripts.cs" Log.Add("done"); #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": { global::Ariadne.IArcWriter scope = writer.Scope("Run.first/"); __frame.SaveLocal("Run.first/receiver", scope); } break; case "first#1": __frame.SaveLocal("Run.__wait1", writer); break; } } } } namespace Ariadne.UnitTests { partial class ForeignExpressionScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run__before; public int Run____spill1; public global::Ariadne.UnitTests.WorkerScript Run____call_first_receiver; public global::Ariadne.UnitTests.WorkerScript.__Frame Run____call_first_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.before"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__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 ForeignExpressionScript() { } protected ForeignExpressionScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Worker", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.Worker = loaded; } } } protected ForeignExpressionScript(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("Worker"); lister.Local("Run.before"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 53 "ForeignSpillScripts.cs" writer.Field("Worker", this.Worker); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.before": #line 57 "ForeignSpillScripts.cs" writer.Local("Run.before", this.Run__before); #line hidden return; case "Run.first/receiver": #line 60 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_first_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.TryLocal("Run.before", out int loaded)) { this.Run__before = loaded; } } { if (reader.TryScope("Run.first/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.Run____call_first_receiver = loaded; } } if (this.Run____call_first_receiver != null) { this.Run____call_first_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)this.Run____call_first_receiver.NewFrame(); this.Run____call_first_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_first_frame != null) { this.Run____call_first_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 int before = ref __frame.Run__before; switch (__frame.ResumeKey) { case "first": goto first; } #line 57 "ForeignSpillScripts.cs" before = 4; #line hidden first: #line 60 "ForeignSpillScripts.cs" { int __value; using (__frame.Enter("first")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_first_receiver = (Worker); __frame.Run____call_first_frame = null; } if (__frame.Run____call_first_frame == null) { __frame.Run____call_first_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)__frame.Run____call_first_receiver.NewFrame(); } if (!__frame.Run____call_first_receiver.Add__Passage(__frame.Lend(__frame.Run____call_first_frame), __time, gates, __frame.ResumeKey == null ? (5) : default(int), __result: out __value)) { return false; } } __frame.Run____spill1 = __value; } #line 60 "ForeignSpillScripts.cs" Log.Add("total " + (before + __frame.Run____spill1)); #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.before", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.first/"); __frame.SaveLocal("Run.first/receiver", scope); if (__frame.Run____call_first_receiver != null) { __frame.Run____call_first_receiver.Add__LocalsToSave(__frame.Lend(__frame.Run____call_first_frame), depth + 1, scope); } } break; } } } } namespace Ariadne.UnitTests { partial class GatedWorkerScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public string Add__gate; public int Add__amount; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Add.amount"); lister.Local("Add.gate"); } } [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 GatedWorkerScript() { } protected GatedWorkerScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Total", out int loaded)) { this.Total = loaded; } else if (!reader.HasField("Total")) { throw new global::System.IO.InvalidDataException("GatedWorkerScript's save has no field 'Total', which has no initializer to fall back on. Give it one."); } } } protected GatedWorkerScript(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("Total"); lister.Local("Add.amount"); lister.Local("Add.gate"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 69 "ForeignSpillScripts.cs" writer.Field("Total", this.Total); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Add.amount": #line 71 "ForeignSpillScripts.cs" writer.Local("Add.amount", this.Add__amount); #line hidden return; case "Add.gate": #line 71 "ForeignSpillScripts.cs" writer.Local("Add.gate", this.Add__gate); #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("Add.amount", out int loaded)) { this.Add__amount = loaded; } } { if (reader.TryLocal("Add.gate", out string loaded)) { this.Add__gate = 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 Add__Passage(__Frame __frame, global::Ariadne.TickTime __time, ArcTests.Gates gates, string gate__argument, int amount__argument, out int __result) { #line hidden __result = default(int); ref string gate = ref __frame.Add__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref int amount = ref __frame.Add__amount; if (__frame.ResumeKey == null) { amount = amount__argument; } switch (__frame.ResumeKey) { case "wait": goto wait; } #line hidden wait: #line 74 "ForeignSpillScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 76 "ForeignSpillScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 79 "ForeignSpillScripts.cs" Total += amount; #line 80 "ForeignSpillScripts.cs" { __result = Total; __frame.Exit(); return true; } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Add__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Add.gate", writer); __frame.SaveLocal("Add.amount", writer); break; } } } } namespace Ariadne.UnitTests { partial class GatedSumScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run____spill1; public int Run____spill2; public global::Ariadne.UnitTests.GatedWorkerScript Run____call_sum_receiver; public global::Ariadne.UnitTests.GatedWorkerScript.__Frame Run____call_sum_frame; public global::Ariadne.UnitTests.GatedWorkerScript Run____call_sum__n1_receiver; public global::Ariadne.UnitTests.GatedWorkerScript.__Frame Run____call_sum__n1_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.__spill1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum/", typeof(global::Ariadne.UnitTests.GatedWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.GatedWorkerScript.__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum#1/", typeof(global::Ariadne.UnitTests.GatedWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.GatedWorkerScript.__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 GatedSumScript() { } protected GatedSumScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("First", out global::Ariadne.UnitTests.GatedWorkerScript loaded)) { this.First = loaded; } } { if (reader.TryField("Second", out global::Ariadne.UnitTests.GatedWorkerScript loaded)) { this.Second = loaded; } } } protected GatedSumScript(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("First"); lister.Field("Second"); lister.Local("Run.__spill1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum/", typeof(global::Ariadne.UnitTests.GatedWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.GatedWorkerScript.__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum#1/", typeof(global::Ariadne.UnitTests.GatedWorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.GatedWorkerScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 96 "ForeignSpillScripts.cs" writer.Field("First", this.First); #line 98 "ForeignSpillScripts.cs" writer.Field("Second", this.Second); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.__spill1": #line 103 "ForeignSpillScripts.cs" writer.Local("Run.__spill1", this.Run____spill1); #line hidden return; case "Run.sum#1/receiver": #line 103 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_sum__n1_receiver); #line hidden return; case "Run.sum/receiver": #line 103 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_sum_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.TryLocal("Run.__spill1", out int loaded)) { this.Run____spill1 = loaded; } } { if (reader.TryScope("Run.sum/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.GatedWorkerScript loaded)) { this.Run____call_sum_receiver = loaded; } } if (this.Run____call_sum_receiver != null) { this.Run____call_sum_frame = (global::Ariadne.UnitTests.GatedWorkerScript.__Frame)this.Run____call_sum_receiver.NewFrame(); this.Run____call_sum_frame.LoadLocals(scope); } } } { if (reader.TryScope("Run.sum#1/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.GatedWorkerScript loaded)) { this.Run____call_sum__n1_receiver = loaded; } } if (this.Run____call_sum__n1_receiver != null) { this.Run____call_sum__n1_frame = (global::Ariadne.UnitTests.GatedWorkerScript.__Frame)this.Run____call_sum__n1_receiver.NewFrame(); this.Run____call_sum__n1_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_sum_frame != null) { this.Run____call_sum_frame.AttachWaits(slot); } if (this.Run____call_sum__n1_frame != null) { this.Run____call_sum__n1_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_sum_frame != null) { this.Run____call_sum_frame.EndWaits(); } if (this.Run____call_sum__n1_frame != null) { this.Run____call_sum__n1_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 "sum": goto sum; case "sum#1": goto sum__1; } #line hidden sum: #line 103 "ForeignSpillScripts.cs" { int __value; using (__frame.Enter("sum")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_sum_receiver = (First); __frame.Run____call_sum_frame = null; } if (__frame.Run____call_sum_frame == null) { __frame.Run____call_sum_frame = (global::Ariadne.UnitTests.GatedWorkerScript.__Frame)__frame.Run____call_sum_receiver.NewFrame(); } if (!__frame.Run____call_sum_receiver.Add__Passage(__frame.Lend(__frame.Run____call_sum_frame), __time, gates, __frame.ResumeKey == null ? ("a") : default(string), __frame.ResumeKey == null ? (5) : default(int), __result: out __value)) { return false; } } __frame.Run____spill1 = __value; } #line hidden sum__1: #line 103 "ForeignSpillScripts.cs" { int __value; using (__frame.Enter("sum#1")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_sum__n1_receiver = (Second); __frame.Run____call_sum__n1_frame = null; } if (__frame.Run____call_sum__n1_frame == null) { __frame.Run____call_sum__n1_frame = (global::Ariadne.UnitTests.GatedWorkerScript.__Frame)__frame.Run____call_sum__n1_receiver.NewFrame(); } if (!__frame.Run____call_sum__n1_receiver.Add__Passage(__frame.Lend(__frame.Run____call_sum__n1_frame), __time, gates, __frame.ResumeKey == null ? ("b") : default(string), __frame.ResumeKey == null ? (7) : default(int), __result: out __value)) { return false; } } __frame.Run____spill2 = __value; } #line 103 "ForeignSpillScripts.cs" Log.Add("sum " + (__frame.Run____spill1 + __frame.Run____spill2)); #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 "sum": { global::Ariadne.IArcWriter scope = writer.Scope("Run.sum/"); __frame.SaveLocal("Run.sum/receiver", scope); if (__frame.Run____call_sum_receiver != null) { __frame.Run____call_sum_receiver.Add__LocalsToSave(__frame.Lend(__frame.Run____call_sum_frame), depth + 1, scope); } } break; case "sum#1": __frame.SaveLocal("Run.__spill1", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.sum#1/"); __frame.SaveLocal("Run.sum#1/receiver", scope); if (__frame.Run____call_sum__n1_receiver != null) { __frame.Run____call_sum__n1_receiver.Add__LocalsToSave(__frame.Lend(__frame.Run____call_sum__n1_frame), depth + 1, scope); } } break; } } } } namespace Ariadne.UnitTests { partial class TwoForeignCallsScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run____spill1; public int Run____spill2; public global::Ariadne.UnitTests.WorkerScript Run____call_sum_receiver; public global::Ariadne.UnitTests.WorkerScript.__Frame Run____call_sum_frame; public global::Ariadne.UnitTests.WorkerScript Run____call_sum__n1_receiver; public global::Ariadne.UnitTests.WorkerScript.__Frame Run____call_sum__n1_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.__spill1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum#1/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__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 TwoForeignCallsScript() { } protected TwoForeignCallsScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("First", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.First = loaded; } } { if (reader.TryField("Second", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.Second = loaded; } } } protected TwoForeignCallsScript(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("First"); lister.Field("Second"); lister.Local("Run.__spill1"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.sum#1/", typeof(global::Ariadne.UnitTests.WorkerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.UnitTests.WorkerScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 115 "ForeignSpillScripts.cs" writer.Field("First", this.First); #line 117 "ForeignSpillScripts.cs" writer.Field("Second", this.Second); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.__spill1": #line 122 "ForeignSpillScripts.cs" writer.Local("Run.__spill1", this.Run____spill1); #line hidden return; case "Run.sum#1/receiver": #line 122 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_sum__n1_receiver); #line hidden return; case "Run.sum/receiver": #line 122 "ForeignSpillScripts.cs" writer.Local("receiver", this.Run____call_sum_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.TryLocal("Run.__spill1", out int loaded)) { this.Run____spill1 = loaded; } } { if (reader.TryScope("Run.sum/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.Run____call_sum_receiver = loaded; } } if (this.Run____call_sum_receiver != null) { this.Run____call_sum_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)this.Run____call_sum_receiver.NewFrame(); this.Run____call_sum_frame.LoadLocals(scope); } } } { if (reader.TryScope("Run.sum#1/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.UnitTests.WorkerScript loaded)) { this.Run____call_sum__n1_receiver = loaded; } } if (this.Run____call_sum__n1_receiver != null) { this.Run____call_sum__n1_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)this.Run____call_sum__n1_receiver.NewFrame(); this.Run____call_sum__n1_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_sum_frame != null) { this.Run____call_sum_frame.AttachWaits(slot); } if (this.Run____call_sum__n1_frame != null) { this.Run____call_sum__n1_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_sum_frame != null) { this.Run____call_sum_frame.EndWaits(); } if (this.Run____call_sum__n1_frame != null) { this.Run____call_sum__n1_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 "sum": goto sum; case "sum#1": goto sum__1; } #line hidden sum: #line 122 "ForeignSpillScripts.cs" { int __value; using (__frame.Enter("sum")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_sum_receiver = (First); __frame.Run____call_sum_frame = null; } if (__frame.Run____call_sum_frame == null) { __frame.Run____call_sum_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)__frame.Run____call_sum_receiver.NewFrame(); } if (!__frame.Run____call_sum_receiver.Add__Passage(__frame.Lend(__frame.Run____call_sum_frame), __time, gates, __frame.ResumeKey == null ? (5) : default(int), __result: out __value)) { return false; } } __frame.Run____spill1 = __value; } #line hidden sum__1: #line 122 "ForeignSpillScripts.cs" { int __value; using (__frame.Enter("sum#1")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_sum__n1_receiver = (Second); __frame.Run____call_sum__n1_frame = null; } if (__frame.Run____call_sum__n1_frame == null) { __frame.Run____call_sum__n1_frame = (global::Ariadne.UnitTests.WorkerScript.__Frame)__frame.Run____call_sum__n1_receiver.NewFrame(); } if (!__frame.Run____call_sum__n1_receiver.Add__Passage(__frame.Lend(__frame.Run____call_sum__n1_frame), __time, gates, __frame.ResumeKey == null ? (7) : default(int), __result: out __value)) { return false; } } __frame.Run____spill2 = __value; } #line 122 "ForeignSpillScripts.cs" Log.Add("sum " + (__frame.Run____spill1 + __frame.Run____spill2)); #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 "sum": { global::Ariadne.IArcWriter scope = writer.Scope("Run.sum/"); __frame.SaveLocal("Run.sum/receiver", scope); if (__frame.Run____call_sum_receiver != null) { __frame.Run____call_sum_receiver.Add__LocalsToSave(__frame.Lend(__frame.Run____call_sum_frame), depth + 1, scope); } } break; case "sum#1": __frame.SaveLocal("Run.__spill1", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.sum#1/"); __frame.SaveLocal("Run.sum#1/receiver", scope); if (__frame.Run____call_sum__n1_receiver != null) { __frame.Run____call_sum__n1_receiver.Add__LocalsToSave(__frame.Lend(__frame.Run____call_sum__n1_frame), depth + 1, scope); } } break; } } } }