Remove Initialize calls and add AddStatement tests

This commit is contained in:
Stone_Red
2026-03-04 19:41:19 +01:00
parent 8e0abf155a
commit b2fdd9c841
8 changed files with 250 additions and 16 deletions
@@ -60,21 +60,19 @@ public class YesNtInterpreter
AddStatement(new StatementAttribute(name, searchMode, spaceAround, consoleColor), handler);
}
public void Stop()
public YesNtInterpreter()
{
runtimeInfo.Exit("Terminated by external process", true);
}
public void Initialize()
{
statements.Clear();
staticStatements.Clear();
GeneratedStatementRegistry.Register(runtimeInfo, out statements, out staticStatements);
runtimeInfo.OnDebugOutput += (s) => OnDebugOutput?.Invoke(s);
runtimeInfo.OnLineExecuted += (DebugEventArgs e) => OnLineExecuted?.Invoke(e);
}
public void Stop()
{
runtimeInfo.Exit("Terminated by external process", true);
}
public void Execute(string path, bool isDebugMode = false)
{
runtimeInfo.Reset();