mirror of
https://github.com/nushell/nushell.git
synced 2024-12-22 15:13:01 +01:00
Update todo
This commit is contained in:
parent
bb9e6731ea
commit
24cd1b591c
4
TODO.md
4
TODO.md
@ -11,12 +11,16 @@
|
||||
- [x] refactor into subcrates
|
||||
- [x] subcommand alias
|
||||
- [x] type inference from successful parse (eg not `List<unknown>` but `List<int>`)
|
||||
- [ ] parsing tables
|
||||
- [ ] ...rest without calling it rest
|
||||
- [ ] operator overflow
|
||||
- [ ] finish operator type-checking
|
||||
- [ ] Column path
|
||||
- [ ] Ranges
|
||||
- [ ] Source
|
||||
- [ ] Autoenv
|
||||
- [ ] Block params
|
||||
- [ ] let [first, rest] = [1, 2, 3]
|
||||
|
||||
## Maybe:
|
||||
- [ ] default param values?
|
||||
|
@ -34,11 +34,12 @@ fn eval_call(state: &State, call: &Call) -> Result<Value, ShellError> {
|
||||
let decl = parser_state.get_decl(call.decl_id);
|
||||
if let Some(block_id) = decl.body {
|
||||
let state = state.enter_scope();
|
||||
for (arg, param) in call
|
||||
.positional
|
||||
.iter()
|
||||
.zip(decl.signature.required_positional.iter())
|
||||
{
|
||||
for (arg, param) in call.positional.iter().zip(
|
||||
decl.signature
|
||||
.required_positional
|
||||
.iter()
|
||||
.chain(decl.signature.optional_positional.iter()),
|
||||
) {
|
||||
let result = eval_expression(&state, arg)?;
|
||||
let var_id = param
|
||||
.var_id
|
||||
|
@ -89,7 +89,16 @@ impl Display for Value {
|
||||
write!(f, "{}", val)
|
||||
}
|
||||
Value::String { val, .. } => write!(f, "{}", val),
|
||||
Value::List { .. } => write!(f, "<list>"),
|
||||
Value::List { val, .. } => {
|
||||
write!(
|
||||
f,
|
||||
"[{}]",
|
||||
val.iter()
|
||||
.map(|x| x.to_string())
|
||||
.collect::<Vec<String>>()
|
||||
.join(", ".into())
|
||||
)
|
||||
}
|
||||
Value::Block { .. } => write!(f, "<block>"),
|
||||
Value::Nothing { .. } => write!(f, ""),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user