MCPcopy
hub / github.com/thesysdev/openui / parseStatements

Function parseStatements

packages/lang-core/src/parser/merge.ts:59–75  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

57}
58
59function parseStatements(input: string): ParsedStatement[] {
60 const trimmed = input.trim();
61 if (!trimmed) return [];
62
63 const result: ParsedStatement[] = [];
64 for (const raw of splitStatementSource(trimmed)) {
65 const stmt = split(tokenize(raw))[0];
66 if (!stmt) continue;
67 result.push({
68 id: stmt.id,
69 ast: parseExpression(stmt.tokens),
70 raw,
71 });
72 }
73
74 return result;
75}
76
77/**
78 * Recursively collect all Ref names from an AST node.

Callers 1

mergeStatementsFunction · 0.85

Calls 5

splitFunction · 0.90
tokenizeFunction · 0.90
parseExpressionFunction · 0.90
splitStatementSourceFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected