search: simplify parser logic
Created by: rvantonder
This is a fairly big restructuring of parser code. Different parts need to move around at the same time to preserve existing functional behavior (integration and unit tests), so it was hard to chop up further.
Summary of changes:
-
Improved regex validation. Previously, if a regex pattern didn't compile, we would always fall through and interpret it as a literal pattern. While that's great in a lot of cases, we really do want to know about a malformed regex and not run something that might return no results. This motivated a bunch of follow-on changes.
-
Removed a big function of some heuristic logic that isn't worth keeping around. After implementing the literal search parser/scanner, I now reuse a simpler approach taken there to address similar issues. This paves the way for a much simpler overall approach to share code for literal<->regex parser (future PRs).