SearchValues<T> in .NET 8
Thanks for your awesome library!
Not sure if the SearchValues<T> is applicable for Pidgin, but it certainly sounds like a good fit.
Also, see this this great blog post where the author tries out this new feature.
I'll need to think about this. It seems SearchValues is designed with string- or array-searching in mind. In general we don't have the full text available when parsing (it's streamed) so it may not be a good fit. Besides, recursive descent parsing is generally about matching the current token, not searching for a specific substring.
However I can envision a use case like "search forward in the stream using SearchValues and begin parsing from there". At present you need to wind forward token by token to find a match so perhaps there's hay to be made by vectorising that search. The partial data issue is a problem there though (when doing substring matching and not single-token matching).
Makes sense. I mostly thought of AnyCharExcept() when I stumbled upon that SearchValues feature.