Add stepwise and time-based script execution with Step and RunFor methods

This commit is contained in:
Stone_Red
2026-06-11 01:02:24 +02:00
parent a465897f3c
commit 5ad0053ef7
2 changed files with 195 additions and 32 deletions
@@ -0,0 +1,27 @@
namespace YesNt.Interpreter.Runtime;
/// <summary>
/// The outcome of a single <see cref="YesNtInterpreter.StepOnce"/> call,
/// or the aggregate result of <see cref="YesNtInterpreter.Step"/> /
/// <see cref="YesNtInterpreter.RunFor"/>.
/// </summary>
public enum StepResult
{
/// <summary>
/// A line was executed and more lines remain. Keep stepping to continue.
/// </summary>
Continue,
/// <summary>
/// The step or time budget was exhausted before the script finished.
/// <see cref="YesNtInterpreter.IsRunning"/> is still <see langword="true"/>;
/// call any of the run methods again to resume.
/// </summary>
Paused,
/// <summary>
/// The script ran to completion (end-of-file, explicit exit, or error).
/// <see cref="YesNtInterpreter.IsRunning"/> is now <see langword="false"/>.
/// </summary>
Finished,
}