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