()
| 91 | } |
| 92 | |
| 93 | export async function getPyParser(): Promise<Parser> { |
| 94 | await ensureInit(); |
| 95 | if (!pyParser) { |
| 96 | pyParser = new Parser(); |
| 97 | const lang = await loadLanguage('tree-sitter-python.wasm'); |
| 98 | pyParser.setLanguage(lang); |
| 99 | } |
| 100 | return pyParser; |
| 101 | } |
| 102 | |
| 103 | /** Parse TypeScript source and return root node. */ |
| 104 | export async function parseTS(source: string): Promise<SyntaxNode> { |
no test coverage detected