(source: string)
| 110 | |
| 111 | /** Parse TSX source and return root node. */ |
| 112 | export async function parseTSX(source: string): Promise<SyntaxNode> { |
| 113 | const parser = await getTsxParser(); |
| 114 | const tree = parser.parse(source); |
| 115 | if (!tree) throw new Error('Failed to parse TSX source'); |
| 116 | return tree.rootNode; |
| 117 | } |
| 118 | |
| 119 | /** Parse Python source and return root node. */ |
| 120 | export async function parsePy(source: string): Promise<SyntaxNode> { |
no test coverage detected