(
vm: &VirtualMachine,
source_file: &SourceFile,
constant: ast::ExprNumberLiteral,
)
| 356 | } |
| 357 | |
| 358 | pub(super) fn number_literal_to_object( |
| 359 | vm: &VirtualMachine, |
| 360 | source_file: &SourceFile, |
| 361 | constant: ast::ExprNumberLiteral, |
| 362 | ) -> PyObjectRef { |
| 363 | let ast::ExprNumberLiteral { |
| 364 | node_index: _, |
| 365 | range, |
| 366 | value, |
| 367 | } = constant; |
| 368 | let c = match value { |
| 369 | ast::Number::Int(n) => Constant::new_int(n, range), |
| 370 | ast::Number::Float(n) => Constant::new_float(n, range), |
| 371 | ast::Number::Complex { real, imag } => Constant::new_complex(real, imag, range), |
| 372 | }; |
| 373 | c.ast_to_object(vm, source_file) |
| 374 | } |
| 375 | |
| 376 | pub(super) fn string_literal_to_object( |
| 377 | vm: &VirtualMachine, |
no test coverage detected