usesAny: whether any of the metavariables `tts` is written under `node`.
(node: Node, tts: &HashSet<&str>, src: &str, depth: u32)
| 2224 | |
| 2225 | /// usesAny: whether any of the metavariables `tts` is written under `node`. |
| 2226 | fn macro_uses_any(node: Node, tts: &HashSet<&str>, src: &str, depth: u32) -> bool { |
| 2227 | if depth > 32 { |
| 2228 | return true; |
| 2229 | } |
| 2230 | for i in 0..node.child_count() { |
| 2231 | let Some(t) = node.child(i) else { continue }; |
| 2232 | if t.kind() == "metavariable" { |
| 2233 | if tts.contains(macro_tok_text(t, src)) { |
| 2234 | return true; |
| 2235 | } |
| 2236 | } else if t.child_count() > 0 && macro_uses_any(t, tts, src, depth + 1) { |
| 2237 | return true; |
| 2238 | } |
| 2239 | } |
| 2240 | false |
| 2241 | } |
| 2242 | |
| 2243 | /// groupTokens: a group's tokens, its delimiters left out. |
| 2244 | fn macro_group_tokens<'t>(group: Node<'t>) -> Vec<Node<'t>> { |
no test coverage detected