EP RScript 修复因跳跃导致的变量层次混乱
This commit is contained in:
@@ -6,11 +6,11 @@ namespace Convention.RScript.Matcher
|
||||
{
|
||||
public bool Match(string expression, ref RScriptSentence sentence)
|
||||
{
|
||||
Regex LabelRegex = new(@"^back\s*\(\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)$");
|
||||
Regex LabelRegex = new(@"back\s*\(\s*(.+)\s*\)");
|
||||
var LabelMatch = LabelRegex.Match(expression);
|
||||
if (LabelMatch.Success)
|
||||
{
|
||||
sentence.mode = RScriptSentence.Mode.Label;
|
||||
sentence.mode = RScriptSentence.Mode.Backpoint;
|
||||
sentence.content = LabelMatch.Groups[1].Value;
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,11 +6,11 @@ namespace Convention.RScript.Matcher
|
||||
{
|
||||
public bool Match(string expression, ref RScriptSentence sentence)
|
||||
{
|
||||
Regex LabelRegex = new(@"^break\(\s*(.+)\s*\)$");
|
||||
Regex LabelRegex = new(@"break\s*\(\s*(.+)\s*\)");
|
||||
var LabelMatch = LabelRegex.Match(expression);
|
||||
if (LabelMatch.Success)
|
||||
{
|
||||
sentence.mode = RScriptSentence.Mode.Label;
|
||||
sentence.mode = RScriptSentence.Mode.Breakpoint;
|
||||
sentence.content = LabelMatch.Groups[1].Value;
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ namespace Convention.RScript.Matcher
|
||||
{
|
||||
public bool Match(string expression, ref RScriptSentence sentence)
|
||||
{
|
||||
Regex DefineVariableRegex = new(@"^(string|int|double|float|bool|var)\s+([a-zA-Z_][a-zA-Z0-9_]*)$");
|
||||
Regex DefineVariableRegex = new(@"(string|int|double|float|bool|var)\s+([a-zA-Z_][a-zA-Z0-9_]*)");
|
||||
var DefineVariableMatch = DefineVariableRegex.Match(expression);
|
||||
if (DefineVariableMatch.Success)
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@ namespace Convention.RScript.Matcher
|
||||
public bool Match(string expression, ref RScriptSentence sentence)
|
||||
{
|
||||
|
||||
Regex GotoRegex = new(@"^goto\s*\(\s*(.+)\s*,\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)$");
|
||||
Regex GotoRegex = new(@"goto\s*\(\s*(.+)\s*,\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)");
|
||||
var GotoMatch = GotoRegex.Match(expression);
|
||||
if (GotoMatch.Success)
|
||||
{
|
||||
|
@@ -6,7 +6,7 @@ namespace Convention.RScript.Matcher
|
||||
{
|
||||
public bool Match(string expression, ref RScriptSentence sentence)
|
||||
{
|
||||
Regex LabelRegex = new(@"^label\s*\(\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)$");
|
||||
Regex LabelRegex = new(@"label\s*\(\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)");
|
||||
var LabelMatch = LabelRegex.Match(expression);
|
||||
if (LabelMatch.Success)
|
||||
{
|
||||
|
Reference in New Issue
Block a user