update some logic and comments

This commit is contained in:
Folkert 2023-06-29 18:40:14 +02:00
parent b29e612a4d
commit 0308e02ba9
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 8 additions and 3 deletions

View file

@ -1089,7 +1089,12 @@ fn expr_contains_symbol(expr: &Expr, needle: Symbol) -> bool {
match expr {
Expr::Literal(_) => false,
Expr::Call(call) => call.arguments.contains(&needle),
Expr::Tag { arguments, .. } => arguments.contains(&needle),
Expr::Tag {
arguments, reuse, ..
} => match reuse {
None => arguments.contains(&needle),
Some(ru) => ru.symbol == needle || arguments.contains(&needle),
},
Expr::Struct(fields) => fields.contains(&needle),
Expr::NullPointer => false,
Expr::StructAtIndex { structure, .. }