EP RScript

This commit is contained in:
2025-10-13 19:39:36 +08:00
commit d42726a4dc
12 changed files with 977 additions and 0 deletions

20
Matcher/BreakMatcher.cs Normal file
View File

@@ -0,0 +1,20 @@
using System.Text.RegularExpressions;
namespace Convention.RScript.Matcher
{
public class BreakMatcher : IRSentenceMatcher
{
public bool Match(string expression, ref RScriptSentence sentence)
{
Regex LabelRegex = new(@"break\s*\(\s*(.+)\s*\)");
var LabelMatch = LabelRegex.Match(expression);
if (LabelMatch.Success)
{
sentence.mode = RScriptSentence.Mode.Breakpoint;
sentence.content = LabelMatch.Groups[1].Value;
return true;
}
return false;
}
}
}