mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 09:06:41 +02:00
Remove manual variable declaration highlighting from SyntaxHighlighter and add color to VariableStatements
This commit is contained in:
@@ -111,18 +111,6 @@ internal partial class SyntaxHighlighter(ReadOnlyCollection<StatementInformation
|
||||
{
|
||||
input = AddColorInformation(input, matches[i].Value, ConsoleColor.Cyan, SearchMode.Contains);
|
||||
}
|
||||
|
||||
matches = VariableDeclarationRegex().Matches(input);
|
||||
for (int i = 0; i < matches.Count; i++)
|
||||
{
|
||||
input = AddColorInformation(input, matches[i].Value, ConsoleColor.DarkCyan, SearchMode.StartOfLine);
|
||||
}
|
||||
|
||||
matches = GlobalVariableDeclarationRegex().Matches(input);
|
||||
for (int i = 0; i < matches.Count; i++)
|
||||
{
|
||||
input = AddColorInformation(input, matches[i].Value, ConsoleColor.Blue, SearchMode.StartOfLine);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string part in input.Split("\0"))
|
||||
@@ -167,12 +155,6 @@ internal partial class SyntaxHighlighter(ReadOnlyCollection<StatementInformation
|
||||
return result;
|
||||
}
|
||||
|
||||
[GeneratedRegex("^let\\s+[a-zA-Z0-9]+")]
|
||||
private static partial Regex VariableDeclarationRegex();
|
||||
|
||||
[GeneratedRegex("^global\\s+[a-zA-Z0-9]+")]
|
||||
private static partial Regex GlobalVariableDeclarationRegex();
|
||||
|
||||
[GeneratedRegex("\\$\\{[a-zA-Z0-9]+\\}")]
|
||||
private static partial Regex VariableRegex();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace YesNt.Interpreter.Statements;
|
||||
|
||||
internal partial class VariableStatements : StatementRuntimeInformation
|
||||
{
|
||||
[Statement("let", SearchMode.StartOfLine, SpaceAround.End, Priority = Priority.VeryLow)]
|
||||
[Statement("let", SearchMode.StartOfLine, SpaceAround.End, System.ConsoleColor.DarkBlue, Priority = Priority.VeryLow, Separator = "=")]
|
||||
public void DefineVariable(string args)
|
||||
{
|
||||
string[] parts = args.Split('=');
|
||||
@@ -35,7 +35,7 @@ internal partial class VariableStatements : StatementRuntimeInformation
|
||||
}
|
||||
}
|
||||
|
||||
[Statement("global", SearchMode.StartOfLine, SpaceAround.End, Priority = Priority.VeryLow)]
|
||||
[Statement("global", SearchMode.StartOfLine, SpaceAround.End, System.ConsoleColor.DarkBlue, Priority = Priority.VeryLow, Separator = "=")]
|
||||
public void DefineGlobalVariable(string args)
|
||||
{
|
||||
string[] parts = args.Split('=');
|
||||
|
||||
Reference in New Issue
Block a user