NoMatchExpression
This commit is contained in:
parent
5de3a94a46
commit
1efd50210c
@ -88,6 +88,8 @@ public static class SearchExpressionCompiler
|
||||
remaining = query.Slice(partBeforePointLength + 1);
|
||||
if (part is "*")
|
||||
return new AnyMatchExpression(remaining.IsEmpty ? null : Compile(remaining));
|
||||
if (part is "~")
|
||||
return new NoMatchExpression();
|
||||
|
||||
for (int j = 0; j < part.Length; j++)
|
||||
if (CharEqualsAndNotEscaped('*', part, j))
|
||||
@ -112,6 +114,15 @@ public static class SearchExpressionCompiler
|
||||
}
|
||||
}
|
||||
|
||||
private record NoMatchExpression : ISearchExpression
|
||||
{
|
||||
public bool DoesMatch(SearchArgs args, out ISearchExpression? nextSearchExpression)
|
||||
{
|
||||
nextSearchExpression = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private record MultipleMatchExpression(List<ISearchExpression> subExprs) : ISearchExpression
|
||||
{
|
||||
public bool DoesMatch(SearchArgs args, out ISearchExpression? nextSearchExpression)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user