From 265f20d4b70a7bcdd25b6dfd55052a4b6e4dcf1f Mon Sep 17 00:00:00 2001
From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com>
Date: Thu, 5 Mar 2026 01:03:32 +0100
Subject: [PATCH] Move YesNtInterpreter constructor above custom statement
methods
---
YesNt.Interpreter/Runtime/YesNtInterpreter.cs | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/YesNt.Interpreter/Runtime/YesNtInterpreter.cs b/YesNt.Interpreter/Runtime/YesNtInterpreter.cs
index 462918a..d84632f 100644
--- a/YesNt.Interpreter/Runtime/YesNtInterpreter.cs
+++ b/YesNt.Interpreter/Runtime/YesNtInterpreter.cs
@@ -70,6 +70,17 @@ public class YesNtInterpreter
}
}
+ ///
+ /// Initializes a new and registers all built-in statements.
+ ///
+ public YesNtInterpreter()
+ {
+ GeneratedStatementRegistry.Register(runtimeInfo, out statements, out staticStatements);
+
+ runtimeInfo.OnDebugOutput += (s) => OnDebugOutput?.Invoke(s);
+ runtimeInfo.OnLineExecuted += e => OnLineExecuted?.Invoke(e);
+ }
+
///
/// Registers a custom statement using a pre-built .
/// 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);
}
- ///
- /// Initialises a new and registers all built-in statements.
- ///
- public YesNtInterpreter()
- {
- GeneratedStatementRegistry.Register(runtimeInfo, out statements, out staticStatements);
-
- runtimeInfo.OnDebugOutput += (s) => OnDebugOutput?.Invoke(s);
- runtimeInfo.OnLineExecuted += e => OnLineExecuted?.Invoke(e);
- }
-
///
/// Requests a graceful stop of the currently executing script.
/// The interpreter will terminate at the next line boundary.