MCPcopy Index your code
hub / github.com/thesysdev/openui / addStmt

Function addStmt

packages/lang-core/src/parser/parser.ts:451–462  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

449 let firstId = "";
450
451 function addStmt(text: string) {
452 // `text` is sliced from `cleaned`, so it's already fence/comment-free.
453 const t = text.trim();
454 if (!t) return;
455 for (const s of split(tokenize(t))) {
456 const expr = parseExpression(s.tokens);
457 const stmt = classifyStatement(s, expr);
458 completedStmtMap.set(s.id, stmt);
459 completedCount++;
460 if (!firstId) firstId = s.id;
461 }
462 }
463
464 // Recompute `cleaned` from `buf`. If the already-completed prefix is no longer
465 // a prefix of the new cleaned text (e.g. an opening ```fence``` just appeared

Callers 1

scanNewCompletedFunction · 0.85

Calls 5

splitFunction · 0.90
tokenizeFunction · 0.90
parseExpressionFunction · 0.90
classifyStatementFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected