stop all work on text regex, ngra text regex is now frozen

This commit is contained in:
Youmu Liu
2026-09-15 18:06:52 +08:00
parent 57587bec16
commit e04adf594a
33 changed files with 1008 additions and 49 deletions
+18 -26
View File
@@ -16,36 +16,28 @@ Run the active debug harness directly when investigating a subsystem:
dotnet run --project test/StgSharpDebug/StgSharpDebug.csproj
```
## NGRA generation preview
## Archived Text Regex diagnostics
`StgSharpDebug/TestRegexGenerate.cs` contains a standalone debugging routine that calls the
existing NGRA emitter without Roslyn attribute binding. Select it from the debug `Main`:
The Text Regex analyzer and source-generator preview are frozen. Their original source files
are retained under [StgSharpDebug/Legacy/TextRegex](StgSharpDebug/Legacy/TextRegex) and excluded
from compilation, packaging, and build/publish copying. `Main` no longer calls them, and
`--regex-preview` is not an active entry point.
```powershell
dotnet run --project test/StgSharpDebug/StgSharpDebug.csproj -- --regex-preview
```
The corresponding runtime, text-specific AST/parser, and generator are archived under
[src/Nitload.RegularAnalysis/Legacy](../src/Nitload.RegularAnalysis/Legacy/README.md).
Generic AST and token infrastructure remain active. See the
[NGRA transformation plan](../future/NGRA_Transformation_Plan.md) for the new NFA direction.
This branch returns before `World` or native-memory initialization. Without the switch, the
existing debug flow is unchanged. You can also call `TestRegexGenerate.Run()` directly from
`Main` while debugging; pass a pattern to `Run("abc")` for a single preview.
The switch only selects runtime behavior; building the debug project still builds its normal
project references, including Graphics and Mathematics, and prepares the native library with
CMake. `BuildNativeBeforeManaged` defaults to true; Debug selects `clang-debug`, and other
configurations select `clang-release`. `RequireNativeLibrary` reports a missing DLL at build
time instead of allowing the default runtime path to fail later.
## Native builds
For managed-only preview work without a native toolchain or DLL, add
`-p:BuildNativeBeforeManaged=false -p:RequireNativeLibrary=false` before `--` in the run command.
Building the debug project still builds its normal project references, including Graphics and
Mathematics, and prepares the native library with CMake. `BuildNativeBeforeManaged` defaults
to true; Debug selects `clang-debug`, and other configurations select `clang-release`.
`RequireNativeLibrary` reports a missing DLL at build time instead of allowing execution to
fail later.
Enter raw regular expressions without C# string delimiters. The routine prints only the emitted
code, without status headers or file output. Exceptions propagate directly to the caller/debugger.
Use `:exit` or end-of-input to leave the loop. Empty input is an empty regex. For one-shot mode:
```powershell
dotnet run --project test/StgSharpDebug/StgSharpDebug.csproj -- --regex-preview 'a{2,3}'
```
Set breakpoints in `TestRegexGenerate.cs` or any existing `Generate*` method. The output is a
method-body fragment; this routine does not compile or execute it.
For a managed-only build without a native toolchain or DLL, pass
`-p:BuildNativeBeforeManaged=false -p:RequireNativeLibrary=false`.
This does not make debug routines that use native services runnable without the native library.
New repeatable tests should use a test project and avoid machine-specific paths, external mutable data, and dependencies on previous test execution. Keep one-off investigations in `SingleFile` or the manual debug harness until their expected behavior is stable enough for automation.