regex interpreter now can build partial correct AST (i forget groups), but in bad shape. building an optimizer.
This commit is contained in:
@@ -75,7 +75,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
position = i + 1;
|
||||
return new Token<RegexElementLabel>(_source[(pos - 1)..(i - 1)], 0,
|
||||
position,
|
||||
RegexElementLabel.CHAR_SET);
|
||||
RegexElementLabel.UNIT_SET);
|
||||
}
|
||||
}
|
||||
throw new InvalidOperationException("Unclosed character set");
|
||||
@@ -85,7 +85,7 @@ namespace StgSharp.RegularAnalysis.TextRegex
|
||||
return ReadGroupBeginToken();
|
||||
case ')':
|
||||
position = pos + 1;
|
||||
return new Token<RegexElementLabel>(_source[(pos)..1], 0, pos,
|
||||
return new Token<RegexElementLabel>(_source[(pos)..(pos + 1)], 0, pos,
|
||||
RegexElementLabel.GROUP_END);
|
||||
case '{':
|
||||
for (int i = pos + 1; i < _source.Length; i++)
|
||||
|
||||
Reference in New Issue
Block a user