meet difficult problem on COUNT node
This commit is contained in:
@@ -24,17 +24,8 @@ namespace Nitload
|
||||
|
||||
private static string testExpPath = @"D:\Programmer\stepcode\data\ap203\ap203.exp";
|
||||
|
||||
internal static unsafe void Main(
|
||||
string[] args
|
||||
)
|
||||
internal static unsafe void Main()
|
||||
{
|
||||
// Select the managed-only emitter preview before initializing the normal runtime.
|
||||
if (args.Length > 0 && args[0] == "--regex-preview")
|
||||
{
|
||||
Environment.ExitCode = TestRegexGenerate.Run(args[1..]);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
World.Initialize(new()
|
||||
@@ -47,7 +38,7 @@ namespace Nitload
|
||||
.InitializeModule();
|
||||
|
||||
// TestRegexAnalyse.Run();
|
||||
_ = TestRegexGenerate.Run("abc|123");
|
||||
_ = TestRegexGenerate.Run("abc1{1,2}23");
|
||||
|
||||
// TestHlsf();
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user