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

Function findStringNode

packages/smart-cells/src/__tests__/python-ast.test.ts:161–170  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

159
160describe("getStringContent", () => {
161 function findStringNode(code: string) {
162 const tree = parsePythonAST(code);
163 const cursor = tree.cursor();
164 while (cursor.next()) {
165 if (cursor.name === "String" || cursor.name === "FormatString") {
166 return cursor.node;
167 }
168 }
169 return null;
170 }
171
172 it("should extract content from triple double-quoted strings", () => {
173 const code = '"""hello world"""';

Callers 1

python-ast.test.tsFile · 0.85

Calls 3

parsePythonASTFunction · 0.85
nextMethod · 0.80
cursorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…