MCPcopy Index your code
hub / github.com/RustPython/RustPython / validate_comprehension

Function validate_comprehension

crates/vm/src/stdlib/_ast/validate.rs:26–36  ·  view source on GitHub ↗
(vm: &VirtualMachine, gens: &[ast::Comprehension])

Source from the content-addressed store, hash-verified

24}
25
26fn 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
38fn validate_keywords(vm: &VirtualMachine, keywords: &[ast::Keyword]) -> PyResult<()> {
39 for keyword in keywords {

Callers 1

validate_exprFunction · 0.85

Calls 4

validate_exprFunction · 0.85
validate_exprsFunction · 0.85
ErrClass · 0.50
is_emptyMethod · 0.45

Tested by

no test coverage detected