( command: string, root: Node, )
| 253 | * ParsedCommand.parse would do. |
| 254 | */ |
| 255 | export function buildParsedCommandFromRoot( |
| 256 | command: string, |
| 257 | root: Node, |
| 258 | ): IParsedCommand { |
| 259 | const pipePositions = extractPipePositions(root) |
| 260 | const redirectionNodes = extractRedirectionNodes(root) |
| 261 | const analysis = analyzeCommand(root, command) |
| 262 | return new TreeSitterParsedCommand( |
| 263 | command, |
| 264 | pipePositions, |
| 265 | redirectionNodes, |
| 266 | analysis, |
| 267 | ) |
| 268 | } |
| 269 | |
| 270 | async function doParse(command: string): Promise<IParsedCommand | null> { |
| 271 | if (!command) return null |
no test coverage detected