mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-06 07:56:05 +02:00
- Add functions
- Code improvements
This commit is contained in:
@@ -12,7 +12,7 @@ namespace YesNt.CodeEditor
|
||||
private readonly SyntaxHighlighter syntaxHighlighter;
|
||||
private readonly List<string> debugOutput = new();
|
||||
|
||||
public YesNtInterpreter yesNtInterpreter { get; } = new();
|
||||
public YesNtInterpreter YesNtInterpreter { get; } = new();
|
||||
public int LineOffset { get; set; } = 0;
|
||||
public List<string> Lines { get; } = new();
|
||||
public Point CursorPosition { get; } = new(0, 0);
|
||||
@@ -29,10 +29,10 @@ namespace YesNt.CodeEditor
|
||||
|
||||
public TextEditor()
|
||||
{
|
||||
yesNtInterpreter.Initialize();
|
||||
yesNtInterpreter.OnDebugOutput += YesNtInterpreter_OnDebugOutput;
|
||||
yesNtInterpreter.OnLineExecuted += YesNtInterpreter_OnLineExecuted;
|
||||
syntaxHighlighter = new(yesNtInterpreter.StatementInformation);
|
||||
YesNtInterpreter.Initialize();
|
||||
YesNtInterpreter.OnDebugOutput += YesNtInterpreter_OnDebugOutput;
|
||||
YesNtInterpreter.OnLineExecuted += YesNtInterpreter_OnLineExecuted;
|
||||
syntaxHighlighter = new(YesNtInterpreter.StatementInformation);
|
||||
inputHandler = new InputHandler(this);
|
||||
Console.CancelKeyPress += Console_CancelKeyPress;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ namespace YesNt.CodeEditor
|
||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||
|
||||
string sharedString = (Console.CursorLeft != 0) ? Environment.NewLine : string.Empty;
|
||||
sharedString += e.IsTask ? $"[Task: {e.TaskId}] " : string.Empty + $"[{e.LineNumber}]";
|
||||
sharedString += (e.IsTask ? $"[Task: {e.TaskId}]" : string.Empty) + $"[{e.LineNumber}]";
|
||||
|
||||
if (e.OriginalLine == e.CurrentLine)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ namespace YesNt.CodeEditor
|
||||
switch (EditMode)
|
||||
{
|
||||
case Mode.Debug:
|
||||
yesNtInterpreter.Stop();
|
||||
YesNtInterpreter.Stop();
|
||||
EditMode = Mode.Command;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace YesNt.CodeEditor
|
||||
textEditor.EditMode = Mode.Debug;
|
||||
Console.Clear();
|
||||
Console.CursorVisible = true;
|
||||
textEditor.yesNtInterpreter.Execute(textEditor.CurrentPath);
|
||||
textEditor.YesNtInterpreter.Execute(textEditor.CurrentPath);
|
||||
while (Console.KeyAvailable)
|
||||
{
|
||||
Console.ReadKey(true);
|
||||
@@ -250,7 +250,7 @@ namespace YesNt.CodeEditor
|
||||
textEditor.EditMode = Mode.Debug;
|
||||
Console.Clear();
|
||||
Console.CursorVisible = true;
|
||||
textEditor.yesNtInterpreter.Execute(textEditor.CurrentPath, true);
|
||||
textEditor.YesNtInterpreter.Execute(textEditor.CurrentPath, true);
|
||||
while (Console.KeyAvailable)
|
||||
{
|
||||
Console.ReadKey(true);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\YesNt-Interpreter\YesNt.Interpreter.csproj" />
|
||||
<ProjectReference Include="..\YesNt.Interpreter\YesNt.Interpreter.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user