(&mut self, node: Node<'t>)
| 393 | // --- extractors -------------------------------------------------------------- |
| 394 | |
| 395 | fn extract_function(&mut self, node: Node<'t>) { |
| 396 | stack_guard!(); |
| 397 | let name = self.extract_name(node); |
| 398 | if name == "<anonymous>" { |
| 399 | if let Some(body) = node.child_by_field_name("body") { |
| 400 | self.visit_function_body(body); |
| 401 | } |
| 402 | return; |
| 403 | } |
| 404 | let extra = Extra { |
| 405 | docstring: preceding_docstring(node, self.src), |
| 406 | signature: self.signature_of(node), |
| 407 | is_async: Some(self.is_async(node)), |
| 408 | is_static: Some(self.is_static(node)), |
| 409 | }; |
| 410 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 411 | // (python is not a TYPE_ANNOTATION language — no type refs) |
| 412 | self.extract_decorators_for(node, row); |
| 413 | self.stack.push(Scope { row, kind: "function", name }); |
| 414 | if let Some(body) = node.child_by_field_name("body") { |
| 415 | self.visit_function_body(body); |
| 416 | } |
| 417 | self.stack.pop(); |
| 418 | } |
| 419 | |
| 420 | fn extract_method(&mut self, node: Node<'t>) { |
| 421 | stack_guard!(); |
no test coverage detected