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