before merge
This commit is contained in:
@@ -35,7 +35,7 @@ using System.Text;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.RegularAnalysis.TextRegex
|
||||
namespace StgSharp.RegularAnalysis.Text
|
||||
{
|
||||
public partial class RegexInterpreter
|
||||
{
|
||||
@@ -58,9 +58,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
}
|
||||
}
|
||||
|
||||
public static RegexInterpreter Analyze(
|
||||
string regex
|
||||
)
|
||||
public static RegexInterpreter Analyze(string regex)
|
||||
{
|
||||
RegexInterpreter interpreter = new();
|
||||
interpreter._source = regex;
|
||||
@@ -222,14 +220,11 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
// TODO enum AST again , do ALT tail merge and simple ALT front merge
|
||||
}
|
||||
|
||||
private void ProcessOperator(
|
||||
RegexAstNode op
|
||||
)
|
||||
private void ProcessOperator(RegexAstNode op)
|
||||
{
|
||||
if (op.EqualityTypeConvert == RegexElementLabel.CONCAT)
|
||||
{
|
||||
if (_stack.TryPopOperand(out RegexAstNode? _1) &&
|
||||
_stack.TryPopOperand(out RegexAstNode? _2))
|
||||
if (_stack.TryPopOperand(out RegexAstNode? _1) && _stack.TryPopOperand(out RegexAstNode? _2))
|
||||
{
|
||||
op.Left = _2;
|
||||
op.Right = _1;
|
||||
@@ -255,8 +250,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
}
|
||||
} else if (op.EqualityTypeConvert == RegexElementLabel.ALT)
|
||||
{
|
||||
if (_stack.TryPopOperand(out RegexAstNode? _1) &&
|
||||
_stack.TryPopOperand(out RegexAstNode? _2))
|
||||
if (_stack.TryPopOperand(out RegexAstNode? _1) && _stack.TryPopOperand(out RegexAstNode? _2))
|
||||
{
|
||||
op.Left = _2;
|
||||
op.Right = _1;
|
||||
|
||||
Reference in New Issue
Block a user