import ast sys for regex runtime build
This commit is contained in:
@@ -36,9 +36,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.RegularAnalysis
|
||||
{
|
||||
internal class RegularBranchNode : RegularStateNode
|
||||
internal sealed class RegularBranchNode : RegularStateNode
|
||||
{
|
||||
|
||||
private int _afterBranch;
|
||||
|
||||
private int _lastBranch;
|
||||
|
||||
private List<BranchMeasureResult> _result;
|
||||
@@ -59,15 +61,26 @@ namespace StgSharp.RegularAnalysis
|
||||
out int label
|
||||
)
|
||||
{
|
||||
int pos = context.LastBranch.Peek();
|
||||
if (AvailableNodes.Length > _lastBranch)
|
||||
if (context.StateCode == 0)
|
||||
{
|
||||
// return measure result
|
||||
label = 0;
|
||||
// branch match
|
||||
label = _afterBranch;
|
||||
_ = context.LastBranch.Pop();
|
||||
_lastBranch = 0;
|
||||
return true;
|
||||
}
|
||||
label = FailNodeIndex;
|
||||
return false;
|
||||
|
||||
// restore sequence position
|
||||
int pos = context.LastBranch.Peek();
|
||||
context.Position = pos;
|
||||
if (AvailableNodes.Length > _lastBranch)
|
||||
{
|
||||
label = FailNodeIndex;
|
||||
return false;
|
||||
}
|
||||
_lastBranch++;
|
||||
label = AvailableNodes[_lastBranch];
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user