Fixed an issue with the Runner not showing the correct label of the block being processed.

This commit is contained in:
ruri
2019-05-10 07:34:32 +02:00
parent c83cf8ec2b
commit d4ba3ec187
2 changed files with 24 additions and 3 deletions
+21
View File
@@ -75,6 +75,27 @@ namespace RuriLib.LS
/// <summary>The current line being processed.</summary>
public string CurrentLine { get; set; } = "";
/// <summary>The next block to be processed. Empty if the script has no more blocks to execute.</summary>
public string NextBlock
{
get
{
for (int j = i; j < lines.Count(); j++)
{
var line = lines[j];
if (IsEmptyOrCommentOrDisabled(line) || !BlockParser.IsBlock(line)) continue;
var label = "";
if (lines[j].StartsWith("#")) label = LineParser.ParseLabel(ref line);
var blockName = LineParser.ParseToken(ref line, TokenType.Parameter, false, false);
if (label != "") return $"{blockName} ({label})";
else return blockName;
}
return "";
}
}
/// <summary>The current block being processed.</summary>
public string CurrentBlock { get; set; } = "";