mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 11:10:26 +02:00
Add support for var/string interp for external names (#729)
This commit is contained in:
@ -15,7 +15,7 @@ pub enum Expr {
|
||||
Var(VarId),
|
||||
VarDecl(VarId),
|
||||
Call(Box<Call>),
|
||||
ExternalCall(String, Span, Vec<Expression>),
|
||||
ExternalCall(Box<Expression>, Vec<Expression>),
|
||||
Operator(Operator),
|
||||
RowCondition(BlockId),
|
||||
BinaryOp(Box<Expression>, Box<Expression>, Box<Expression>), //lhs, op, rhs
|
||||
|
@ -142,7 +142,10 @@ impl Expression {
|
||||
false
|
||||
}
|
||||
Expr::CellPath(_) => false,
|
||||
Expr::ExternalCall(_, _, args) => {
|
||||
Expr::ExternalCall(head, args) => {
|
||||
if head.has_in_variable(working_set) {
|
||||
return true;
|
||||
}
|
||||
for arg in args {
|
||||
if arg.has_in_variable(working_set) {
|
||||
return true;
|
||||
@ -298,7 +301,8 @@ impl Expression {
|
||||
}
|
||||
}
|
||||
Expr::CellPath(_) => {}
|
||||
Expr::ExternalCall(_, _, args) => {
|
||||
Expr::ExternalCall(head, args) => {
|
||||
head.replace_in_variable(working_set, new_var_id);
|
||||
for arg in args {
|
||||
arg.replace_in_variable(working_set, new_var_id)
|
||||
}
|
||||
|
Reference in New Issue
Block a user