(source: string)
| 118 | |
| 119 | /** Parse Python source and return root node. */ |
| 120 | export async function parsePy(source: string): Promise<SyntaxNode> { |
| 121 | const parser = await getPyParser(); |
| 122 | const tree = parser.parse(source); |
| 123 | if (!tree) throw new Error('Failed to parse Python source'); |
| 124 | return tree.rootNode; |
| 125 | } |
| 126 | |
| 127 | /** Parse Go source and return root node. */ |
| 128 | export async function parseGo(source: string): Promise<SyntaxNode> { |
no test coverage detected