Create an empty `arguments` AST node (no parameters).
(vm: &VirtualMachine)
| 316 | |
| 317 | /// Create an empty `arguments` AST node (no parameters). |
| 318 | fn empty_arguments_object(vm: &VirtualMachine) -> PyObjectRef { |
| 319 | let node = NodeAst |
| 320 | .into_ref_with_type(vm, pyast::NodeArguments::static_type().to_owned()) |
| 321 | .unwrap(); |
| 322 | let dict = node.as_object().dict().unwrap(); |
| 323 | for list_field in [ |
| 324 | "posonlyargs", |
| 325 | "args", |
| 326 | "kwonlyargs", |
| 327 | "kw_defaults", |
| 328 | "defaults", |
| 329 | ] { |
| 330 | dict.set_item(list_field, vm.ctx.new_list(vec![]).into(), vm) |
| 331 | .unwrap(); |
| 332 | } |
| 333 | for none_field in ["vararg", "kwarg"] { |
| 334 | dict.set_item(none_field, vm.ctx.none(), vm).unwrap(); |
| 335 | } |
| 336 | node.into() |
| 337 | } |
| 338 | |
| 339 | #[cfg(feature = "parser")] |
| 340 | pub(crate) fn parse( |
no test coverage detected