Update todo

This commit is contained in:
JT 2021-08-27 14:30:10 +12:00
parent bb9e6731ea
commit 24cd1b591c
3 changed files with 20 additions and 6 deletions

View file

@ -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?

View file

@ -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

View file

@ -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, ""),
}