MCPcopy
hub / github.com/marimo-team/marimo / replacement_func

Function replacement_func

marimo/_sql/parse.py:205–219  ·  view source on GitHub ↗
(match: re.Match[str])

Source from the content-addressed store, hash-verified

203 pattern = r'("(?:[^"\\]|\\.)*")|(\'(?:[^\'\\]|\\.)*\')|(\{[^}]*\})'
204
205 def replacement_func(match: re.Match[str]) -> str:
206 double_quoted = match.group(1)
207 single_quoted = match.group(2)
208 bracket = match.group(3)
209
210 # If it's a quoted string, return it as-is
211 if double_quoted or single_quoted:
212 return match.group(0)
213
214 # If it's a bracket, quote it and record the offset
215 if bracket:
216 offset_record[match.start()] = QUOTE_LENGTH
217 return f"'{bracket}'"
218
219 return match.group(0)
220
221 replaced_sql = re.sub(pattern, replacement_func, sql)
222

Callers

nothing calls this directly

Calls 1

startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…