Evaluation of command arguments (#1801)

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Finish adding the baseline refactors for argument invocation

* Finish cleanup and add test

* Add missing plugin references
This commit is contained in:
Jonathan Turner
2020-05-15 20:18:24 -07:00
committed by GitHub
parent 822440d5ff
commit 076fde16dd
139 changed files with 2496 additions and 2188 deletions

View File

@ -567,6 +567,16 @@ impl SpannedExpression {
}
Expression::Variable(Variable::It(_)) => true,
Expression::Path(path) => path.head.has_shallow_it_usage(),
Expression::Invocation(block) => {
for commands in block.block.iter() {
for command in commands.list.iter() {
if command.has_it_iteration() {
return true;
}
}
}
false
}
_ => false,
}
}
@ -614,6 +624,7 @@ impl PrettyDebugWithSource for SpannedExpression {
Expression::Binary(binary) => binary.pretty_debug(source),
Expression::Range(range) => range.pretty_debug(source),
Expression::Block(_) => b::opaque("block"),
Expression::Invocation(_) => b::opaque("invocation"),
Expression::Garbage => b::opaque("garbage"),
Expression::List(list) => b::delimit(
"[",
@ -654,6 +665,7 @@ impl PrettyDebugWithSource for SpannedExpression {
Expression::Binary(binary) => binary.pretty_debug(source),
Expression::Range(range) => range.pretty_debug(source),
Expression::Block(_) => b::opaque("block"),
Expression::Invocation(_) => b::opaque("invocation"),
Expression::Garbage => b::opaque("garbage"),
Expression::List(list) => b::delimit(
"[",
@ -874,6 +886,7 @@ pub enum Expression {
FilePath(PathBuf),
ExternalCommand(ExternalStringCommand),
Command(Span),
Invocation(hir::Block),
Boolean(bool),
@ -896,6 +909,7 @@ impl ShellTypeName for Expression {
Expression::Binary(..) => "binary",
Expression::Range(..) => "range",
Expression::Block(..) => "block",
Expression::Invocation(..) => "command invocation",
Expression::Path(..) => "variable path",
Expression::Boolean(..) => "boolean",
Expression::ExternalCommand(..) => "external",