From 359dd6728716c1c0014d64b72ba70c6c65bb8cf8 Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:07:16 +0800 Subject: [PATCH] regex ir opt code rewrite gen2, window scanning --- StgSharp.RegularAnalysis/Text/RegexIR.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/StgSharp.RegularAnalysis/Text/RegexIR.cs b/StgSharp.RegularAnalysis/Text/RegexIR.cs index 0b1fc8f4..6a28274f 100644 --- a/StgSharp.RegularAnalysis/Text/RegexIR.cs +++ b/StgSharp.RegularAnalysis/Text/RegexIR.cs @@ -47,6 +47,8 @@ namespace StgSharp.RegularAnalysis.Text Pop = 1 << 7, Pack = 1 << 8, Find_Seq = 1 << 9, + Find_Set = 1 << 10, + Find_Complex = 1 << 11, Match = Match_Seq | Match_Set, Count = Count_Seq | Count_Set | Count_Complex, @@ -68,6 +70,27 @@ namespace StgSharp.RegularAnalysis.Text } + internal sealed class RegexFindComplexIR( + bool nearest, + int count + ) : RegexIR + { + + internal override RegexIRCommand Command => RegexIRCommand.Find_Complex; + + private bool IsNearest { get; } = nearest; + + private int CommandCount { get; } = count; + + internal override string AsCommand( + int lineNum + ) + { + return $"[{lineNum}]\t FIND_COMPLEX {(IsNearest ? "NEAREST" : "FURTHEST")} COUNT: {CommandCount}"; + } + + } + internal abstract class RegexIR {