refactored SearchExpression
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
namespace ParadoxSaveParser.Lib;
|
||||
|
||||
/// <summary>"~" — matches nothing, so the branch is skipped.</summary>
|
||||
internal sealed class NoMatchExpression : ISearchExpression
|
||||
{
|
||||
// stateless, so one instance serves every "~" in every query
|
||||
public static readonly NoMatchExpression Instance = new();
|
||||
|
||||
private NoMatchExpression()
|
||||
{
|
||||
}
|
||||
|
||||
public bool DoesMatch(MatchCandidate candidate, out ISearchExpression? nextSearchExpression)
|
||||
{
|
||||
nextSearchExpression = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
// no keys and no children, and shared between queries, so nothing may be stored here
|
||||
public void ReEncode(Encoding encoding)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user