(source: string)
| 256 | |
| 257 | /** Parse Ruby source and return root node. */ |
| 258 | export async function parseRuby(source: string): Promise<SyntaxNode> { |
| 259 | const parser = await getRubyParser(); |
| 260 | const tree = parser.parse(source); |
| 261 | if (!tree) throw new Error('Failed to parse Ruby source'); |
| 262 | return tree.rootNode; |
| 263 | } |
| 264 | |
| 265 | /** Parse C# source and return root node. */ |
| 266 | export async function parseCsharp(source: string): Promise<SyntaxNode> { |
no test coverage detected