MCPcopy Create free account
hub / github.com/dbcli/mycli / _find_doubled_backticks

Function _find_doubled_backticks

mycli/packages/completion_engine.py:607–628  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

605
606
607def _find_doubled_backticks(text: str) -> list[int]:
608 length = len(text)
609 doubled_backtick_positions: list[int] = []
610 backtick = '`'
611 two_backticks = backtick + backtick
612
613 if two_backticks not in text:
614 return doubled_backtick_positions
615
616 for index in range(0, length):
617 ch = text[index]
618 if ch != backtick:
619 index += 1
620 continue
621 if index + 1 < length and text[index + 1] == backtick:
622 doubled_backtick_positions.append(index)
623 doubled_backtick_positions.append(index + 1)
624 index += 2
625 continue
626 index += 1
627
628 return doubled_backtick_positions
629
630
631@functools.lru_cache(maxsize=128)

Callers 3

is_inside_quotesFunction · 0.85

Calls

no outgoing calls

Tested by 2