refactored SearchExpression

This commit is contained in:
2026-09-15 13:18:09 +02:00
parent 1d53f6930a
commit 5b1b8f4ce5
21 changed files with 509 additions and 216 deletions
@@ -0,0 +1,19 @@
namespace ParadoxSaveParser.Lib;
/// <summary>"[7]" — matches the node at one position.</summary>
internal sealed class IndexMatchExpression(int index, ISearchExpression? next) : ISearchExpression
{
public bool DoesMatch(MatchCandidate candidate, out ISearchExpression? nextSearchExpression)
{
if (candidate.Index == index)
{
nextSearchExpression = next;
return true;
}
nextSearchExpression = null;
return false;
}
public void ReEncode(Encoding encoding) => next?.ReEncode(encoding);
}