ngra string regex use ir as jit engine as well

This commit is contained in:
Youmu Liu
2026-06-15 18:08:14 +08:00
parent 2741b34583
commit 861b50575a
23 changed files with 352 additions and 795 deletions
+6 -4
View File
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="TestRegexAnalyse"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -42,7 +42,9 @@ namespace StgSharp
@"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",
@"helix|hello|help|hero|hers|her" ];
@"helix|hello|help|hero|hers|her",
@"http|https|ftp|ftps"
];
public static void Run()
{
@@ -51,7 +53,7 @@ namespace StgSharp
RegexInterpreter interpreter = RegexInterpreter.Analyze(regex);
AbstractSyntaxTree<RegexAstNode, RegexElementLabel> tree = interpreter.Tree;
Console.WriteLine($"result of \"{regex}\"");
TreeEnumerator<RegexAstNode, RegexElementLabel> enumerator = new TreeEnumerator<RegexAstNode, RegexElementLabel>(tree);
TreeEnumerator<RegexAstNode, RegexElementLabel> enumerator = new(tree);
while (enumerator.MoveNext())
{
RegexAstNode node = enumerator.Current;