literalOrIdentifier (r.ts:70-81): identifier text (backticks kept), a string's first string_content text, `Some("")` for an empty string literal (falsy downstream, like null), None otherwise.
(&self, node: Option<Node<'t>>)
| 279 | /// string's first string_content text, `Some("")` for an empty string |
| 280 | /// literal (falsy downstream, like null), None otherwise. |
| 281 | fn literal_or_identifier(&self, node: Option<Node<'t>>) -> Option<&'t str> { |
| 282 | let node = node?; |
| 283 | match node.kind() { |
| 284 | "identifier" => Some(self.text(node)), |
| 285 | "string" => { |
| 286 | let mut cursor = node.walk(); |
| 287 | for c in node.named_children(&mut cursor) { |
| 288 | if c.kind() == "string_content" { |
| 289 | return Some(self.text(c)); |
| 290 | } |
| 291 | } |
| 292 | Some("") |
| 293 | } |
| 294 | _ => None, |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | // --- the visitNode walk (tree-sitter.ts:936-953, 1248, 1295-1301) ----- |
| 299 | // Hook first (consumed → return; scanFnRefSubtree is a no-op for R), then |
no test coverage detected