(vm: &VirtualMachine, gens: &[ast::Comprehension])
| 24 | } |
| 25 | |
| 26 | fn validate_comprehension(vm: &VirtualMachine, gens: &[ast::Comprehension]) -> PyResult<()> { |
| 27 | if gens.is_empty() { |
| 28 | return Err(vm.new_value_error("comprehension with no generators")); |
| 29 | } |
| 30 | for comp in gens { |
| 31 | validate_expr(vm, &comp.target, ast::ExprContext::Store)?; |
| 32 | validate_expr(vm, &comp.iter, ast::ExprContext::Load)?; |
| 33 | validate_exprs(vm, &comp.ifs, ast::ExprContext::Load, false)?; |
| 34 | } |
| 35 | Ok(()) |
| 36 | } |
| 37 | |
| 38 | fn validate_keywords(vm: &VirtualMachine, keywords: &[ast::Keyword]) -> PyResult<()> { |
| 39 | for keyword in keywords { |
no test coverage detected