Allow starred expressions in subscripts

This commit is contained in:
Charlie Marsh 2023-02-20 17:59:35 -05:00
parent 4bdc2d47c1
commit 8aa3bc93f3
3 changed files with 654 additions and 1 deletions

View file

@ -392,6 +392,18 @@ with (0 as a, 1 as b,): pass
}
}
#[test]
fn test_star_index() {
let source = "\
array_slice = array[0, *idxs, -1]
array[0, *idxs, -1] = array_slice
array[*idxs_to_select, *idxs_to_select]
array[3:5, *idxs_to_select]
";
let parse_ast = parse_program(source, "<test>").unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_generator_expression_argument() {
let source = r#"' '.join(