(&self)
| 30 | |
| 31 | impl ToPythonName for ast::Expr { |
| 32 | fn python_name(&self) -> &'static str { |
| 33 | match self { |
| 34 | Self::BoolOp { .. } | Self::BinOp { .. } | Self::UnaryOp { .. } => "operator", |
| 35 | Self::Subscript { .. } => "subscript", |
| 36 | Self::Await { .. } => "await expression", |
| 37 | Self::Yield { .. } | Self::YieldFrom { .. } => "yield expression", |
| 38 | Self::Compare { .. } => "comparison", |
| 39 | Self::Attribute { .. } => "attribute", |
| 40 | Self::Call { .. } => "function call", |
| 41 | Self::BooleanLiteral(b) => { |
| 42 | if b.value { |
| 43 | "True" |
| 44 | } else { |
| 45 | "False" |
| 46 | } |
| 47 | } |
| 48 | Self::EllipsisLiteral(_) => "ellipsis", |
| 49 | Self::NoneLiteral(_) => "None", |
| 50 | Self::NumberLiteral(_) | Self::BytesLiteral(_) | Self::StringLiteral(_) => "literal", |
| 51 | Self::Tuple(_) => "tuple", |
| 52 | Self::List { .. } => "list", |
| 53 | Self::Dict { .. } => "dict display", |
| 54 | Self::Set { .. } => "set display", |
| 55 | Self::ListComp { .. } => "list comprehension", |
| 56 | Self::DictComp { .. } => "dict comprehension", |
| 57 | Self::SetComp { .. } => "set comprehension", |
| 58 | Self::Generator { .. } => "generator expression", |
| 59 | Self::Starred { .. } => "starred", |
| 60 | Self::Slice { .. } => "slice", |
| 61 | Self::FString { .. } => "f-string expression", |
| 62 | Self::TString { .. } => "t-string expression", |
| 63 | Self::Name { .. } => "name", |
| 64 | Self::Lambda { .. } => "lambda", |
| 65 | Self::If { .. } => "conditional expression", |
| 66 | Self::Named { .. } => "named expression", |
| 67 | Self::IpyEscapeCommand(_) => todo!(), |
| 68 | } |
| 69 | } |
| 70 | } |
no outgoing calls
no test coverage detected