meet difficult problem on COUNT node

This commit is contained in:
Youmu Liu
2026-09-11 17:29:42 +08:00
parent f372f83171
commit 5a3286dc21
4 changed files with 188 additions and 70 deletions
+12 -21
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// file="TestRegexGenerate"
// Project: Nitload
// Project: StgSharp
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
@@ -16,29 +16,19 @@ namespace Nitload
{
internal static class TestRegexGenerate
{
public static int Run(params string[] args)
{
if (args.Length > 1) {
throw new ArgumentException("Expected at most one regex pattern.", nameof(args));
}
if (args.Length == 1)
{
Print(args[0]);
return 0;
}
while (true)
{
Console.Write("regex> ");
string? pattern = Console.ReadLine();
if (pattern is null or ":exit") {
return 0;
}
Print(pattern);
}
public static int Run(
string arg
)
{
Console.WriteLine($"Text regex to be tested: {arg} :\n\n\n");
Print(arg);
return 0;
}
private static void Print(string pattern)
private static void Print(
string pattern
)
{
TextRegexSource analysis = RegexAnalyzer.Analyze(pattern);
if (analysis.AnalyseException is not null) {
@@ -61,5 +51,6 @@ namespace Nitload
}
}
}
}
}