mainly theoratical work

This commit is contained in:
Youmu Liu
2026-07-21 18:02:46 +08:00
parent a698c47a1c
commit c82a758d97
4 changed files with 162 additions and 22 deletions
@@ -24,7 +24,7 @@ namespace StgSharp.RegularAnalysis.Text
internal partial class TextRegexSourceGen
{
private const string current_ptr = "current_ptr";
private const string current_ptr = "cur_ptr_global";
private const string offset = "offset";
private const string orig_text = "text";
@@ -39,12 +39,10 @@ namespace StgSharp.RegularAnalysis.Text
RegexInfo info = source.Info;
List<RegexIR> ir = source.IRs;
ReadOnlySpan<RegexIR> ir_sp = CollectionsMarshal.AsSpan(ir);
RegexIR[] window = new RegexIR[8];
Span<RegexIR> scan_win = window;
SequenceEmitter<string> match_e = new();
int index = 0;
int end = FindRrgionEnd(ir_sp, index);
int end = FindRegionEnd(ir_sp, index);
ReadOnlySpan<RegexIR> region = ir_sp[0..end];
while (true)
@@ -55,7 +53,7 @@ namespace StgSharp.RegularAnalysis.Text
break;
}
index = end;
end = FindRrgionEnd(ir_sp, end);
end = FindRegionEnd(ir_sp, end);
region = ir_sp[index..end];
}
@@ -90,7 +88,7 @@ namespace StgSharp.RegularAnalysis.Text
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static int FindRrgionEnd(
private static int FindRegionEnd(
ReadOnlySpan<RegexIR> ir_sp,
int current
)