fix errors in interpreter. add a enumerator for tree. working on tree optimizer

This commit is contained in:
Youmu Liu
2026-02-09 18:08:49 +08:00
parent 909bf50b9d
commit 807658111c
10 changed files with 288 additions and 106 deletions
@@ -73,7 +73,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
{
int length = (i - pos - 1);
position = i + 1;
return new Token<RegexElementLabel>(_source[(pos - 1)..(i - 1)], 0,
return new Token<RegexElementLabel>(_source[(pos)..(i + 1)], 0,
position,
RegexElementLabel.UNIT_SET);
}
@@ -93,7 +93,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
if (_source[i] == '}')
{
position = i + 1;
return new Token<RegexElementLabel>(_source[(pos)..(i - 1)], 0, pos,
return new Token<RegexElementLabel>(_source[(pos)..(i + 1)], 0, pos,
RegexElementLabel.COUNT);
}
}