The callee of a call receiver when it is a plain identifier or attribute chain (`make`, `d.setdefault`), whitespace stripped (#1683).
(&self, call: Node<'t>)
| 791 | /// The callee of a call receiver when it is a plain identifier or attribute |
| 792 | /// chain (`make`, `d.setdefault`), whitespace stripped (#1683). |
| 793 | fn plain_inner_callee(&self, call: Node<'t>) -> Option<String> { |
| 794 | let inner = call.child_by_field_name("function")?; |
| 795 | let text: String = self.text(inner).chars().filter(|c| !c.is_whitespace()).collect(); |
| 796 | if text.is_empty() { |
| 797 | return None; |
| 798 | } |
| 799 | let ok = text.split('.').all(|seg| { |
| 800 | let mut chars = seg.chars(); |
| 801 | matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_') |
| 802 | && chars.all(|c| c.is_ascii_alphanumeric() || c == '_') |
| 803 | }); |
| 804 | if ok { Some(text) } else { None } |
| 805 | } |
| 806 | |
| 807 | /// extractDecoratorsFor — python decorators are PRECEDING SIBLINGS inside |
| 808 | /// decorated_definition. Only bare-identifier decorators yield a target |
no test coverage detected