add ir emitter
This commit is contained in:
@@ -148,7 +148,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
}
|
||||
throw new InvalidOperationException("Unclosed count specifier");
|
||||
case '*' or '+':
|
||||
int count = _source[pos + 1] == '?' ? 2 : 1;
|
||||
int count = pos + 1 >= _source.Length ? 1 : (_source[pos + 1] == '?' ? 2 : 1);
|
||||
position = pos + count;
|
||||
return new Token<RegexElementLabel>(_source[(pos)..(pos + count)], 0, pos,
|
||||
RegexElementLabel.COUNT);
|
||||
@@ -157,6 +157,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
return new Token<RegexElementLabel>(_source[(pos)..(pos + 1)], 0, pos,
|
||||
RegexElementLabel.COUNT);
|
||||
case '.':
|
||||
position = pos + 1;
|
||||
return new Token<RegexElementLabel>(_source[(pos)..(pos + 1)], 0, pos,
|
||||
RegexElementLabel.UNIT);
|
||||
default:
|
||||
@@ -287,7 +288,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
}
|
||||
|
||||
// Consume "(?<name>"
|
||||
int consumedLen = (i - start) + 1; // include '>'
|
||||
int consumedLen = i - start + 1; // include '>'
|
||||
string text = _source.Substring(start, consumedLen);
|
||||
position = start + consumedLen;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user