Make YesNtInterpreter usable as a library and add AddStatement method to be able to define custom statement

This commit is contained in:
Stone_Red
2026-03-04 19:40:46 +01:00
parent 9813426f06
commit 8e0abf155a
9 changed files with 83 additions and 15 deletions
@@ -5,7 +5,7 @@ using YesNt.Interpreter.Enums;
namespace YesNt.Interpreter.Attributes;
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal class StatementAttribute : Attribute
public class StatementAttribute : Attribute
{
public string Name { get; }
public SearchMode SearchMode { get; }
@@ -17,7 +17,7 @@ internal class StatementAttribute : Attribute
public bool IgnoreSyntaxHighlighting { get; }
public string Separator { get; set; }
internal StatementAttribute(string name, SearchMode searchMode, SpaceAround spaceAround, ConsoleColor color)
public StatementAttribute(string name, SearchMode searchMode, SpaceAround spaceAround, ConsoleColor color)
{
Name = name;
SearchMode = searchMode;
@@ -25,7 +25,7 @@ internal class StatementAttribute : Attribute
Color = color;
}
internal StatementAttribute(string name, SearchMode searchMode, SpaceAround spaceAround)
public StatementAttribute(string name, SearchMode searchMode, SpaceAround spaceAround)
{
Name = name;
SearchMode = searchMode;
@@ -5,7 +5,7 @@ using YesNt.Interpreter.Enums;
namespace YesNt.Interpreter.Attributes;
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal class StaticStatementAttribute : Attribute
public class StaticStatementAttribute : Attribute
{
public bool ExecuteInSearchMode { get; set; }
public Priority Priority { get; set; } = Priority.Normal;