mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-06 23:42:55 +02:00
- Fix code editor resize problems
- Fix crash when using `get` our `out` multiple times with the same variable name - Show the name of the file in which the error occured
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
using YesNt.Interpreter.Attributes;
|
||||
using YesNt.Interpreter.Enums;
|
||||
using YesNt.Interpreter.Runtime;
|
||||
using YesNt.Interpreter.Utilities;
|
||||
|
||||
namespace YesNt.Interpreter.Statements
|
||||
@@ -41,8 +42,9 @@ namespace YesNt.Interpreter.Statements
|
||||
public void RunTask(string line)
|
||||
{
|
||||
int lineNumer = RuntimeInfo.LineNumber;
|
||||
List<string> lines = RuntimeInfo.Lines.GetRange(0, RuntimeInfo.Lines.Count);
|
||||
lines[lineNumer] = line;
|
||||
List<Line> lines = RuntimeInfo.Lines.GetRange(0, RuntimeInfo.Lines.Count);
|
||||
|
||||
lines[lineNumer].Content = line;
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
YesNtInterpreter interpreter = new YesNtInterpreter();
|
||||
@@ -73,7 +75,12 @@ namespace YesNt.Interpreter.Statements
|
||||
try
|
||||
{
|
||||
RuntimeInfo.Lines.RemoveAt(0);
|
||||
RuntimeInfo.Lines.InsertRange(RuntimeInfo.LineNumber, File.ReadAllLines(path));
|
||||
string[] lines = File.ReadAllLines(path);
|
||||
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
RuntimeInfo.Lines.Add(new Line(lines[i], Path.GetFileName(path), i));
|
||||
}
|
||||
RuntimeInfo.LineNumber--;
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user