Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde_json = "=1.0.149"
sha2 = "=0.10.9"
shlex = "=1.3.0"
thiserror = "=2.0.18"
tree-sitter = "=0.25.10"
tree-sitter = "=0.26.5"
tree-sitter-bash = "=0.25.1"

[features]
Expand Down
8 changes: 4 additions & 4 deletions src/rules/command_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn collect_commands(node: tree_sitter::Node, source: &[u8], commands: &mut Vec<S
if node.field_name_for_child(i as u32) == Some("value") {
continue;
}
if let Some(child) = node.child(i)
if let Some(child) = node.child(i as u32)
&& child.is_named()
{
collect_commands(child, source, commands);
Expand All @@ -290,7 +290,7 @@ fn collect_commands(node: tree_sitter::Node, source: &[u8], commands: &mut Vec<S
}
for i in 0..node.child_count() {
if node.field_name_for_child(i as u32) == Some("redirect")
&& let Some(child) = node.child(i)
&& let Some(child) = node.child(i as u32)
{
collect_substitutions_recursive(child, source, commands);
}
Expand Down Expand Up @@ -318,7 +318,7 @@ fn collect_commands(node: tree_sitter::Node, source: &[u8], commands: &mut Vec<S
// command_substitution nodes, and emit the remaining text.
"command" => {
for i in 0..node.child_count() {
let Some(child) = node.child(i) else {
let Some(child) = node.child(i as u32) else {
continue;
};
if !child.is_named() {
Expand All @@ -345,7 +345,7 @@ fn collect_commands(node: tree_sitter::Node, source: &[u8], commands: &mut Vec<S
// node use the field name "redirect".
let parts: Vec<&str> = (0..node.child_count())
.filter_map(|i| {
let child = node.child(i)?;
let child = node.child(i as u32)?;
if !child.is_named() {
return None;
}
Expand Down