Skip to content

Commit 8410d03

Browse files
Fixed Errors made when refining code
1 parent d01871a commit 8410d03

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

EZCode/Interpreter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public int Interperate(LineWithTokens[] LineTokens)
139139
{
140140
line.Tokens[i].Value = GetValue(line.Tokens[i].Value, var.DataType);
141141
line.Tokens[i].StringValue = line.Tokens[i].Value is string or int or float or bool ? line.Tokens[i].Value.ToString() : line.Tokens[i].StringValue;
142-
line.Tokens[i].Type = parser.SingleToken([line.Tokens[i].StringValue == line.Tokens[i].Value.ToString() ? line.Tokens[i].StringValue : line.Tokens[i].Value], 0, line.Tokens[i].StringValue, out _).Type;
142+
line.Tokens[i].Type = parser.SingleToken([line.Tokens[i].StringValue == line.Tokens[i].Value.ToString() ? line.Tokens[i].StringValue : line.Tokens[i].Value], 0, line.Tokens[i].StringValue).Type;
143143
}
144144
Method[] backupMethods = Methods;
145145
Methods = c.Methods.Concat(Methods.Where(x => (x.Settings & Method.MethodSettings.Global) == Method.MethodSettings.Global)).ToArray();

EZCode/Parser.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ private LineWithTokens[] TokenArray(string code, bool insideClass = false)
445445
// The LineWithTokens list that gets returned
446446
List<LineWithTokens> lineWithTokens = new List<LineWithTokens>();
447447
// Splits the code into lines
448-
Line[] Lines = SplitLine(Code);
448+
Line[] Lines = SplitLine(code);
449449

450450
// loops through each line
451451
for (int i = 0; i < Lines.Length; i++)
@@ -473,7 +473,7 @@ private LineWithTokens[] TokenArray(string code, bool insideClass = false)
473473
Token token = SingleToken(parts, j, stringParts.Length > j ? stringParts[j] : "");
474474

475475
// if the token is a comment or invalid, don't append the token to 'tokens'
476-
if (token.Type != TokenType.None || token.Type != TokenType.Comment) continue;
476+
if (token.Type == TokenType.None || token.Type == TokenType.Comment) continue;
477477
tokens.Add(token);
478478
}
479479
arrow_input_index = arrow_output_index; // sets the arrow input to the arrow output
@@ -1566,7 +1566,8 @@ private static Line[] SplitLine(string code)
15661566
Line[] lines = Array.Empty<Line>();
15671567

15681568
int index = 0; // index of loop
1569-
string[] string_lines = code.Split('\n').Select(s => s.Trim()).ToArray(); // splits code by each line
1569+
string[] string_lines = code.Split('\n');
1570+
string_lines = string_lines.Select(s => s.Trim()).ToArray(); // splits code by each line
15701571
foreach (var item in string_lines)
15711572
{
15721573
// Append line to the array, 'lines'

0 commit comments

Comments
 (0)