mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-08 07:56:06 +02:00
Code structure and speed imporvments
This commit is contained in:
@@ -9,6 +9,8 @@ namespace YesNt.Interpreter.Statements
|
||||
{
|
||||
internal class VariableStatements : StatementRuntimeInformation
|
||||
{
|
||||
private static readonly Regex variableStatementRegex = new Regex(@">[a-zA-Z0-9]+");
|
||||
|
||||
[Statement("<", SearchMode.StartOfLine, SpaceAround.None, Priority = Priority.VeryLow)]
|
||||
public void DefineVariable(string args)
|
||||
{
|
||||
@@ -105,7 +107,7 @@ namespace YesNt.Interpreter.Statements
|
||||
return;
|
||||
}
|
||||
|
||||
MatchCollection matches = Regex.Matches(RuntimeInfo.CurrentLine, @">[a-zA-Z0-9]+");
|
||||
MatchCollection matches = variableStatementRegex.Matches(RuntimeInfo.CurrentLine);
|
||||
|
||||
for (int i = 0; i < matches.Count; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user