search: add new concat behavior for literal and regexp patterns
Created by: rvantonder
Stacked on https://github.com/sourcegraph/sourcegraph/pull/37802
We need to implement a different Concat processor for standard queries (i.e,. patterntype:standard
) see RFC 675.
Currently, literal patterns are concatted with space. regexp patterns are concatted with .*. Now, with standard
, there's the possibility of literal and regexp patterns alternating in the input string for the first time, so the Concat
behavior will be different. See docstring for new behavior, but basically all patterns are AND
ed except for contiguous literal patterns, which will be space, as before.
I'm making the call that AND
is is the more intuitive outside of contiguous literal patterns, because unlike literal patterns, regex patterns are explicitly delineated with /.../
. For example, it would be a little silly to say /foo/ /bar/
if you prefer to concat those patterns--you would probably (should) prefer to just write /foo bar/
.
Test plan
Adds tests.