mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-26 06:24:29 +00:00
Allow starred expressions in subscripts
This commit is contained in:
parent
4bdc2d47c1
commit
8aa3bc93f3
3 changed files with 654 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue