MCPcopy Create free account
hub / github.com/astral-sh/ruff / unparse_comp

Method unparse_comp

crates/ruff_python_codegen/src/generator.rs:1448–1463  ·  view source on GitHub ↗
(&mut self, generators: &[Comprehension])

Source from the content-addressed store, hash-verified

1446 }
1447
1448 fn unparse_comp(&mut self, generators: &[Comprehension]) {
1449 for comp in generators {
1450 self.p(if comp.is_async {
1451 " async for "
1452 } else {
1453 " for "
1454 });
1455 self.unparse_expr(&comp.target, precedence::COMPREHENSION_TARGET);
1456 self.p(" in ");
1457 self.unparse_expr(&comp.iter, precedence::COMPREHENSION);
1458 for cond in &comp.ifs {
1459 self.p(" if ");
1460 self.unparse_expr(cond, precedence::COMPREHENSION);
1461 }
1462 }
1463 }
1464
1465 fn unparse_string_literal(&mut self, string_literal: &ast::StringLiteral) {
1466 let ast::StringLiteral { value, flags, .. } = string_literal;

Callers 1

unparse_exprMethod · 0.80

Calls 2

pMethod · 0.80
unparse_exprMethod · 0.45

Tested by

no test coverage detected