(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand)
| 376 | } |
| 377 | |
| 378 | fn collect_commands(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand) { |
| 379 | if node.kind() == "command" { |
| 380 | process_command_node(node, source, result); |
| 381 | return; |
| 382 | } |
| 383 | |
| 384 | // Recurse into children to find command nodes inside pipelines, lists, etc. |
| 385 | let mut cursor = node.walk(); |
| 386 | for child in node.children(&mut cursor) { |
| 387 | collect_commands(child, source, result); |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | fn process_command_node(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand) { |
| 392 | // Get full command text, including redirects if parent is redirected_statement |
no test coverage detected