do some source gen work

This commit is contained in:
Youmu Liu
2026-07-15 18:05:38 +08:00
parent 4d2a4eeb18
commit ee7cbd869c
10 changed files with 276 additions and 106 deletions
+9 -4
View File
@@ -21,8 +21,8 @@ namespace StgSharp
{
private static string[] regexSource = [
@"(a|b)(c|d)",
/**/
@"(?<name>123)(?<name>123)",
/*
@"http|https|ftp|ftps",
@"abc[0-9]x|abc[0-9]y|abd[0-9]x|abd[0-9]y|xyz",
@"get_name|get_value|get_type|set_name|set_value|set_type",
@@ -52,11 +52,16 @@ namespace StgSharp
Console.WriteLine(ir[i].AsCommand(i));
}
/**/
/**/
Console.WriteLine("-----Optimized once-----");
List<RegexIR> opt_ir = interpreterSource.IRs;
for (int i = 0; i < opt_ir.Count; i++) {
Console.WriteLine(opt_ir[i].AsCommand(i));
if (opt_ir is not null)
{
for (int i = 0; i < opt_ir.Count; i++) {
Console.WriteLine(opt_ir[i].AsCommand(i));
}
}
/**/
Console.WriteLine(interpreterSource.AnalyseException?.ToString() ?? "No error");
RegexInfo info = interpreterSource.Info;
Console.WriteLine("-----Regex Info-----");