mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 11:32:51 -05:00
More nrex fixes
This commit is contained in:
parent
732bfd0baf
commit
d9f1a85948
1 changed files with 16 additions and 8 deletions
|
@ -246,7 +246,18 @@ struct nrex_node_group : public nrex_node
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if ((res >= 0) != negate)
|
if (negate)
|
||||||
|
{
|
||||||
|
if (res < 0)
|
||||||
|
{
|
||||||
|
res = pos + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res >= 0)
|
||||||
{
|
{
|
||||||
if (capturing >= 0)
|
if (capturing >= 0)
|
||||||
{
|
{
|
||||||
|
@ -479,7 +490,6 @@ struct nrex_node_quantifier : public nrex_node
|
||||||
{
|
{
|
||||||
nrex_array<int> backtrack;
|
nrex_array<int> backtrack;
|
||||||
backtrack.push(pos);
|
backtrack.push(pos);
|
||||||
s->complete = false;
|
|
||||||
while (backtrack.top() <= s->end)
|
while (backtrack.top() <= s->end)
|
||||||
{
|
{
|
||||||
if (max >= 1 && backtrack.size() > (unsigned int)max)
|
if (max >= 1 && backtrack.size() > (unsigned int)max)
|
||||||
|
@ -502,7 +512,6 @@ struct nrex_node_quantifier : public nrex_node
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s->complete = false;
|
|
||||||
int res = child->test(s, backtrack.top());
|
int res = child->test(s, backtrack.top());
|
||||||
if (s->complete)
|
if (s->complete)
|
||||||
{
|
{
|
||||||
|
@ -516,12 +525,7 @@ struct nrex_node_quantifier : public nrex_node
|
||||||
}
|
}
|
||||||
while (greedy && (unsigned int) min < backtrack.size())
|
while (greedy && (unsigned int) min < backtrack.size())
|
||||||
{
|
{
|
||||||
s->complete = false;
|
|
||||||
int res = backtrack.top();
|
int res = backtrack.top();
|
||||||
if (s->complete)
|
|
||||||
{
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
if (next)
|
if (next)
|
||||||
{
|
{
|
||||||
res = next->test(s, res);
|
res = next->test(s, res);
|
||||||
|
@ -530,6 +534,10 @@ struct nrex_node_quantifier : public nrex_node
|
||||||
{
|
{
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
if (s->complete)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
backtrack.pop();
|
backtrack.pop();
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue