Move YesNtInterpreter constructor above custom statement methods

This commit is contained in:
Stone_Red
2026-03-05 01:03:32 +01:00
parent a7c76d8d16
commit 265f20d4b7
+11 -11
View File
@@ -70,6 +70,17 @@ public class YesNtInterpreter
}
}
/// <summary>
/// Initializes a new <see cref="YesNtInterpreter"/> and registers all built-in statements.
/// </summary>
public YesNtInterpreter()
{
GeneratedStatementRegistry.Register(runtimeInfo, out statements, out staticStatements);
runtimeInfo.OnDebugOutput += (s) => OnDebugOutput?.Invoke(s);
runtimeInfo.OnLineExecuted += e => OnLineExecuted?.Invoke(e);
}
/// <summary>
/// Registers a custom statement using a pre-built <see cref="StatementAttribute"/>.
/// If a statement with the same attribute key already exists it will be replaced.
@@ -114,17 +125,6 @@ public class YesNtInterpreter
AddStatement(new StatementAttribute(name, searchMode, spaceAround, consoleColor), handler);
}
/// <summary>
/// Initialises a new <see cref="YesNtInterpreter"/> and registers all built-in statements.
/// </summary>
public YesNtInterpreter()
{
GeneratedStatementRegistry.Register(runtimeInfo, out statements, out staticStatements);
runtimeInfo.OnDebugOutput += (s) => OnDebugOutput?.Invoke(s);
runtimeInfo.OnLineExecuted += e => OnLineExecuted?.Invoke(e);
}
/// <summary>
/// Requests a graceful stop of the currently executing script.
/// The interpreter will terminate at the next line boundary.