regex ir opt code rewrite gen2, window scanning
This commit is contained in:
@@ -36,6 +36,15 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.RegularAnalysis.Abstraction
|
||||
{
|
||||
public interface ITrinitySyntaxNode<TNode, TLabel> : ISyntaxNode<TNode, TLabel>
|
||||
where TNode : ISyntaxNode<TNode, TLabel>
|
||||
where TLabel : unmanaged
|
||||
{
|
||||
|
||||
TNode Third { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public interface ISyntaxNode<TNode, TLabel> where TNode : ISyntaxNode<TNode, TLabel>
|
||||
where TLabel : unmanaged
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace StgSharp.RegularAnalysis.Text
|
||||
break;
|
||||
}
|
||||
|
||||
if (TryFlatternCount(opt_win_sp, opt_ir)) { }
|
||||
if (TryFlattenCount(opt_win_sp, opt_ir)) { }
|
||||
} while (false);
|
||||
|
||||
index += process_count;
|
||||
@@ -150,7 +150,7 @@ namespace StgSharp.RegularAnalysis.Text
|
||||
|
||||
#endregion
|
||||
|
||||
private static bool TryFlatternCount(
|
||||
private static bool TryFlattenCount(
|
||||
Span<RegexIR> window,
|
||||
List<RegexIR> opt
|
||||
)
|
||||
|
||||
@@ -66,3 +66,7 @@ COUNT_SEQ(a,0,+inf,greedy)
|
||||
5. a{m,n}特征,展开为
|
||||
MATCH_SEQ(aa...m个a....aa)
|
||||
COUNT_SEQ(a,0,n,greedy)
|
||||
|
||||
6. .*?a*$
|
||||
|
||||
7. 对于一般的.*?,应该将后续的所有东西全都放进一个巨大的try,code gen时使用最慢的一位一位offset直到直到第一个匹配rest的东西
|
||||
Reference in New Issue
Block a user