Allow iteration blocks to have an optional extra index parameter (alternative to -n flags) (#6994)

Alters `all`, `any`, `each while`, `each`, `insert`, `par-each`, `reduce`, `update`, `upsert` and `where`,
so that their blocks take an optional parameter containing the index.
This commit is contained in:
Leon
2022-11-21 23:35:11 +10:00
committed by GitHub
parent 899383c30c
commit 833825ae9a
19 changed files with 486 additions and 74 deletions

View File

@ -349,7 +349,7 @@ fn proper_missing_param() -> TestResult {
#[test]
fn block_arity_check1() -> TestResult {
fail_test(r#"ls | each { |x, y| 1}"#, "expected 1 block parameter")
fail_test(r#"ls | each { |x, y, z| 1}"#, "expected 2 block parameters")
}
#[test]