search: robust keyword scanning
Created by: rvantonder
This PR:
- fixes a bug where we don't always ensure spaces before/after a keyword that requires it (currently
and
andor
)
I'm introducing a helper function to do lookahead and lookbehind for keywords. The lookbehind is avoidable, but a more involved change, so I will address this later (filed in #9812).
- the fix also makes keyword scanning more robust, so that queries like
or or or
also works - fixes a bug where parsing would fail if the query only contained whitespace