681
* - If two unescaped `{` occur before `}`, then ripgrep will return an error for brace nesting, so don't split on those.
682
*/
683
>
function getEscapeAwareSplitStringForRipgrep(pattern: string): { fixedStart?: string; strInBraces: string; fixedEnd?: string } {
ripgrepTextSearchEngine.ts
684
>
let inBraces = false;
685
>
let escaped = false;
686
>
let fixedStart = '';
687
>
let strInBraces = '';
688
>
for (let i = 0; i < pattern.length; i++) {
689
>
const char = pattern[i];
690
>
switch (char) {
691
>
case '\\':
692
if (escaped) {
693
// If we're already escaped, then just leave the escaped slash and the preceeding slash that escapes it.