(source: string)
| 224 | |
| 225 | /** Parse Rust source and return root node. */ |
| 226 | export async function parseRust(source: string): Promise<SyntaxNode> { |
| 227 | const parser = await getRustParser(); |
| 228 | const tree = parser.parse(source); |
| 229 | if (!tree) throw new Error('Failed to parse Rust source'); |
| 230 | return tree.rootNode; |
| 231 | } |
| 232 | |
| 233 | /** Parse Java source and return root node. */ |
| 234 | export async function parseJava(source: string): Promise<SyntaxNode> { |
no test coverage detected