MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / conditional

Function conditional

atomic-semantic/src/source.rs:325–339  ·  view source on GitHub ↗
(mut node: Node<'_>, source: &str)

Source from the content-addressed store, hash-verified

323}
324
325fn conditional(mut node: Node<'_>, source: &str) -> bool {
326 loop {
327 let mut previous = node.prev_named_sibling();
328 while let Some(attribute) = previous.filter(|node| node.kind() == "attribute_item") {
329 if text(attribute, source).contains("cfg") {
330 return true;
331 }
332 previous = attribute.prev_named_sibling();
333 }
334 let Some(parent) = node.parent() else {
335 return false;
336 };
337 node = parent;
338 }
339}
340
341fn rust_import(
342 node: Node<'_>,

Callers 1

from_treeMethod · 0.85

Calls 4

parentMethod · 0.80
textFunction · 0.70
kindMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected