forked from extern/nushell
Add unary not (#5111)
This commit is contained in:
@ -113,6 +113,7 @@ impl Expression {
|
||||
Expr::BinaryOp(left, _, right) => {
|
||||
left.has_in_variable(working_set) || right.has_in_variable(working_set)
|
||||
}
|
||||
Expr::UnaryNot(expr) => expr.has_in_variable(working_set),
|
||||
Expr::Block(block_id) => {
|
||||
let block = working_set.get_block(*block_id);
|
||||
|
||||
@ -264,6 +265,9 @@ impl Expression {
|
||||
left.replace_in_variable(working_set, new_var_id);
|
||||
right.replace_in_variable(working_set, new_var_id);
|
||||
}
|
||||
Expr::UnaryNot(expr) => {
|
||||
expr.replace_in_variable(working_set, new_var_id);
|
||||
}
|
||||
Expr::Block(block_id) => {
|
||||
let block = working_set.get_block(*block_id);
|
||||
|
||||
@ -425,6 +429,9 @@ impl Expression {
|
||||
left.replace_span(working_set, replaced, new_span);
|
||||
right.replace_span(working_set, replaced, new_span);
|
||||
}
|
||||
Expr::UnaryNot(expr) => {
|
||||
expr.replace_span(working_set, replaced, new_span);
|
||||
}
|
||||
Expr::Block(block_id) => {
|
||||
let mut block = working_set.get_block(*block_id).clone();
|
||||
|
||||
|
Reference in New Issue
Block a user