Also fix the flag params

This commit is contained in:
JT
2021-10-12 10:17:45 +13:00
parent 1f45304cf9
commit 96419f168b
6 changed files with 75 additions and 10 deletions

View File

@ -18,6 +18,7 @@ pub enum FlatShape {
Filepath,
GlobPattern,
Variable,
Flag,
Custom(String),
}
@ -61,6 +62,12 @@ pub fn flatten_expression(
for positional in &call.positional {
output.extend(flatten_expression(working_set, positional));
}
for named in &call.named {
output.push((named.0.span, FlatShape::Flag));
if let Some(expr) = &named.1 {
output.extend(flatten_expression(working_set, expr));
}
}
output
}
Expr::ExternalCall(_, name_span, args) => {