Add YesNt interpreter process and command integration

This commit is contained in:
Stone_Red
2026-06-11 20:44:49 +02:00
parent 160d0559e8
commit cda4dcf097
4 changed files with 68 additions and 12 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RemSox.Processing;
using YesNt.Interpreter.Runtime;
using YesNt.Interpreter.Utilities;
namespace RemSox.Processes
{
public class YesNtInterpreterProcess() : Process("YesNtInterpreter")
{
YesNtInterpreter interpreter = null!;
internal override void Start(string[] args)
{
interpreter = new();
interpreter.AddStatement(new StatementInformation("%test", YesNt.Interpreter.Enums.SearchMode.Contains, YesNt.Interpreter.Enums.SpaceAround.None) { KeepStatementInArgs = true, Priority = YesNt.Interpreter.Enums.Priority.PreProcessing }, (args, context) =>
{
context.CurrentLine = TemplateProcessor.ProcessSimplePlaceholders(args, "%test", "Test successful!");
});
interpreter.Prepare([.. args]);
}
internal override void Tick()
{
if (interpreter.IsRunning)
{
interpreter.Step();
}
else
{
RequestStop();
}
}
internal override void Stop()
{
interpreter.Stop();
}
}
}