mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 09:06:41 +02:00
Add more statements and bug fixes
- Add `Execute(List<string>...` method to interpreter - Add escape sequence (`!!`) - Fix `Evaluator.Calulate` method not correctly handling `-` and `+` prefixes
This commit is contained in:
@@ -61,7 +61,7 @@ namespace YesNt.CodeEditor
|
||||
if (SizeChanged())
|
||||
{
|
||||
drawAll = true;
|
||||
inputHandler.WriteStatus(string.Empty);
|
||||
InputHandler.WriteStatus(string.Empty);
|
||||
}
|
||||
|
||||
if (LineOffset < 0 || CursorPosition.Y < 0 || CursorPosition.Y < 0)
|
||||
@@ -111,14 +111,14 @@ namespace YesNt.CodeEditor
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
inputHandler.WriteStatus("File does not exist!");
|
||||
InputHandler.WriteStatus("File does not exist!");
|
||||
return false;
|
||||
}
|
||||
|
||||
Lines.Clear();
|
||||
Lines.AddRange(File.ReadAllLines(path));
|
||||
CurrentPath = path;
|
||||
inputHandler.WriteStatus("File Loaded!");
|
||||
InputHandler.WriteStatus("File Loaded!");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -152,12 +152,12 @@ namespace YesNt.CodeEditor
|
||||
}
|
||||
else if (input.Split(' ').Length > 2)
|
||||
{
|
||||
inputHandler.WriteStatus("Invalid arguments!");
|
||||
InputHandler.WriteStatus("Invalid arguments!");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputHandler.WriteStatus("File path is empty! (Save the file before you can use this command)");
|
||||
InputHandler.WriteStatus("File path is empty! (Save the file before you can use this command)");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -174,12 +174,12 @@ namespace YesNt.CodeEditor
|
||||
try
|
||||
{
|
||||
File.WriteAllLines(path, Lines);
|
||||
inputHandler.WriteStatus("File Saved!");
|
||||
InputHandler.WriteStatus("File Saved!");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
inputHandler.WriteStatus(ex.Message);
|
||||
InputHandler.WriteStatus(ex.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user