(input: string)
| 57 | } |
| 58 | |
| 59 | function 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. |
no test coverage detected