diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index 49ebc9a..7d314be 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -523,18 +523,23 @@ impl ExecEnv { .take(n_alternations) .map(|chunk| ValueRef::clone(&chunk[0])) .chain( - args[2 * n_alternations..] + args.get(2 * n_alternations..) .iter() + .copied() + .flatten() .map(ValueRef::clone) .take(extra_l), ) .collect(), args.chunks(2) .take(n_alternations) - .map(|chunk| ValueRef::clone(&chunk[1])) + .flat_map(|chunk| chunk.get(1)) + .map(ValueRef::clone) .chain( - args[2 * n_alternations..] + args.get(2 * n_alternations..) .iter() + .copied() + .flatten() .map(ValueRef::clone) .take(extra_r), )