add generator if ''UNIT''s in regex
This commit is contained in:
@@ -35,7 +35,7 @@ namespace StgSharp
|
||||
{
|
||||
foreach (string regex in regexSource)
|
||||
{
|
||||
TextRegexSource interpreterSource = RegexAnalyzer.Analyze(regex, true, true);
|
||||
TextRegexSource interpreterSource = RegexAnalyzer.Analyze(regex);
|
||||
AbstractSyntaxTree<RegexAstNode, RegexElementLabel> tree = interpreterSource.Ast;
|
||||
Console.WriteLine($"result of \"{regex}\"");
|
||||
TreeEnumerator<RegexAstNode, RegexElementLabel> enumerator = new(tree);
|
||||
@@ -43,25 +43,8 @@ namespace StgSharp
|
||||
{
|
||||
RegexAstNode node = enumerator.Current;
|
||||
Console.Write(new string('|', enumerator.Depth));
|
||||
Console.WriteLine($"\t{node.Source.Value}\t{node.Source.Flag}");
|
||||
Console.WriteLine($"\t{node.Value}\t{node.Source.Flag}");
|
||||
}
|
||||
/*
|
||||
Console.WriteLine("-----IR-----");
|
||||
List<RegexIR> ir = interpreterSource.BaseIR;
|
||||
for (int i = 0; i < ir.Count; i++) {
|
||||
Console.WriteLine(ir[i].AsCommand(i));
|
||||
}
|
||||
/**/
|
||||
/**/
|
||||
Console.WriteLine("-----Optimized once-----");
|
||||
List<RegexIR> opt_ir = interpreterSource.IRs;
|
||||
if (opt_ir is not null)
|
||||
{
|
||||
for (int i = 0; i < opt_ir.Count; i++) {
|
||||
Console.WriteLine(opt_ir[i].AsCommand(i));
|
||||
}
|
||||
}
|
||||
/**/
|
||||
Console.WriteLine(interpreterSource.AnalyseException?.ToString() ?? "No error");
|
||||
RegexInfo info = interpreterSource.Info;
|
||||
Console.WriteLine("-----Regex Info-----");
|
||||
|
||||
Reference in New Issue
Block a user