mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 17:16:24 +02:00
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
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();
|
|
}
|
|
}
|
|
} |